--------------------------------
sudo nano hosts
[lab-hosts]
192.168.1.[11:13]
sudo nano ansible.cfg
[defaults]
inventory = ./hosts
host_key checking = false
timeout = 5
mkdir group_vars
cd /group_vars
sudo nano devices.yml
ansible_network_os: ios
ansible lab-hosts -m raw -a "show run" -u ansible -k | grep 'hostname\| system mtu'
SSH password:
[DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to allow bad characters in group names by default,
this will change, but still be user configurable on deprecation. This feature will be removed in version 2.10. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
192.168.1.11 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.1.11 port 22: Connection refused",
"unreachable": true
}
192.168.1.12 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.1.12 port 22: Connection timed out",
"unreachable": true
}
192.168.1.13 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.1.13 port 22: Connection timed out",
"unreachable": true