diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2017-02-08 17:29:41 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2017-02-10 10:53:44 +0100 |
commit | b84a2cdcbdcbceed8da09485a9e9015378b5818f (patch) | |
tree | c074c22c11750569f11e840612f921e1c3654a5c /roles/openshift_node/tasks | |
parent | 73d91dbcbcd3f2188977ac36e06adf57803b4842 (diff) | |
download | openshift-b84a2cdcbdcbceed8da09485a9e9015378b5818f.tar.gz openshift-b84a2cdcbdcbceed8da09485a9e9015378b5818f.tar.bz2 openshift-b84a2cdcbdcbceed8da09485a9e9015378b5818f.tar.xz openshift-b84a2cdcbdcbceed8da09485a9e9015378b5818f.zip |
node: refactor Docker container tasks in a block
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'roles/openshift_node/tasks')
-rw-r--r-- | roles/openshift_node/tasks/systemd_units.yml | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/roles/openshift_node/tasks/systemd_units.yml b/roles/openshift_node/tasks/systemd_units.yml index 941fd1d28..52482d09b 100644 --- a/roles/openshift_node/tasks/systemd_units.yml +++ b/roles/openshift_node/tasks/systemd_units.yml @@ -2,20 +2,6 @@ # This file is included both in the openshift_master role and in the upgrade # playbooks. -- name: Pre-pull node image - command: > - docker pull {{ openshift.node.node_image }}:{{ openshift_image_tag }} - register: pull_result - changed_when: "'Downloaded newer image' in pull_result.stdout" - when: openshift.common.is_containerized | bool and not openshift.common.is_node_system_container | bool - -- name: Pre-pull openvswitch image - command: > - docker pull {{ openshift.node.ovs_image }}:{{ openshift_image_tag }} - register: pull_result - changed_when: "'Downloaded newer image' in pull_result.stdout" - when: openshift.common.is_containerized | bool and openshift.common.use_openshift_sdn | bool and not openshift.common.is_node_system_container | bool - - name: Install Node dependencies docker service file template: dest: "/etc/systemd/system/{{ openshift.common.service_type }}-node-dep.service" @@ -23,11 +9,18 @@ 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 +- block: + - name: Pre-pull node image + command: > + docker pull {{ openshift.node.node_image }}:{{ openshift_image_tag }} + register: pull_result + changed_when: "'Downloaded newer image' in pull_result.stdout" + + - 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 - not openshift.common.is_node_system_container | bool @@ -69,16 +62,23 @@ notify: - restart openvswitch -- name: Install OpenvSwitch docker service file - template: - dest: "/etc/systemd/system/openvswitch.service" - src: openvswitch.docker.service +- block: + - name: Pre-pull openvswitch image + command: > + docker pull {{ openshift.node.ovs_image }}:{{ openshift_image_tag }} + register: pull_result + changed_when: "'Downloaded newer image' in pull_result.stdout" + + - name: Install OpenvSwitch docker service file + template: + dest: "/etc/systemd/system/openvswitch.service" + src: openvswitch.docker.service + notify: + - restart openvswitch when: - openshift.common.is_containerized | bool - openshift.common.use_openshift_sdn | default(true) | bool - not openshift.common.is_openvswitch_system_container | bool - notify: - - restart openvswitch - name: Configure Node settings lineinfile: |