diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index b7a6e16d7..3ba0ebf55 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -30,9 +30,9 @@ hosts: - "{{ mon_group_name|default('mons') }}" + - "{{ mgr_group_name|default('mgrs') }}" - "{{ osd_group_name|default('osds') }}" - "{{ mds_group_name|default('mdss') }}" - - "{{ mgr_group_name|default('mgrs') }}" - "{{ rgw_group_name|default('rgws') }}" - "{{ rbdmirror_group_name|default('rbdmirrors') }}" - "{{ nfs_group_name|default('nfss') }}" @@ -136,6 +136,48 @@ delegate_to: "{{ mon_host }}" +- name: switching from non-containerized to containerized ceph mgr + + hosts: + - "{{ mgr_group_name|default('mgrs') }}" + + vars: + containerized_deployment: true + mgr_group_name: mgrs + + serial: 1 + become: true + + pre_tasks: + - name: stop non-containerized ceph mgr(s) + service: + name: "ceph-mgr@{{ ansible_hostname }}" + state: stopped + enabled: no + + - set_fact: + ceph_uid: 64045 + when: ceph_docker_image_tag | match("latest") or ceph_docker_image_tag | search("ubuntu") + + - set_fact: + ceph_uid: 167 + when: ceph_docker_image_tag | search("centos") or ceph_docker_image | search("rhceph") or ceph_docker_image_tag | search("fedora") + + - name: set proper ownership on ceph directories + file: + path: "{{ item }}" + owner: "{{ ceph_uid }}" + recurse: yes + with_items: + - /var/lib/ceph + - /etc/ceph + + roles: + - ceph-defaults + - ceph-docker-common + - ceph-mgr + + - name: switching from non-containerized to containerized ceph osd vars: diff --git a/tests/functional/centos/7/cluster/hosts-switch-to-containers b/tests/functional/centos/7/cluster/hosts-switch-to-containers new file mode 100644 index 000000000..85f592c42 --- /dev/null +++ b/tests/functional/centos/7/cluster/hosts-switch-to-containers @@ -0,0 +1,22 @@ +[all:vars] +docker=True + +[mons] +ceph-mon0 monitor_address=192.168.1.10 +ceph-mon1 monitor_interface=eth1 +ceph-mon2 monitor_address=192.168.1.12 + +[osds] +ceph-osd0 + +[mdss] +ceph-mds0 + +[rgws] +ceph-rgw0 + +[clients] +ceph-client0 + +[mgrs] +ceph-mgr0 diff --git a/tox.ini b/tox.ini index 057c012c0..aa4cf3a15 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] -envlist = {dev,jewel,luminous,rhcs}-{ansible2.2,ansible2.3}-{xenial_cluster,journal_collocation,centos7_cluster,dmcrypt_journal,dmcrypt_journal_collocation,docker_cluster,purge_cluster,purge_dmcrypt,docker_dedicated_journal,docker_dmcrypt_journal_collocation,update_dmcrypt,update_cluster,cluster,purge_docker_cluster,update_docker_cluster} - {dev,luminous}-{ansible2.2,ansible2.3}-{bluestore_journal_collocation,bluestore_cluster,bluestore_dmcrypt_journal,bluestore_dmcrypt_journal_collocation,bluestore_docker_cluster,bluestore_docker_dedicated_journal,bluestore_docker_dmcrypt_journal_collocation,lvm_osds,purge_lvm_osds,shrink_mon,shrink_osd,switch_to_containers} +envlist = {dev,jewel,luminous,rhcs}-{ansible2.2,ansible2.3}-{xenial_cluster,journal_collocation,centos7_cluster,dmcrypt_journal,dmcrypt_journal_collocation,docker_cluster,purge_cluster,purge_dmcrypt,docker_dedicated_journal,docker_dmcrypt_journal_collocation,update_dmcrypt,update_cluster,cluster,purge_docker_cluster,update_docker_cluster,switch_to_containers} + {dev,luminous}-{ansible2.2,ansible2.3}-{bluestore_journal_collocation,bluestore_cluster,bluestore_dmcrypt_journal,bluestore_dmcrypt_journal_collocation,bluestore_docker_cluster,bluestore_docker_dedicated_journal,bluestore_docker_dmcrypt_journal_collocation,lvm_osds,purge_lvm_osds,shrink_mon,shrink_osd} skipsdist = True @@ -109,8 +109,7 @@ commands= ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest} \ " - echo "docker: True" >> {changedir}/group_vars/all - testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts {toxinidir}/tests/functional/tests + testinfra -n 4 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts-switch-to-containers {toxinidir}/tests/functional/tests [testenv] whitelist_externals = @@ -118,7 +117,6 @@ whitelist_externals = bash pip cp - echo passenv=* sitepackages=True setenv=