↓ Skip to main content
Linux

Ansible: SSH Access

·1 min

To set up SSH access for inventory hosts in Ansible, follow these steps:

  1. Generate an SSH key pair
    • ssh-keygen -t rsa
  2. Copy the public key to the remote host
    • ssh-copy-id user@hostname
  3. Test the connection to the remote host:
    • ssh user@hostname
  4. Modify the ansible.cfg file to set the remote user, if necessary.
  5. Add the remote host to the Ansible inventory file.
  6. Run the Ansible playbook to execute the desired tasks on the remote host.

Note: If you need to access multiple remote hosts, repeat steps 2-5 for each host.

Author
Samarthya
Engineer, learner, tinkerer. This is my trophy shelf of everyday work and leisure.

Related

Ansible: A thought

·3 mins
Ansible is an open-source software platform for automating and managing IT infrastructure. It provides a simple and easy-to-learn method for automating and managing various IT processes such as provisioning, configuration management, and application deployment. Ansible uses YAML (Yet Another Markup Language) and playbooks written in YAML, which are a series of instructions that specify what actions need to be performed.

Ansible: Building Inventory

·2 mins
The blog is adapted from the information available here. — https://docs.ansible.com/ansible/ An Ansible inventory is a file that defines the hosts and groups of hosts that Ansible will manage. Inventory files are used to define the nodes (hosts) that will be managed by Ansible. These files can be in different formats, including INI and YAML.

Ansible: Templates

·4 mins
Recreated in October 2026 from the post; the original image was lost Templates in Ansible are a type of file that contain configuration information or scripts written in a Jinja2 templating language.