diff --git a/docs/source/testing/tox.rst b/docs/source/testing/tox.rst index 933b15f65..f58aa7cd9 100644 --- a/docs/source/testing/tox.rst +++ b/docs/source/testing/tox.rst @@ -21,9 +21,6 @@ runs of ``ceph-ansible``. The following environent variables are available for use: -* ``FETCH_DIRECTORY`` : (default: ``changedir``) This would configure the ``ceph-ansible`` variable ``fetch_directory``. This defaults to - the ``changedir`` of the given scenario and should not need to be changed. - * ``CEPH_STABLE_RELEASE``: (default: ``jewel``) This would configure the ``ceph-ansible`` variable ``ceph_stable_relese``. This is set automatically when using the ``jewel-*`` or ``kraken-*`` testing scenarios. diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 33c2ca72e..8c1911254 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -32,8 +32,6 @@ dummy: # pacific: 16 # dev: 99 -# Directory to fetch cluster fsid, keys etc... -#fetch_directory: fetch/ # The 'cluster' variable determines the name of the cluster. # Changing the default value to something else means that you will @@ -244,8 +242,8 @@ dummy: ## Ceph options # # Each cluster requires a unique, consistent filesystem ID. By -# default, the playbook generates one for you and stores it in a file -# in `fetch_directory`. If you want to customize how the fsid is +# default, the playbook generates one for you. +# If you want to customize how the fsid is # generated, you may find it useful to disable fsid generation to # avoid cluttering up your ansible repo. If you set `generate_fsid` to # false, you *must* generate `fsid` in another way. diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index 5b6176d1c..3bf04034f 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -32,8 +32,6 @@ dummy: # pacific: 16 # dev: 99 -# Directory to fetch cluster fsid, keys etc... -fetch_directory: ~/ceph-ansible-keys # The 'cluster' variable determines the name of the cluster. # Changing the default value to something else means that you will @@ -244,8 +242,8 @@ ceph_iscsi_config_dev: false ## Ceph options # # Each cluster requires a unique, consistent filesystem ID. By -# default, the playbook generates one for you and stores it in a file -# in `fetch_directory`. If you want to customize how the fsid is +# default, the playbook generates one for you. +# If you want to customize how the fsid is # generated, you may find it useful to disable fsid generation to # avoid cluttering up your ansible repo. If you set `generate_fsid` to # false, you *must* generate `fsid` in another way. diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml index 9fe26a604..91808c54e 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml @@ -862,5 +862,5 @@ - name: purge fetch directory for localhost file: - path: "{{ fetch_directory }}" + path: "{{ fetch_directory | default('fetch/') }}" state: absent diff --git a/infrastructure-playbooks/purge-container-cluster.yml b/infrastructure-playbooks/purge-container-cluster.yml index e9cd4eba8..b5496d770 100644 --- a/infrastructure-playbooks/purge-container-cluster.yml +++ b/infrastructure-playbooks/purge-container-cluster.yml @@ -690,5 +690,5 @@ - name: purge fetch directory for localhost file: - path: "{{ fetch_directory }}/" + path: "{{ fetch_directory | default('fetch/') }}/" state: absent diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 0a2eb60bd..536f7eb85 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -24,8 +24,6 @@ ceph_release_num: pacific: 16 dev: 99 -# Directory to fetch cluster fsid, keys etc... -fetch_directory: fetch/ # The 'cluster' variable determines the name of the cluster. # Changing the default value to something else means that you will @@ -236,8 +234,8 @@ ceph_custom_repo: https://server.domain.com/ceph-custom-repo ## Ceph options # # Each cluster requires a unique, consistent filesystem ID. By -# default, the playbook generates one for you and stores it in a file -# in `fetch_directory`. If you want to customize how the fsid is +# default, the playbook generates one for you. +# If you want to customize how the fsid is # generated, you may find it useful to disable fsid generation to # avoid cluttering up your ansible repo. If you set `generate_fsid` to # false, you *must* generate `fsid` in another way. diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index 4a85e6d64..6987244e7 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -124,15 +124,6 @@ rc: 1 when: rolling_update | bool or groups.get(mon_group_name, []) | length == 0 -- name: create a local fetch directory if it does not exist - file: - path: "{{ fetch_directory }}" - state: directory - delegate_to: localhost - changed_when: false - become: false - when: cephx | bool or generate_fsid | bool - - name: get current fsid command: "{{ timeout_command }} {{ container_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ hostvars[mon_host | default(groups[mon_group_name][0])]['ansible_hostname'] }}.asok config get fsid" register: rolling_update_fsid diff --git a/roles/ceph-fetch-keys/tasks/main.yml b/roles/ceph-fetch-keys/tasks/main.yml index cf30eb9fc..7fcb606f1 100644 --- a/roles/ceph-fetch-keys/tasks/main.yml +++ b/roles/ceph-fetch-keys/tasks/main.yml @@ -4,6 +4,12 @@ changed_when: false register: ceph_keys +- name: create a local fetch directory if it does not exist + file: + path: "{{ fetch_directory | default('fetch/') }}" + state: directory + delegate_to: localhost + become: false - name: "copy ceph user and bootstrap keys to the ansible server in {{ fetch_directory }}/{{ fsid }}/" fetch: diff --git a/tox-docker2podman.ini b/tox-docker2podman.ini index 2462938a2..b5a6ff5b8 100644 --- a/tox-docker2podman.ini +++ b/tox-docker2podman.ini @@ -37,7 +37,6 @@ commands= ansible-playbook -vv -i {changedir}/hosts {toxinidir}/site-container.yml.sample --extra-vars "\ delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_docker_registry_auth=True \ ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \ ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \ @@ -45,7 +44,6 @@ commands= ansible-playbook -vv -i {changedir}/hosts {toxinidir}/infrastructure-playbooks/docker-to-podman.yml --extra-vars "\ delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ " py.test --reruns 5 --reruns-delay 1 -n 8 --durations=0 --sudo -v --connection=ansible --ansible-inventory={changedir}/hosts --ssh-config={changedir}/vagrant_ssh_config {toxinidir}/tests/functional/tests diff --git a/tox-external_clients.ini b/tox-external_clients.ini index 0ee62db35..7a78f413e 100644 --- a/tox-external_clients.ini +++ b/tox-external_clients.ini @@ -41,7 +41,6 @@ commands= non_container: ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup=True change_dir={changedir} ceph_dev_branch=master ceph_dev_sha1=latest" --tags "vagrant_setup" ansible-playbook -vv -i {changedir}/inventory/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --limit 'all:!clients' --extra-vars "\ delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch=master \ ceph_dev_sha1=latest \ ceph_docker_registry_auth=True \ @@ -53,7 +52,6 @@ commands= ansible-playbook -vv -i {changedir}/inventory/external_clients-hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ fsid=40358a87-ab6e-4bdc-83db-1d909147861c \ external_cluster_mon_ips=192.168.31.10,192.168.31.11,192.168.31.12 \ generate_fsid=false \ @@ -68,7 +66,6 @@ commands= ansible-playbook -vv -i {changedir}/inventory/external_clients-hosts {toxinidir}/infrastructure-playbooks/rolling_update.yml --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ fsid=40358a87-ab6e-4bdc-83db-1d909147861c \ external_cluster_mon_ips=192.168.31.10,192.168.31.11,192.168.31.12 \ generate_fsid=false \ diff --git a/tox-filestore_to_bluestore.ini b/tox-filestore_to_bluestore.ini index b250c411e..2489f766d 100644 --- a/tox-filestore_to_bluestore.ini +++ b/tox-filestore_to_bluestore.ini @@ -49,7 +49,6 @@ commands= # deploy the cluster 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:octopus} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ @@ -59,7 +58,6 @@ commands= " ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/filestore-to-bluestore.yml --limit osds --extra-vars "\ delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_stable_release={env:CEPH_STABLE_RELEASE:octopus} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ diff --git a/tox-podman.ini b/tox-podman.ini index 710343b8e..9e0787c1c 100644 --- a/tox-podman.ini +++ b/tox-podman.ini @@ -42,7 +42,6 @@ commands= 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_docker_registry_auth=True \ ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \ ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \ diff --git a/tox-shrink_osd.ini b/tox-shrink_osd.ini index 8ddbeed5c..e7961d126 100644 --- a/tox-shrink_osd.ini +++ b/tox-shrink_osd.ini @@ -93,7 +93,6 @@ commands= 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_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ @@ -111,7 +110,6 @@ commands= ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/tests/functional/lvm_setup.yml ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --limit osds --extra-vars "\ delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ diff --git a/tox-update.ini b/tox-update.ini index 10f3cbda0..0ae923b5f 100644 --- a/tox-update.ini +++ b/tox-update.ini @@ -46,7 +46,6 @@ commands= non_container: ansible-playbook -vv -i "localhost," -c local {toxinidir}/tests/functional/dev_setup.yml --extra-vars "dev_setup=True change_dir={changedir} ceph_dev_branch={env:UPDATE_CEPH_DEV_BRANCH:master} ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest}" --tags "vagrant_setup" 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_dev_branch={env:UPDATE_CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ @@ -56,7 +55,6 @@ commands= ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/rolling_update.yml --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch={env:UPDATE_CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:UPDATE_CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ diff --git a/tox.ini b/tox.ini index c1799c936..3c1623dc7 100644 --- a/tox.ini +++ b/tox.ini @@ -51,7 +51,6 @@ commands= ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/{env:PURGE_PLAYBOOK:purge-cluster.yml} --extra-vars "\ ireallymeanit=yes \ remove_packages=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_docker_registry={env:CEPH_DOCKER_REGISTRY:quay.ceph.io} \ ceph_docker_image={env:CEPH_DOCKER_IMAGE:ceph-ci/daemon} \ ceph_docker_image_tag={env:CEPH_DOCKER_IMAGE_TAG:latest-master} \ @@ -62,7 +61,6 @@ commands= # set up the cluster again ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars @ceph-override.json --extra-vars "\ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ @@ -77,7 +75,6 @@ commands= ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/{env:PURGE_PLAYBOOK:purge-cluster.yml} --extra-vars "\ ireallymeanit=yes \ remove_packages=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_docker_registry_auth=True \ ceph_docker_registry_username={env:DOCKER_HUB_USERNAME} \ ceph_docker_registry_password={env:DOCKER_HUB_PASSWORD} \ @@ -87,7 +84,6 @@ commands= # set up the cluster again ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ " @@ -139,7 +135,6 @@ commands= commands= ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_docker_image_tag=latest-master-devel \ ceph_docker_registry=quay.ceph.io \ ceph_docker_image=ceph-ci/daemon \ @@ -155,7 +150,6 @@ commands= ansible-playbook -vv -i {changedir}/hosts-2 --limit mon1 {toxinidir}/tests/functional/setup.yml ansible-playbook -vv -i {changedir}/hosts-2 {toxinidir}/infrastructure-playbooks/add-mon.yml --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ " @@ -166,7 +160,6 @@ commands= ansible-playbook -vv -i {changedir}/hosts-2 --limit mgrs {toxinidir}/tests/functional/setup.yml ansible-playbook -vv -i {changedir}/hosts-2 --limit mgrs {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ @@ -180,7 +173,6 @@ commands= ansible-playbook -vv -i {changedir}/hosts-2 --limit mdss {toxinidir}/tests/functional/setup.yml ansible-playbook -vv -i {changedir}/hosts-2 --limit mdss {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ @@ -194,7 +186,6 @@ commands= ansible-playbook -vv -i {changedir}/hosts-2 --limit rbdmirrors {toxinidir}/tests/functional/setup.yml ansible-playbook -vv -i {changedir}/hosts-2 --limit rbdmirrors {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ @@ -208,7 +199,6 @@ commands= ansible-playbook -vv -i {changedir}/hosts-2 --limit rgws {toxinidir}/tests/functional/setup.yml ansible-playbook -vv -i {changedir}/hosts-2 --limit rgws {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ @@ -229,7 +219,6 @@ commands= ansible -i localhost, all -c local -b -m iptables -a 'chain=FORWARD protocol=tcp source=192.168.0.0/16 destination=192.168.0.0/16 jump=ACCEPT action=insert rule_num=1 state=present' ansible-playbook --ssh-common-args='-F {changedir}/secondary/vagrant_ssh_config -o ControlMaster=auto -o ControlPersist=600s -o PreferredAuthentications=publickey' -vv -i {changedir}/secondary/hosts {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "\ ireallymeanit=yes \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/secondary/fetch} \ ceph_dev_branch={env:CEPH_DEV_BRANCH:master} \ ceph_dev_sha1={env:CEPH_DEV_SHA1:latest} \ ceph_docker_registry_auth=True \ @@ -253,7 +242,6 @@ commands= ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/infrastructure-playbooks/cephadm-adopt.yml --extra-vars "\ ireallymeanit=yes \ delegate_facts_host={env:DELEGATE_FACTS_HOST:True} \ - fetch_directory={env:FETCH_DIRECTORY:{changedir}/fetch} \ " [testenv] @@ -356,7 +344,7 @@ commands= all_daemons,collocation: 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,all_in_one,collocation: 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_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 + all_daemons,all_in_one,collocation: ansible-playbook -vv -i {changedir}/{env:INVENTORY} {toxinidir}/{env:PLAYBOOK:site.yml.sample} --extra-vars "delegate_facts_host={env:DELEGATE_FACTS_HOST:True} 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}