summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/tasks/systemd_units.yml
blob: a2192a4d091cd6b7bb0284ebdca525f3d1cfdba4 (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
# This file is included both in the openshift_master role and in the upgrade
# playbooks.

- name: Install Node dependencies docker service file
  template:
    dest: "/etc/systemd/system/{{ openshift.common.service_type }}-node-dep.service"
    src: openshift.docker.node.dep.service
  register: install_node_dep_result
  when: openshift.common.is_containerized | bool

- name: Install Node docker service file
  template:
    dest: "/etc/systemd/system/{{ openshift.common.service_type }}-node.service"
    src: openshift.docker.node.service
  register: install_node_result
  when: openshift.common.is_containerized | bool

- name: Create the openvswitch service env file
  template:
    src: openvswitch.sysconfig.j2
    dest: /etc/sysconfig/openvswitch
  when: openshift.common.is_containerized | bool
  register: install_ovs_sysconfig
  notify:
  - restart openvswitch

- name: Install OpenvSwitch docker service file
  template:
    dest: "/etc/systemd/system/openvswitch.service"
    src: openvswitch.docker.service
  when: openshift.common.is_containerized | bool and openshift.common.use_openshift_sdn | bool
  notify:
  - restart openvswitch

- name: Configure Node settings
  lineinfile:
    dest: /etc/sysconfig/{{ openshift.common.service_type }}-node
    regexp: "{{ item.regex }}"
    line: "{{ item.line }}"
    create: true
  with_items:
    - regex: '^OPTIONS='
      line: "OPTIONS=--loglevel={{ openshift.node.debug_level }}"
    - regex: '^CONFIG_FILE='
      line: "CONFIG_FILE={{ openshift_node_config_file }}"
    - regex: '^IMAGE_VERSION='
      line: "IMAGE_VERSION={{ openshift_image_tag }}"
  notify:
  - restart node

- name: Configure Proxy Settings
  lineinfile:
    dest: /etc/sysconfig/{{ openshift.common.service_type }}-node
    regexp: "{{ item.regex }}"
    line: "{{ item.line }}"
    create: true
  with_items:
    - regex: '^HTTP_PROXY='
      line: "HTTP_PROXY={{ openshift.common.http_proxy | default('') }}"
    - regex: '^HTTPS_PROXY='
      line: "HTTPS_PROXY={{ openshift.common.https_proxy | default('') }}"
    - regex: '^NO_PROXY='
      line: "NO_PROXY={{ openshift.common.no_proxy | default([]) | join(',') }},{{ openshift.common.portal_net }},{{ hostvars[groups.oo_first_master.0].openshift.master.sdn_cluster_network_cidr }}"
  when: ('http_proxy' in openshift.common and openshift.common.http_proxy != '')
  notify:
  - restart node

- name: Reload systemd units
  command: systemctl daemon-reload
  when: openshift.common.is_containerized | bool and (install_node_result | changed or install_ovs_sysconfig | changed or install_node_dep_result | changed)
  notify:
  - restart node