update: fix var register

Even if the task is skipped, ansible registers the var as 'skipped' so
this task the task using this variable for its next usage.

Signed-off-by: Sébastien Han <seb@redhat.com>
pull/1939/head
Sébastien Han 2017-09-29 12:05:43 +02:00
parent ca76c46981
commit b9050d6229
1 changed files with 9 additions and 31 deletions

View File

@ -312,37 +312,24 @@
- ceph-defaults - ceph-defaults
tasks: tasks:
- name: unset osd flags - name: set_fact docker_exec_cmd_osd
command: ceph osd unset {{ item }} --cluster {{ cluster }} set_fact:
with_items: docker_exec_cmd_update_osd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
- noout when:
- noscrub - containerized_deployment
- nodeep-scrub
delegate_to: "{{ groups[mon_group_name][0] }}"
when: not containerized_deployment
- name: unset containerized osd flags - name: unset osd flags
command: | command: "{{ docker_exec_cmd_update_osd|default('') }} ceph osd unset {{ item }} --cluster {{ cluster }}"
docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph osd unset {{ item }} --cluster {{ cluster }}
with_items: with_items:
- noout - noout
- noscrub - noscrub
- nodeep-scrub - nodeep-scrub
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
when: containerized_deployment
- name: get osd versions - name: get osd versions
command: ceph --cluster {{ cluster }} versions command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions"
register: ceph_versions register: ceph_versions
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
when: not containerized_deployment
- name: containers - get osd versions
command: |
docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} versions
register: ceph_versions
delegate_to: "{{ groups[mon_group_name][0] }}"
when: containerized_deployment
- name: set_fact ceph_versions_osd - name: set_fact ceph_versions_osd
set_fact: set_fact:
@ -352,21 +339,12 @@
# length == 1 means there is a single osds versions entry # length == 1 means there is a single osds versions entry
# thus all the osds are running the same version # thus all the osds are running the same version
- name: complete osds upgrade - name: complete osds upgrade
command: ceph --cluster {{ cluster }} osd require-osd-release luminous command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} osd require-osd-release luminous"
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
when: when:
- not containerized_deployment
- (ceph_versions.stdout|from_json).osd | length == 1 - (ceph_versions.stdout|from_json).osd | length == 1
- ceph_versions_osd | string | search("ceph version 12") - ceph_versions_osd | string | search("ceph version 12")
- name: containers - complete osds upgrade
command: |
docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} osd require-osd-release luminous
delegate_to: "{{ groups[mon_group_name][0] }}"
when:
- containerized_deployment
- (ceph_versions.stdout|from_json).osd | length == 1
- ceph_versions_osd | string | search("ceph version 12")
- name: upgrade ceph mdss cluster - name: upgrade ceph mdss cluster