Distributing SSH keys
You can use the cephadm-distribute-ssh-key.yml playbook to distribute the SSH keys instead of creating and distributing the keys manually. The playbook distributes an SSH public key over all hosts in the inventory.
You can also generate an SSH key pair on the Ansible administration node and distribute the public key to each node in the storage cluster so that Ansible can access the nodes without being prompted for a password.
Prerequisites
Ansible is installed on the administration node.
Access to the Ansible administration node.
Ansible user with sudo access to all nodes in the storage cluster.
Bootstrapping is completed. See Bootstrapping a new storage cluster for more details.
Procedure
Navigate to the
/usr/share/cephadm-ansibledirectory on the Ansible administration node:Example
[ansible@admin ~]$ cd /usr/share/cephadm-ansibleFrom the Ansible administration node, distribute the SSH keys. The optional
cephadm_pubkey_pathparameter is the full path name of the SSH public key file on the ansible controller host.NOTE: If
cephadm_pubkey_pathis not specified, the playbook gets the key from thecephadm get-pub-keycommand. This implies that you have at least bootstrapped a minimal cluster.Syntax
ansible-playbook -i INVENTORY_HOST_FILE cephadm-distribute-ssh-key.yml -e cephadm_ssh_user=USER_NAME -e cephadm_pubkey_path= home/cephadm/ceph.key -e admin_node=ADMIN_NODE_NAME_1Example
[ansible@admin cephadm-ansible]$ ansible-playbook -i hosts cephadm-distribute-ssh-key.yml -e cephadm_ssh_user=ceph-admin -e cephadm_pubkey_path=/home/cephadm/ceph.key -e admin_node=host01 [ansible@admin cephadm-ansible]$ ansible-playbook -i hosts cephadm-distribute-ssh-key.yml -e cephadm_ssh_user=ceph-admin -e admin_node=host01