summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-03-26 17:07:10 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2016-03-29 09:52:00 -0400
commit1e53057c40fcc6648e4c69d83d0cebc33789a893 (patch)
tree60be0e1219bf8d7732ff1aae5231086e6de499e8 /roles/openshift_node
parent6d74968b30f3dff2046ab50330c2de55ac103a8b (diff)
downloadopenshift-1e53057c40fcc6648e4c69d83d0cebc33789a893.tar.gz
openshift-1e53057c40fcc6648e4c69d83d0cebc33789a893.tar.bz2
openshift-1e53057c40fcc6648e4c69d83d0cebc33789a893.tar.xz
openshift-1e53057c40fcc6648e4c69d83d0cebc33789a893.zip
First pass at systemd unit refactor
Diffstat (limited to 'roles/openshift_node')
-rw-r--r--roles/openshift_node/tasks/main.yml39
-rw-r--r--roles/openshift_node/tasks/systemd_units.yml40
2 files changed, 42 insertions, 37 deletions
diff --git a/roles/openshift_node/tasks/main.yml b/roles/openshift_node/tasks/main.yml
index ca1e26459..993c8c0cd 100644
--- a/roles/openshift_node/tasks/main.yml
+++ b/roles/openshift_node/tasks/main.yml
@@ -53,27 +53,8 @@
docker pull {{ openshift.node.ovs_image }}:{{ openshift_version }}
when: openshift.common.is_containerized | bool and openshift.common.use_openshift_sdn | 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
-
-- 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: Install the systemd units
+ include: systemd_units.yml
- name: Reload systemd units
command: systemctl daemon-reload
@@ -100,22 +81,6 @@
notify:
- restart node
-- 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_version }}"
- notify:
- - restart node
-
- name: Additional storage plugin configuration
include: storage_plugins/main.yml
diff --git a/roles/openshift_node/tasks/systemd_units.yml b/roles/openshift_node/tasks/systemd_units.yml
new file mode 100644
index 000000000..be4b4ed61
--- /dev/null
+++ b/roles/openshift_node/tasks/systemd_units.yml
@@ -0,0 +1,40 @@
+# This file is included both in the openshift_master role and in the upgrade
+# playbooks.
+
+- 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
+
+- 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_version }}"
+ notify:
+ - restart node