test: add mgr section to the host inventory file

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>
pull/1430/head
Sébastien Han 2017-04-11 14:20:11 +02:00 committed by leseb
parent d3cdc62e49
commit dfd8f4d96e
8 changed files with 58 additions and 12 deletions

View 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:

View 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

View File

@ -89,15 +89,39 @@
- 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] }}"

View 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

View File

@ -14,3 +14,6 @@ rgw0
[clients]
client0
[mgrs]
mgr0

View 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 }}"

View File

@ -11,3 +11,6 @@ mds0
[rgws]
rgw0
[mgrs]
mgr0

View File

@ -14,3 +14,6 @@ rgw0
[clients]
client0
[mgrs]
mgr0