diff --git a/docs/usage.rst b/docs/usage.rst index cad8584f4b670c9d6ab33942a76a8ff96d15d231..a82cf456f7323ab30648cf7c1dc20906a0e51cde 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -2267,6 +2267,15 @@ So, back to the business: 2. And now to configure backup clients for all servers: + .. warning:: + By default Ansible's file lookup plugin will strip newlines and + spaces from the end of the file. This is a problem when + deploying the RSA ssh keys, since if there is no newline after + the ``-----END OPENSSH PRIVATE KEY-----`` delimeter, ssh client + will report error about the format of the key file being + invalid. Therefore the example below explicitly disables + stripping newline from the end of the file. + :file:`~/mysite/group_vars/all.yml` :: @@ -2277,7 +2286,7 @@ So, back to the business: - "{{ lookup('file', inventory_dir + '/ssh/bak_rsa_key.pub') }}" - "{{ lookup('file', inventory_dir + '/ssh/bak_ed25519_key.pub') }}" - "{{ lookup('file', inventory_dir + '/ssh/bak_ecdsa_key.pub') }}" - backup_ssh_key: "{{ lookup('file', inventory_dir + '/ssh/' + ansible_fqdn) }}" + backup_ssh_key: "{{ lookup('file', inventory_dir + '/ssh/' + ansible_fqdn, rstrip=False) }}" 3. So, looking at the configuration up there, there is a couple of file lookups for getting the variable values, as well as one pipe lookup for fetching the