A managed node is the remote machine you want to manage using your ansible box which is your control node. Every type of remote machine can be a managed node, as long as ssh is installed on the remote box. I am using vyos virtual machine as my example of the managed node “my remote machine”.
Install commands for ansible for CentOS Stream 10 tested and working.
sudo yum -y install epel-release
sudo yum install ansible-core
ansible --version
#Additional packages
sudo yum install epel-release python-pip
sudo yum install python-pip
sudo pip install --upgrade pyvmomi
sudo pip install --upgrade paramiko
sudo pip install --user ansible-pylibssh
ansible-galaxy collection install ansible.netcommon
ansible-galaxy collection install vyos.vyos
We can connect to remote hosts using a password through Ansible but it is recommended to set up key-based authentication secure logins.
Run the following on your ansible box
ssh-keygen
#push enter when prompted
this is the key that will be copied to your managed node SHA256:F+v/jtSS+uTOMuGeY/JsZqGbMQQUfPykNKZImN+4des user@cnac.vmware.local.
Now we will copy your ssh key to the managed node, I am using my vyos vm in this example
ssh-copy-id vyos@192.168.1.12
#answer the prompts, yes to accept fingerprint and password of your managed node.
Update your hosts file with the vyos details, add to the bottom of the file
sudo nano /etc/ansible/hosts
[servers]
vyos1 ansible_host=192.168.1.12 ansible_user=vyos
commands to verify things are working
ansible all -m ping
ansible all -i 192.168.1.12, -c ansible.netcommon.network_cli -u vyos -k -m vyos.vyos.vyos_facts -e ansible_network_os=vyos.vyos.vyos
Some screen shot of the above commands




