]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
test: add mgr section to the host inventory file 1430/head
authorSébastien Han <seb@redhat.com>
Tue, 11 Apr 2017 12:20:11 +0000 (14:20 +0200)
committerleseb <seb@redhat.com>
Fri, 14 Apr 2017 22:16:10 +0000 (00:16 +0200)
Without this, we don't test the mgr role so we need to add it.

Co-Authored-by: Guillaume Abrioux <gabrioux@redhat.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
infrastructure-playbooks/rolling_update.yml
roles/ceph-mon/tasks/ceph_keys.yml
roles/ceph-mon/tasks/docker/main.yml
site-docker.yml.sample
tests/functional/centos/7/cluster/hosts
tests/functional/centos/7/docker-cluster/group_vars/all
tests/functional/centos/7/docker-cluster/hosts
tests/functional/ubuntu/16.04/cluster/hosts

index 3e6cf688699560879cc81021d492ef7636610b14..1853b80a1a5b4619bcac9dcfda351c667e5e4191 100644 (file)
@@ -40,6 +40,7 @@
     - "{{ osd_group_name|default('osds') }}"
     - "{{ mds_group_name|default('mdss') }}"
     - "{{ rgw_group_name|default('rgws') }}"
+    - "{{ mgr_group_name|default('mgrs') }}"
 
   become: True
   tasks:
index b54d0712232f2bec360b40409e8caf7c637a869b..17f4c2e30de43acc40dff7995a597a2249e0bd97 100644 (file)
@@ -52,7 +52,7 @@
     - cephx
     - groups.get(mgr_group_name, []) | length > 0
     - inventory_hostname == groups[mon_group_name]|last
-  with_items: "{{ groups[mgr_group_name] }}"
+  with_items: "{{ groups.get(mgr_group_name, []) }}"
 
 - include: set_osd_pool_default_pg_num.yml
 
index 57d69b7fea92592ce583d728f062ce3b5578afd6..566ba5616f28ef387d3cf640e7be07484c76bcc7 100644 (file)
     - openstack_config
     - "{{ inventory_hostname == groups[mon_group_name] | last }}"
 
-- name: create ceph mgr keyring(s) when mon is containerized
-  command: docker exec ceph-mon-{{ ansible_hostname }} ceph --cluster {{ cluster }} auth get-or-create mgr.{{ hostvars[item]['ansible_hostname'] }} mon 'allow *' -o /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
-  args:
-    creates: /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
-  changed_when: false
+- block:
+  - name: create ceph mgr keyring(s) when mon is containerized
+    command: docker exec ceph-mon-{{ ansible_hostname }} ceph --cluster {{ cluster }} auth get-or-create mgr.{{ hostvars[item]['ansible_hostname'] }} mon 'allow *' -o /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
+    args:
+      creates: /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
+    changed_when: false
+    when:
+      - cephx
+      - mon_containerized_deployment
+      - "{{ groups.get(mgr_group_name, []) | length > 0 }}"
+      - not mon_containerized_deployment_with_kv
+    with_items: "{{ groups.get(mgr_group_name, []) }}"
+
+  - name: stat for ceph mgr key(s)
+    stat:
+      path: /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring
+    with_items: "{{ groups.get(mgr_group_name, []) }}"
+    changed_when: false
+    become: false
+    failed_when: false
+    register: stat_mgr_keys
+    always_run: true
+    when:
+      - "{{ groups.get(mgr_group_name, []) | length > 0 }}"
+
+  - name: push ceph mgr key(s)
+    fetch:
+      src: "/etc/ceph/{{ cluster }}.mgr.{{ hostvars[item.item]['ansible_hostname'] }}.keyring"
+      dest: "{{ fetch_directory }}/docker_mon_files/{{ item.stat.path }}"
+      flat: yes
+    with_items:
+      - "{{ stat_mgr_keys.results }}"
+    when:
+      - item.stat.exists == true
   when:
-    - cephx
-    - mon_containerized_deployment
-    - "{{ groups.get(mgr_group_name, []) | length > 0 }}"
     - inventory_hostname == groups[mon_group_name]|last
-    - not mon_containerized_deployment_with_kv
-  with_items: "{{ groups[mgr_group_name] }}"
index 167d8f2c49949f9d31355ba2df5fcfee17bf8180..4ba025fc7a4661abf2304382326e5b863fe7d8e1 100644 (file)
@@ -1,7 +1,18 @@
 ---
 # Defines deployment design and assigns role to server groups
 
-- hosts: mons # gather mon facts first before we process ceph-mon serially
+- hosts:
+  - mons
+  - agents
+  - osds
+  - mdss
+  - rgws
+  - nfss
+  - restapis
+  - rbdmirrors
+  - clients
+  - iscsigws
+  - mgrs
   tasks: []
 
 - hosts: mons
index d060209c98ffce2e353462d70e9f3de84e63e615..008f2cb56f8913756a2030003107e6924a33a15a 100644 (file)
@@ -14,3 +14,6 @@ rgw0
 
 [clients]
 client0
+
+[mgrs]
+mgr0
index 56cf5cbdef3adf901146d800e00f81e0a55cd54e..6f27d57fc3f58128a89f101179d90ee79dfa5577 100644 (file)
@@ -8,6 +8,7 @@ mon_containerized_deployment: True
 osd_containerized_deployment: True
 mds_containerized_deployment: True
 rgw_containerized_deployment: True
+mgr_containerized_deployment: True
 cluster: test
 ceph_mon_docker_interface: eth1
 ceph_mon_docker_subnet: "{{ public_network }}"
index bdbfb5cdda95808e992a0e58e5a19c8ea93486e9..2d684367d038978c1dd0c6e2488b023eccf1ef6d 100644 (file)
@@ -11,3 +11,6 @@ mds0
 
 [rgws]
 rgw0
+
+[mgrs]
+mgr0
index e361015a0d8278657e459a1b014d8d04479f4ceb..1b367310207e6bab4dd0fc1ebc83eca5e0d8b113 100644 (file)
@@ -14,3 +14,6 @@ rgw0
 
 [clients]
 client0
+
+[mgrs]
+mgr0