Skip to content

Commit

Permalink
tests: set copy_admin_key at group_vars level
Browse files Browse the repository at this point in the history
setting it at extra vars level prevent from setting it per node.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
  • Loading branch information
guits committed Sep 26, 2019
1 parent ab370b6 commit 5bb6a4d
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 24 deletions.
31 changes: 22 additions & 9 deletions roles/ceph-client/tasks/pre_requisite.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
---
- name: copy ceph admin keyring
copy:
src: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.client.admin.keyring"
dest: "/etc/ceph/"
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
mode: "{{ ceph_keyring_permissions }}"
when:
- cephx | bool
- copy_admin_key | bool
block:
- name: get keys from monitors
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
register: _client_keys
with_items:
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}"
when:
- cephx | bool
- item.copy_key | bool

- name: copy ceph key(s) if needed
copy:
dest: "{{ item.item.path }}"
content: "{{ item.stdout + '\n' }}"
owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
group: "{{ ceph_uid if containerized_deployment else 'ceph' }}"
mode: "{{ ceph_keyring_permissions }}"
with_items: "{{ _client_keys.results }}"
when:
- item.item.copy_key | bool
when: cephx | bool
3 changes: 2 additions & 1 deletion tests/functional/shrink_mds/container/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ ceph_conf_overrides:
global:
osd_pool_default_size: 1
openstack_config: False
dashboard_enabled: False
dashboard_enabled: False
copy_admin_key: True
3 changes: 2 additions & 1 deletion tests/functional/shrink_osd/container/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ ceph_conf_overrides:
global:
osd_pool_default_size: 1
openstack_config: False
dashboard_enabled: False
dashboard_enabled: False
copy_admin_key: True
3 changes: 2 additions & 1 deletion tests/functional/shrink_osd/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ ceph_conf_overrides:
global:
osd_pool_default_size: 3
openstack_config: False
dashboard_enabled: False
dashboard_enabled: False
copy_admin_key: True
3 changes: 2 additions & 1 deletion tests/functional/shrink_rbdmirror/container/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ ceph_conf_overrides:
global:
osd_pool_default_size: 1
openstack_config: False
dashboard_enabled: False
dashboard_enabled: False
copy_admin_key: True
1 change: 1 addition & 0 deletions tests/functional/shrink_rgw/container/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ ceph_conf_overrides:
osd_pool_default_size: 1
openstack_config: False
dashboard_enabled: False
copy_admin_key: True
3 changes: 1 addition & 2 deletions tox-podman.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ commands=
ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
copy_admin_key={env:COPY_ADMIN_KEY:False} \
container_binary=podman \
container_package_name=podman \
container_service_name=podman \
Expand All @@ -71,4 +70,4 @@ commands=
# retest to ensure cluster came back up correctly after rebooting
py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests

vagrant destroy -f
vagrant destroy -f
1 change: 0 additions & 1 deletion tox-update.ini
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ commands=
ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-mimic} \
copy_admin_key={env:COPY_ADMIN_KEY:False} \
"'

pip install -r {toxinidir}/tests/requirements.txt
Expand Down
9 changes: 1 addition & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ commands=
ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} \
ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} \
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
copy_admin_key={env:COPY_ADMIN_KEY:False} \
"

# wait 30sec for services to be ready
Expand Down Expand Up @@ -391,14 +390,9 @@ setenv=
container: CONTAINER_DIR = /container
container: PLAYBOOK = site-docker.yml.sample
container: PURGE_PLAYBOOK = purge-docker-cluster.yml
storage_inventory: COPY_ADMIN_KEY = True
non_container: PLAYBOOK = site.yml.sample
shrink_mon: MON_TO_KILL = mon2
shrink_osd: COPY_ADMIN_KEY = True
shrink_mgr: MGR_TO_KILL = mgr1
shrink_mds: COPY_ADMIN_KEY = True
shrink_rbdmirror: COPY_ADMIN_KEY = True
shrink_rgw: COPY_ADMIN_KEY = True

rhcs: CEPH_STABLE_RELEASE = luminous
lvm_osds: CEPH_STABLE_RELEASE = luminous
Expand Down Expand Up @@ -466,7 +460,6 @@ commands=
ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \
ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \
ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \
copy_admin_key={env:COPY_ADMIN_KEY:False} \
"

# wait 30sec for services to be ready
Expand All @@ -483,7 +476,7 @@ commands=
all_daemons: py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/{env:INVENTORY} --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests

# handlers/idempotency test
all_daemons: ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "delegate_facts_host={env:DELEGATE_FACTS_HOST:True} fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} ceph_stable_release={env:CEPH_STABLE_RELEASE:nautilus} ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG_BIS:latest-bis-master} ceph_dev_branch={env:CEPH_DEV_BRANCH:master} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} copy_admin_key={env:COPY_ADMIN_KEY:False}" --extra-vars @ceph-override.json
all_daemons: ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "delegate_facts_host={env:DELEGATE_FACTS_HOST:True} fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} ceph_stable_release={env:CEPH_STABLE_RELEASE:nautilus} ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:docker.io} ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph/daemon} ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG_BIS:latest-bis-master} ceph_dev_branch={env:CEPH_DEV_BRANCH:master} ceph_dev_sha1={env:CEPH_DEV_SHA1:latest}" --extra-vars @ceph-override.json

purge: {[purge]commands}
switch_to_containers: {[switch-to-containers]commands}
Expand Down

0 comments on commit 5bb6a4d

Please sign in to comment.