summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorSteve Milner <smilner@redhat.com>2017-06-05 14:39:57 -0400
committerSteve Milner <smilner@redhat.com>2017-06-06 14:38:56 -0400
commit7302c2d7769a8adb428d0a0633aed2d1799f2c2a (patch)
tree7a30de1146592a4e3475d28b31a43e023ea7ae48 /roles
parent67da7e2e4699f9a226a436218723749ebc14ace1 (diff)
downloadopenshift-7302c2d7769a8adb428d0a0633aed2d1799f2c2a.tar.gz
openshift-7302c2d7769a8adb428d0a0633aed2d1799f2c2a.tar.bz2
openshift-7302c2d7769a8adb428d0a0633aed2d1799f2c2a.tar.xz
openshift-7302c2d7769a8adb428d0a0633aed2d1799f2c2a.zip
Add node unit file on upgrade
When rpm_upgrade is used for upgrading the node's unit file will be overridden. systemd is then reloaded if the files are templated successfully. Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1455843
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_node_upgrade/tasks/rpm_upgrade.yml15
l---------roles/openshift_node_upgrade/templates/atomic-openshift-node.service.j21
l---------roles/openshift_node_upgrade/templates/origin-node.service.j21
3 files changed, 17 insertions, 0 deletions
diff --git a/roles/openshift_node_upgrade/tasks/rpm_upgrade.yml b/roles/openshift_node_upgrade/tasks/rpm_upgrade.yml
index 480e87d58..06a2d16ba 100644
--- a/roles/openshift_node_upgrade/tasks/rpm_upgrade.yml
+++ b/roles/openshift_node_upgrade/tasks/rpm_upgrade.yml
@@ -12,3 +12,18 @@
- name: Ensure python-yaml present for config upgrade
package: name=PyYAML state=present
when: not openshift.common.is_atomic | bool
+
+- name: Install Node service file
+ template:
+ dest: "/etc/systemd/system/{{ openshift.common.service_type }}-node.service"
+ src: "{{ openshift.common.service_type }}-node.service.j2"
+ register: l_node_unit
+
+# 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
+ when: l_node_unit | changed
diff --git a/roles/openshift_node_upgrade/templates/atomic-openshift-node.service.j2 b/roles/openshift_node_upgrade/templates/atomic-openshift-node.service.j2
new file mode 120000
index 000000000..6041fb13a
--- /dev/null
+++ b/roles/openshift_node_upgrade/templates/atomic-openshift-node.service.j2
@@ -0,0 +1 @@
+../../openshift_node/templates/atomic-openshift-node.service.j2 \ No newline at end of file
diff --git a/roles/openshift_node_upgrade/templates/origin-node.service.j2 b/roles/openshift_node_upgrade/templates/origin-node.service.j2
new file mode 120000
index 000000000..79c45a303
--- /dev/null
+++ b/roles/openshift_node_upgrade/templates/origin-node.service.j2
@@ -0,0 +1 @@
+../../openshift_node/templates/origin-node.service.j2 \ No newline at end of file