]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
use pre_tasks and post_tasks when necessary
authorRishabh Dave <ridave@redhat.com>
Mon, 12 Nov 2018 12:21:26 +0000 (17:51 +0530)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Wed, 5 Dec 2018 08:17:10 +0000 (08:17 +0000)
Signed-off-by: Rishabh Dave <ridave@redhat.com>
infrastructure-playbooks/add-osd.yml
infrastructure-playbooks/shrink-osd-ceph-disk.yml
infrastructure-playbooks/shrink-osd.yml
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml
infrastructure-playbooks/take-over-existing-cluster.yml
infrastructure-playbooks/untested-by-ci/replace-osd.yml
site.yml.sample

index 9acf83e8f7b05509a5d6bae1bfa2bca6070e2936..fa5a2f460ead5798f1c3962c4c925e5a3b5e79bd 100644 (file)
@@ -24,8 +24,7 @@
   vars:
     delegate_facts_host: True
 
-  tasks:
-    # pre-tasks for following import
+  pre_tasks:
     - name: gather facts
       setup:
       when:
@@ -42,6 +41,7 @@
       when:
         - delegate_facts_host | bool
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
@@ -52,8 +52,7 @@
   gather_facts: False
   become: True
 
-  tasks:
-    # pre-tasks for following import
+  pre_tasks:
     # this task is needed so we can skip the openstack_config.yml include in roles/ceph-osd
     - name: set_fact add_osd
       set_fact:
@@ -65,6 +64,7 @@
       run_once: True
       changed_when: False
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
@@ -88,7 +88,7 @@
     - import_role:
         name: ceph-osd
 
-    # post-tasks for preceding import
+  post_tasks:
     - name: unset noup flag
       command: "{{ docker_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
       delegate_to: "{{ groups['mons'][0] }}"
index e3985932f4f46f23106597c1be21d70c60d7026e..b6adcaa6c4c7ce50e102037f93711dfc7ec914e8 100644 (file)
@@ -34,8 +34,7 @@
   vars:
     mon_group_name: mons
     osd_group_name: osds
-  tasks:
-    # pre-task for following import
+  pre_tasks:
     - name: exit playbook, if user did not mean to shrink cluster
       fail:
         msg: "Exiting shrink-osd playbook, no osd(s) was/were removed..
            -e osd_to_kill=0,1,2,3 argument."
       when: osd_to_kill is not defined
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
-    # post-task for preceding import
+  post_tasks:
     - name: "set_fact docker_exec_cmd build {{ container_binary }} exec command (containerized)"
       set_fact:
         docker_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
index 59466efbec0d48ddf6fd7eee13ef5cfc8cb53037..40b0c0d66715474f2c63125a4f5e4dc06e8f7c9a 100644 (file)
@@ -38,8 +38,7 @@
     mon_group_name: mons
     osd_group_name: osds
 
-  tasks:
-    # pre-task for following import
+  pre_tasks:
     - name: exit playbook, if user did not mean to shrink cluster
       fail:
         msg: "Exiting shrink-osd playbook, no osd(s) was/were removed..
            -e osd_to_kill=0,1,2,3 argument."
       when: osd_to_kill is not defined
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
-    # post-task for preceding import
+  post_tasks:
     - name: set_fact docker_exec_cmd build docker exec command (containerized)
       set_fact:
         docker_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
index d701dda76691c6c071716b6b125638e8b63621d5..e702d8c35e49eeb72284b945fb54ff8376e43ff1 100644 (file)
@@ -56,8 +56,7 @@
     - "{{ mon_group_name|default('mons') }}"
   serial: 1
   become: true
-  tasks:
-    # pre-tasks for following import -
+  pre_tasks:
     - name: select a running monitor
       set_fact: mon_host={{ item }}
       with_items: "{{ groups[mon_group_name] }}"
       changed_when: false
       failed_when: false
 
+  tasks:
     - import_role:
         name: ceph-defaults
     - import_role:
     - import_role:
         name: ceph-mon
 
-    # post-tasks for preceding import -
   post_tasks:
     # We don't do a container test by running 'docker exec ...' since not all the monitors have switched to containers yet.
     # Thus, we continue to use the 'ceph' binary from the host, there is no issue with that.
 
   serial: 1
   become: true
-  tasks:
-    # pre-tasks for following import -
+  pre_tasks:
     # failed_when: false is here because if we're
     # working with a jewel cluster then ceph mgr
     # will not exist
         - /var/lib/ceph
         - /etc/ceph
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
 
   serial: 1
   become: true
-  tasks:
+  pre_tasks:
 
     - import_role:
         name: ceph-defaults
 
-    # pre-tasks for following importing
     - name: collect running osds and ceph-disk unit(s)
       shell: |
         systemctl list-units | grep "loaded active" | grep -Eo 'ceph-osd@[0-9]+.service|ceph-disk@dev-[a-z]{3,4}[0-9]{1}.service|ceph-volume|ceph\.target'
       when:
         - osd_running.rc != 0
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
     - import_role:
         name: ceph-osd
 
