Skip to content

Commit

Permalink
Gather ssh private key from the hostvars in ceph playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
rebtoor authored and openshift-merge-bot[bot] committed Sep 26, 2024
1 parent 575af58 commit 54bbab9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions playbooks/ceph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

- name: Distribute SSH keypair to target nodes
tags: admin
hosts: "{{ cifmw_ceph_target | default('computes') }}"
hosts: "{{ cifmw_ceph_target | default('computes') }}"
gather_facts: false
become: true
vars:
Expand Down Expand Up @@ -265,7 +265,12 @@
gather_facts: false
vars:
_target_hosts: "{{ groups[cifmw_ceph_target | default('computes')] | default([]) }}"
ansible_ssh_private_key_file: "{{ lookup('env', 'ANSIBLE_SSH_PRIVATE_KEY') }}"
_target: "{{ _target_hosts | first }}"
ansible_ssh_private_key_file: >-
{{
hostvars[_target]['ansible_ssh_private_key_file'] |
default(lookup('env', 'ANSIBLE_SSH_PRIVATE_KEY'))
}}
cifmw_cephadm_spec_ansible_host: /tmp/ceph_spec.yml
cifmw_cephadm_bootstrap_conf: /tmp/initial_ceph.conf
cifmw_ceph_client_vars: /tmp/ceph_client.yml
Expand Down

0 comments on commit 54bbab9

Please sign in to comment.