config_changes.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ---
  2. - name: Update systemd units
  3. include_tasks: ../systemd_units.yml
  4. when: openshift.common.is_containerized
  5. - name: Update oreg value
  6. yedit:
  7. src: "{{ openshift.common.config_base }}/node/node-config.yaml"
  8. key: 'imageConfig.format'
  9. value: "{{ oreg_url | default(oreg_url_node) }}"
  10. when: oreg_url is defined or oreg_url_node is defined
  11. - name: Remove obsolete docker-sdn-ovs.conf
  12. file:
  13. path: "/etc/systemd/system/docker.service.d/docker-sdn-ovs.conf"
  14. state: absent
  15. # https://bugzilla.redhat.com/show_bug.cgi?id=1513054
  16. - name: Clean up dockershim data
  17. file:
  18. path: "/var/lib/dockershim/sandbox/"
  19. state: absent
  20. # Disable Swap Block (pre)
  21. - block:
  22. - name: Remove swap entries from /etc/fstab
  23. replace:
  24. dest: /etc/fstab
  25. regexp: '(^[^#].*swap.*)'
  26. replace: '# \1'
  27. backup: yes
  28. - name: Add notice about disabling swap
  29. lineinfile:
  30. dest: /etc/fstab
  31. line: '# OpenShift-Ansible Installer disabled swap per overcommit guidelines'
  32. state: present
  33. - name: Disable swap
  34. command: swapoff --all
  35. when:
  36. - openshift_node_upgrade_swap_result | default(False) | bool
  37. - openshift_disable_swap | default(true) | bool
  38. # End Disable Swap Block
  39. - name: Apply 3.6 dns config changes
  40. yedit:
  41. src: /etc/origin/node/node-config.yaml
  42. key: "{{ item.key }}"
  43. value: "{{ item.value }}"
  44. with_items:
  45. - key: "dnsBindAddress"
  46. value: "127.0.0.1:53"
  47. - key: "dnsRecursiveResolvConf"
  48. value: "/etc/origin/node/resolv.conf"
  49. - name: Install Node service file
  50. template:
  51. dest: "/etc/systemd/system/{{ openshift_service_type }}-node.service"
  52. src: "node.service.j2"
  53. register: l_node_unit
  54. - name: Reset selinux context
  55. command: restorecon -RF {{ openshift_node_data_dir }}/openshift.local.volumes
  56. when:
  57. - ansible_selinux is defined
  58. - ansible_selinux.status == 'enabled'
  59. # NOTE: This is needed to make sure we are using the correct set
  60. # of systemd unit files. The RPMs lay down defaults but
  61. # the install/upgrade may override them in /etc/systemd/system/.
  62. # NOTE: We don't use the systemd module as some versions of the module
  63. # require a service to be part of the call.
  64. - name: Reload systemd units
  65. command: systemctl daemon-reload
  66. when: l_node_unit is changed