-    # post-task for preceding import -
+  post_tasks:
     - name: get num_pgs
       command: >
         {{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s --format json
 
   serial: 1
   become: true
-  tasks:
+  pre_tasks:
 
-    # pre-tasks for following inmport
     - name: stop non-containerized ceph mds(s)
       service:
         name: "ceph-mds@{{ ansible_hostname }}"
         - /var/lib/ceph
         - /etc/ceph
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
 
   serial: 1
   become: true
-  tasks:
+  pre_tasks:
 
-    # pre-tasks for following import -
     - name: stop non-containerized ceph rgw(s)
       service:
         name: "ceph-radosgw@rgw.{{ ansible_hostname }}"
         - /var/lib/ceph
         - /etc/ceph
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
 
   serial: 1
   become: true
-  tasks:
-    # pre-tasks for following import -
+  pre_tasks:
     - name: stop non-containerized ceph rbd mirror(s)
       service:
         name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
         - /var/lib/ceph
         - /etc/ceph
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
 
   serial: 1
   become: true
-  tasks:
+  pre_tasks:
 
-    # pre-tasks for following import -
     # failed_when: false is here because if we're
     # working with a jewel cluster then ceph nfs
     # will not exist
         - /var/lib/ceph
         - /etc/ceph
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
index 7f70112a7d20c487a5768af2d189ca7ee87d1bb8..4ef8b4f0c4965faba6fdc0d84a708663a3b7baa9 100644 (file)
@@ -35,7 +35,7 @@
     - import_role:
         name: ceph-defaults
 
-    # post-tasks for preceding import -
+  post_tasks:
     - name: get the name of the existing ceph cluster
       shell: |
           basename $(grep --exclude '*.bak' -R fsid /etc/ceph/ | egrep -o '^[^.]*' | head -n 1)
index 8fce11d70a31aa8a9c51cfff8f7b13a2ec292139..fc364097d5d28d39bc73c62464b639b7e3327aaf 100644 (file)
@@ -37,8 +37,7 @@
   vars:
     mon_group_name: mons
     osd_group_name: osds
-  tasks:
-    # pre-tasks for following import -
+  pre_tasks:
     - name: exit playbook, if user did not mean to replace the osd(s)
       fail:
         msg: "Exiting replace-osd playbook, no osd(s) was/were replaced..
            -e osd_to_replace=0,1,2,3 argument."
       when: osd_to_replace is not defined
 
+  tasks:
     - import_role:
         name: ceph-defaults
 
-    # post-tasks for preceding import -
+  post_tasks:
     - name: set_fact docker_exec_cmd build docker exec command (containerized)
       set_fact:
         docker_exec_cmd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
index 677e5516020292a401b7a262e60cadd52ef54f48..b963f2df2a04740a96d16d8dea09c9c817dc3784 100644 (file)
@@ -24,8 +24,7 @@
   vars:
     delegate_facts_host: True
 
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     # If we can't get python2 installed before any module is used we will fail
     # so just try what we can to get it installed
     - name: check for python2
@@ -72,6 +71,7 @@
         - ansible_distribution == 'Fedora'
         - ansible_distribution_major_version|int >= 23
 
+  tasks:
     - import_role:
         name: ceph-defaults
     - import_role:
@@ -83,8 +83,7 @@
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph monitor install 'In Progress'
       run_once: true
       set_stats:
@@ -93,6 +92,7 @@
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-mgr
 
-    # post-tasks for preceding imports -
+  post_tasks:
     - name: set ceph monitor install 'Complete'
       run_once: true
       set_stats:
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph manager install 'In Progress'
       run_once: true
       set_stats:
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-mgr
 
-    # post-tasks for following imports -
+  post_tasks:
     - name: set ceph manager install 'Complete'
       run_once: true
       set_stats:
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph agent install 'In Progress'
       run_once: true
       set_stats:
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-agent
 
-    # post-tasks for following imports -
+  post_tasks:
     - name: set ceph agent install 'Complete'
       run_once: true
       set_stats:
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph osd install 'In Progress'
       run_once: true
       set_stats:
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-osd
 
-    # post-tasks for following imports -
+  post_tasks:
     - name: set ceph osd install 'Complete'
       run_once: true
       set_stats:
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph mds install 'In Progress'
       run_once: true
       set_stats:
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-mds
 
-    # post-tasks for following imports -
+  post_tasks:
     - name: set ceph mds install 'Complete'
       run_once: true
       set_stats:
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph rgw install 'In Progress'
       run_once: true
       set_stats:
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-rgw
 
-    # post-tasks for following imports -
+  post_tasks:
     - name: set ceph rgw install 'Complete'
       run_once: true
       set_stats:
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph nfs install 'In Progress'
       run_once: true
       set_stats:
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-nfs
 
-    # post-tasks for following imports -
+  post_tasks:
     - name: set ceph nfs install 'Complete'
       run_once: true
       set_stats:
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph rbd mirror install 'In Progress'
       run_once: true
       set_stats:
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-rbd-mirror
 
-    # post-tasks for following imports -
+  post_tasks:
     - name: set ceph rbd mirror install 'Complete'
       run_once: true
       set_stats:
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph client install 'In Progress'
       run_once: true
       set_stats:
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-client
 
-    # post-tasks for following imports -
+  post_tasks:
     - name: set ceph client install 'Complete'
       run_once: true
       set_stats:
   gather_facts: false
   become: True
   any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
+  pre_tasks:
     - name: set ceph iscsi gateway install 'In Progress'
       run_once: true
       set_stats:
             status: "In Progress"
             start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
 
+  tasks:
     - import_role:
         name: ceph-defaults
       tags: ['ceph_update_config']
     - import_role:
         name: ceph-iscsi-gw
 
-    # post-tasks for following imports -
+  post_tasks:
     - name: set ceph iscsi gw install 'Complete'
       run_once: true
       set_stats: