ryankwilliams.ssh_copy_id

ssh-copy-id

This role allows you to set up passwordless SSH access to remote systems.

It's useful when you have a remote server you want to manage using Ansible and you prefer using SSH keys instead of passwords. This role will help you set up the SSH keys on the remote server, making it easy to create an Ansible inventory for that server. After setup, you can run any Ansible playbook on the remote server with ease.

Role Variables

Here are the variables you need to provide for this role:

Variable Description
hostname The remote system to connect to (FQDN or IP)
username The username for connecting to the remote system
password The password for connecting to the remote system
ssh_public_key The path to the public key file to use on the remote system (absolute path)
port The SSH port number to connect to

Example Playbook

The example playbook below shows how to set up passwordless SSH access on a remote machine that does not currently support SSH key authentication.

---
- name: Set up passwordless SSH access on a remote server
  hosts: localhost

  roles:
    - role: ryankwilliams.ssh_copy_id
      vars:
        hostname: 127.0.0.1
        username: username
        password: password
        ssh_public_key: /home/username/.ssh/id_rsa.pub
        ssh_port: 22

License

GPLv3

Author Information

Ryan Williams

Informazioni sul progetto

Inject SSH public key into remote system

Installa
ansible-galaxy install ryankwilliams.ssh_copy_id
Licenza
gpl-3.0
Download
826
Proprietario
Principal Software Quality Engineer