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.
Before you begin
Before you begin, make sure that you have the following prerequisites in place:
Procedure
- Generate the SSH key pair, accept the default file name and leave the passphrase
empty.
For example,
[ansible@admin ~]$ ssh-keygen
- Copy the public key to all nodes in the storage cluster.
ssh-copy-id USER_NAME@HOST_NAME
Replace USER_NAME with the new user name for the Ansible user. Replace
HOST_NAME with the host name of the Ceph node.
For
example,
[ansible@admin ~]$ ssh-copy-id ceph-admin@host01
- Create the user’s SSH config file.
For example,
[ansible@admin ~]$ touch ~/.ssh/config
- Open the config file for editing.
Set values for the
Hostname and
User options for each node in the storage
cluster.
Important: By configuring the ~/.ssh/config file you do
not have to specify the -u USER_NAME option each time you
execute the ansible-playbook command.
Host host01
Hostname HOST_NAME
User USER_NAME
Host host02
Hostname HOST_NAME
User USER_NAME
...
Replace HOST_NAME with the host name of the Ceph node. Replace
USER_NAME with the new user name for the Ansible user.
For
example,
Host host01
Hostname host01
User ceph-admin
Host host02
Hostname host02
User ceph-admin
Host host03
Hostname host03
User ceph-admin
- Set the correct file permissions for the ~/.ssh/config file.