summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/tasks/upgrade/config_changes.yml
blob: 72165611781ed997c13dfc3147416b48d87605fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
---
- name: Update systemd units
  include_tasks: ../systemd_units.yml
  when: openshift_is_containerized | bool

- name: Update oreg value
  yedit:
    src: "{{ openshift.common.config_base }}/node/node-config.yaml"
    key: 'imageConfig.format'
    value: "{{ oreg_url | default(oreg_url_node) }}"
  when: oreg_url is defined or oreg_url_node is defined

- name: Remove obsolete docker-sdn-ovs.conf
  file:
    path: "/etc/systemd/system/docker.service.d/docker-sdn-ovs.conf"
    state: absent

# https://bugzilla.redhat.com/show_bug.cgi?id=1513054
- name: Clean up dockershim data
  file:
    path: "/var/lib/dockershim/sandbox/"
    state: absent

# Disable Swap Block (pre)
- block:
  - name: Remove swap entries from /etc/fstab
    replace:
      dest: /etc/fstab
      regexp: '(^[^#].*swap.*)'
      replace: '# \1'
      backup: yes

  - name: Add notice about disabling swap
    lineinfile:
      dest: /etc/fstab
      line: '# OpenShift-Ansible Installer disabled swap per overcommit guidelines'
      state: present

  - name: Disable swap
    command: swapoff --all

  when:
  - openshift_node_upgrade_swap_result | default(False) | bool
  - openshift_disable_swap | default(true) | bool
# End Disable Swap Block

- name: Apply 3.6 dns config changes
  yedit:
    src: /etc/origin/node/node-config.yaml
    key: "{{ item.key }}"
    value: "{{ item.value }}"
  with_items:
  - key: "dnsBindAddress"
    value: "127.0.0.1:53"
  - key: "dnsRecursiveResolvConf"
    value: "/etc/origin/node/resolv.conf"

- name: Install Node service file
  template:
    dest: "/etc/systemd/system/{{ openshift_service_type }}-node.service"
    src: "node.service.j2"
  register: l_node_unit
  when: not openshift_is_containerized | bool

- name: Reset selinux context
  command: restorecon -RF {{ openshift_node_data_dir }}/openshift.local.volumes
  when:
  - ansible_selinux is defined
  - ansible_selinux.status == 'enabled'

# NOTE: This is needed to make sure we are using the correct set
#       of systemd unit files. The RPMs lay down defaults but
#       the install/upgrade may override them in /etc/systemd/system/.
# NOTE: We don't use the systemd module as some versions of the module
#       require a service to be part of the call.
- name: Reload systemd units
  command: systemctl daemon-reload