systemd_units.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. ---
  2. # input variables
  3. # - openshift.node.node_image
  4. # - openshift_image_tag
  5. # - openshift.common.is_containerized
  6. # - openshift.node.ovs_image
  7. # - openshift.common.use_openshift_sdn
  8. # - openshift.common.service_type
  9. # - openshift.node.debug_level
  10. # - openshift.common.config_base
  11. # - openshift.common.http_proxy
  12. # - openshift.common.portal_net
  13. # - openshift.common
  14. # - openshift.common.http_proxy
  15. # notify:
  16. # - restart openvswitch
  17. # - restart node
  18. # This file is included both in the openshift_master role and in the upgrade
  19. # playbooks.
  20. - name: Install Node dependencies docker service file
  21. template:
  22. dest: "/etc/systemd/system/{{ openshift.common.service_type }}-node-dep.service"
  23. src: openshift.docker.node.dep.service
  24. when: openshift.common.is_containerized | bool
  25. notify:
  26. - reload systemd units
  27. - restart node
  28. - name: Install Node docker service file
  29. template:
  30. dest: "/etc/systemd/system/{{ openshift.common.service_type }}-node.service"
  31. src: openshift.docker.node.service
  32. when: openshift.common.is_containerized | bool
  33. notify:
  34. - reload systemd units
  35. - restart node
  36. - name: Create the openvswitch service env file
  37. template:
  38. src: openvswitch.sysconfig.j2
  39. dest: /etc/sysconfig/openvswitch
  40. when: openshift.common.is_containerized | bool
  41. notify:
  42. - reload systemd units
  43. - restart openvswitch
  44. # May be a temporary workaround.
  45. # https://bugzilla.redhat.com/show_bug.cgi?id=1331590
  46. - name: Create OpenvSwitch service.d directory
  47. file: path=/etc/systemd/system/openvswitch.service.d/ state=directory
  48. when: openshift.common.use_openshift_sdn | default(true) | bool
  49. - name: Install OpenvSwitch service OOM fix
  50. template:
  51. dest: "/etc/systemd/system/openvswitch.service.d/01-avoid-oom.conf"
  52. src: openvswitch-avoid-oom.conf
  53. when: openshift.common.use_openshift_sdn | default(true) | bool
  54. notify:
  55. - reload systemd units
  56. - restart openvswitch
  57. - name: Install OpenvSwitch docker service file
  58. template:
  59. dest: "/etc/systemd/system/openvswitch.service"
  60. src: openvswitch.docker.service
  61. when: openshift.common.is_containerized | bool and openshift.common.use_openshift_sdn | default(true) | bool
  62. notify:
  63. - reload systemd units
  64. - restart openvswitch
  65. - name: Configure Node settings
  66. lineinfile:
  67. dest: /etc/sysconfig/{{ openshift.common.service_type }}-node
  68. regexp: "{{ item.regex }}"
  69. line: "{{ item.line }}"
  70. create: true
  71. with_items:
  72. - regex: '^OPTIONS='
  73. line: "OPTIONS=--loglevel={{ openshift.node.debug_level | default(2) }}"
  74. - regex: '^CONFIG_FILE='
  75. line: "CONFIG_FILE={{ openshift.common.config_base }}/node/node-config.yaml"
  76. - regex: '^IMAGE_VERSION='
  77. line: "IMAGE_VERSION={{ openshift_image_tag }}"
  78. notify:
  79. - restart node
  80. - name: Configure Proxy Settings
  81. lineinfile:
  82. dest: /etc/sysconfig/{{ openshift.common.service_type }}-node
  83. regexp: "{{ item.regex }}"
  84. line: "{{ item.line }}"
  85. create: true
  86. with_items:
  87. - regex: '^HTTP_PROXY='
  88. line: "HTTP_PROXY={{ openshift.common.http_proxy | default('') }}"
  89. - regex: '^HTTPS_PROXY='
  90. line: "HTTPS_PROXY={{ openshift.common.https_proxy | default('') }}"
  91. - regex: '^NO_PROXY='
  92. line: "NO_PROXY={{ openshift.common.no_proxy | default([]) }},{{ openshift.common.portal_net }},{{ hostvars[groups.oo_first_master.0].openshift.master.sdn_cluster_network_cidr }}"
  93. when: ('http_proxy' in openshift.common and openshift.common.http_proxy != '')
  94. notify:
  95. - restart node