Require tripleo_ceph_client_vars to be overridden

The roles tripleo_run_cephadm, tripleo_cephadm and
tripleo_ceph_client all need tripleo_ceph_client_vars
to be set consistently. However, they cannot be set
consistently if they contain {{ playbook_dir }} because
they are run in different contexts (config-download,
python-tripleoclient and nested ansible executions).
Thus {{ playbook_dir }} is not always the same. Also,
the tripleo_ceph_client_vars must also be preserved on
the system per stack for exports which can be run
anytime in the future.

Do not misleadingly default tripleo_ceph_client_vars
and let roles which need them fail if they are not
passed. Because the tripleo_ceph_client role supports
more than just tripleo_ceph_client_vars as a source
add condition so it can correctly handle when this
variable is undefined.

Change-Id: I0346bf1c6a3d8796a0aa70cbaac6e34b2f74fabb
Related-Bug: #1981467
This commit is contained in:
John Fulton 2022-07-19 07:02:09 -04:00
parent a2573e3386
commit 99f2fb3f12
3 changed files with 5 additions and 4 deletions

View File

@ -22,7 +22,6 @@ tripleo_ceph_client_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}"
tripleo_ceph_client_hide_sensitive_logs: true
tripleo_ceph_client_config_home: "/etc/ceph"
tripleo_ceph_client_fetch_dir: "{{ playbook_dir }}/ceph_client_fetch_dir"
tripleo_ceph_client_vars: "{{ playbook_dir }}/cephadm/ceph_client.yml"
tripleo_ceph_client_cluster: "ceph"
tripleo_ceph_client_fsid: ''
tripleo_ceph_client_mon_ips: []

View File

@ -28,15 +28,18 @@
stat:
path: '{{ tripleo_ceph_client_vars }}'
register: ceph_input_vars
when: tripleo_ceph_client_vars is defined
- name: Load variables produced by the cephadm provisioning process
include_vars: '{{ tripleo_ceph_client_vars }}'
when: ceph_input_vars.stat.exists == True
when:
- tripleo_ceph_client_vars is defined
- ceph_input_vars.stat.exists == True
- name: Get Ceph Cluster variables if ceph-ansible deployed
include_tasks: ceph_ansible.yml
when:
- ceph_input_vars.stat.exists == False
- tripleo_ceph_client_vars is not defined
- ceph_ansible_group_vars_all is defined
- name: Configure multiple external ceph clusters

View File

@ -34,7 +34,6 @@ tripleo_cephadm_uid: "167"
tripleo_cephadm_mode: "0755"
tripleo_cephadm_keyring_permissions: "0644"
tripleo_ceph_client_config_home: "/etc/ceph"
tripleo_ceph_client_vars: "{{ playbook_dir }}/cephadm/ceph_client.yml"
tripleo_cephadm_dashboard_enabled: false
tripleo_cephadm_wait_for_mons: true
tripleo_cephadm_wait_for_mons_retries: 10