]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
core: unify site-container.yml and site.yml guits-clean_main_playbook 5506/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 3 Jul 2020 07:44:15 +0000 (09:44 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 20 Oct 2020 07:34:46 +0000 (09:34 +0200)
With this commit, we only have 1 main playbook to manage.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
site-container.yml.sample [changed from file to symlink]
site.yml.sample

deleted file mode 100644 (file)
index fde8922eb537304bdca4b64726d16cd15f5d7601..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1,482 +0,0 @@
----
-# Defines deployment design and assigns role to server groups
-
-- hosts:
-  - mons
-  - osds
-  - mdss
-  - rgws
-  - nfss
-  - rbdmirrors
-  - clients
-  - iscsigws
-  - mgrs
-  - monitoring
-
-  gather_facts: false
-  become: True
-  any_errors_fatal: true
-
-  vars:
-    delegate_facts_host: True
-
-  pre_tasks:
-    - import_tasks: raw_install_python.yml
-
-  tasks:
-    # pre-tasks for following import -
-    - name: gather facts
-      setup:
-        gather_subset:
-          - 'all'
-          - '!facter'
-          - '!ohai'
-      when: not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, [])
-      tags: always
-
-    - name: gather and delegate facts
-      setup:
-        gather_subset:
-          - 'all'
-          - '!facter'
-          - '!ohai'
-      delegate_to: "{{ item }}"
-      delegate_facts: True
-      with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}"
-      run_once: true
-      when: delegate_facts_host | bool
-      tags: always
-
-    - import_role:
-        name: ceph-defaults
-      tags: [with_pkg, fetch_container_image]
-    - import_role:
-        name: ceph-facts
-    - import_role:
-        name: ceph-validate
-    - import_role:
-        name: ceph-infra
-    - import_role:
-        name: ceph-handler
-    - import_role:
-        name: ceph-container-engine
-      tags: with_pkg
-      when: (group_names != ['clients']) or (inventory_hostname == groups.get('clients', [''])|first)
-    - import_role:
-        name: ceph-container-common
-      tags: fetch_container_image
-      when: (group_names != ['clients']) or (inventory_hostname == groups.get('clients', [''])|first)
-
-- hosts: mons
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    - name: set ceph monitor install 'In Progress'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_mon:
-            status: "In Progress"
-            start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- hosts: mons
-  become: True
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-facts
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-handler
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-config
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-mon
-    - import_role:
-        name: ceph-mgr
-      when: groups.get(mgr_group_name, []) | length == 0
-
-- hosts: mons
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    - name: set ceph monitor install 'Complete'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_mon:
-            status: "Complete"
-            end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- hosts: mgrs
-  become: True
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
-    - name: set ceph manager install 'In Progress'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_mgr:
-            status: "In Progress"
-            start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-facts
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-handler
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-config
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-mgr
-
-    # post-tasks for upcoming imports -
-    - name: set ceph manager install 'Complete'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_mgr:
-            status: "Complete"
-            end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- hosts: osds
-  become: True
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    # pre-tasks for upcoming imports -
-    - name: set ceph osd install 'In Progress'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_osd:
-            status: "In Progress"
-            start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-facts
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-handler
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-config
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-osd
-
-    # post-tasks for preceding imports -
-    - name: set ceph osd install 'Complete'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_osd:
-            status: "Complete"
-            end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- hosts: mdss
-  become: True
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
-    - name: set ceph mds install 'In Progress'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_mds:
-            status: "In Progress"
-            start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-facts
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-handler
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-config
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-mds
-
-    # post-tasks for preceding imports -
-    - name: set ceph mds install 'Complete'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_mds:
-            status: "Complete"
-            end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- hosts: rgws
-  become: True
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
-    - name: set ceph rgw install 'In Progress'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_rgw:
-            status: "In Progress"
-            start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-facts
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-handler
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-config
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-rgw
-
-    # post-tasks for preceding imports -
-    - name: set ceph rgw install 'Complete'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_rgw:
-            status: "Complete"
-            end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- hosts: clients
-  become: True
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
-    - name: set ceph client install 'In Progress'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_client:
-            status: "In Progress"
-            start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-facts
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-handler
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-config
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-client
-
-    # post-tasks for preceding imports -
-    - name: set ceph client install 'Complete'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_client:
-            status: "Complete"
-            end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- hosts: nfss
-  become: True
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
-    - name: set ceph nfs install 'In Progress'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_nfs:
-            status: "In Progress"
-            start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-facts
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-handler
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-config
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-nfs
-
-    # post-tasks for following imports -
-    - name: set ceph nfs install 'Complete'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_nfs:
-            status: "Complete"
-            end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- hosts: rbdmirrors
-  become: True
-  gather_facts: false
-  any_errors_fatal: true
-  tasks:
-    # pre-tasks for following imports -
-    - name: set ceph rbd mirror install 'In Progress'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_rbdmirror:
-            status: "In Progress"
-            start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-facts
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-handler
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-config
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-rbd-mirror
-
-    # post-tasks for preceding imports -
-    - name: set ceph rbd mirror install 'Complete'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_rbdmirror:
-            status: "Complete"
-            end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- hosts:
-    - iscsigws
-  gather_facts: false
-  any_errors_fatal: true
-  become: True
-  tasks:
-    # pre-tasks for following imports -
-    - name: set ceph iscsi gateway install 'In Progress'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_iscsi_gw:
-            status: "In Progress"
-            start: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-    - import_role:
-        name: ceph-defaults
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-facts
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-handler
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-config
-      tags: ['ceph_update_config']
-    - import_role:
-        name: ceph-iscsi-gw
-
-    # post-tasks for preceding imports -
-  post_tasks:
-    - name: set ceph iscsi gw install 'Complete'
-      run_once: true
-      set_stats:
-        data:
-          installer_phase_ceph_iscsi_gw:
-            status: "Complete"
-            end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
-
-- import_playbook: dashboard.yml
-  when:
-    - dashboard_enabled | bool
-    - groups.get(monitoring_group_name, []) | length > 0
-
-- hosts:
-  - mons
-  - osds
-  - mdss
-  - rgws
-  - rbdmirrors
-  - mgrs
-
-  gather_facts: false
-  become: True
-  any_errors_fatal: true
-
-  tasks:
-    - import_role:
-        name: ceph-defaults
-    - import_role:
-        name: ceph-facts
-        tasks_from: container_binary.yml
-    - import_role:
-        name: ceph-handler
-    - import_role:
-        name: ceph-crash
-
-
-- hosts: mons
-  gather_facts: false
-  become: True
-  any_errors_fatal: true
-  tasks:
-    - import_role:
-        name: ceph-defaults
-
-    - name: check if podman binary is present
-      stat:
-        path: /usr/bin/podman
-      register: podman_binary
-
-    - name: set_fact container_binary
-      set_fact:
-        container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_distribution == 'Fedora') or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8') else 'docker' }}"
-
-    - name: get ceph status from the first monitor
-      command: >
-        {{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s
-      register: ceph_status
-      changed_when: false
-      delegate_to: "{{ groups[mon_group_name][0] }}"
-      run_once: true
-
-    - name: "show ceph status for cluster {{ cluster }}"
-      debug:
-        msg: "{{ ceph_status.stdout_lines }}"
-      delegate_to: "{{ groups[mon_group_name][0] }}"
-      run_once: true
-      when: not ceph_status.failed
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..a098d43832afd31eb1db4583cdd6f0165809e262
--- /dev/null
@@ -0,0 +1 @@
+site.yml.sample
\ No newline at end of file
index 0c65034a27a4e7949cac70f73af43d522207c341..fd6f75ecd5b99c5660da6680cf779aac81b92506 100644 (file)
@@ -15,8 +15,8 @@
   - rgwloadbalancers
 
   gather_facts: false
-  any_errors_fatal: true
   become: true
+  any_errors_fatal: true
 
   tags: always
 
     delegate_facts_host: True
 
   pre_tasks:
-    # If we can't get python2 installed before any module is used we will fail
+    - import_role:
+        name: ceph-defaults
+
+    # If we can't get python installed before any module is used we will fail
     # so just try what we can to get it installed
 
     - import_tasks: raw_install_python.yml
         name: ceph-validate
     - import_role:
         name: ceph-infra
+    - import_role:
+        name: ceph-handler
+      when: containerized_deployment | bool
+    - import_role:
+        name: ceph-container-engine
+      when: containerized_deployment | bool
+      tags: with_pkg
     - import_role:
         name: ceph-common
+      when: not containerized_deployment | bool
+    - import_role:
+        name: ceph-container-common
+      tags: fetch_container_image
+      when:
+        - containerized_deployment | bool
+        - (group_names != ['clients']) or (inventory_hostname == groups.get('clients', [''])|first)
 
 - hosts: mons
   gather_facts: false
   tasks:
     - import_role:
         name: ceph-defaults
+
+    - name: containerized deployment related tasks
+      when: containerized_deployment | bool
+      block:
+        - name: check if podman binary is present
+          stat:
+            path: /usr/bin/podman
+          register: podman_binary
+
+        - name: set_fact container_binary
+          set_fact:
+            container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_distribution == 'Fedora') or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8') else 'docker' }}"
+
+        - name: set_fact container_exec_cmd
+          set_fact:
+            container_exec_cmd: "{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
+
     - name: get ceph status from the first monitor
-      command: ceph --cluster {{ cluster }} -s
+      command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} -s"
       register: ceph_status
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"