Skip to content

Commit 3c69fec

Browse files
committed
Fixing typos and Troubleshooting SSH in day 64
1 parent ca99eaf commit 3c69fec

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

2022/Days/day64.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,28 @@ However, remember I said you will need to have SSH available to enable Ansible t
5858
![](Images/Day64_config6.png)
5959

6060
I have now also started adding some additional hosts to our inventory, another name for this file as this is where you are going to define all of your devices, could be network devices, switches and routers for example also would be added here and grouped. In our hosts file though I have also added my credentials for accessing the Linux group of systems.
61+
Troubleshooting: SSH Host Key Checking Error
62+
If Ansible fails to connect and you see an error like:
63+
64+
`Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.
65+
Please add this host's fingerprint to your known_hosts file to manage this host.`
66+
67+
This happens often in lab environments such as Vagrant where host keys frequently change.
68+
To bypass host key checking temporarily (for testing only), run:
69+
70+
`export ANSIBLE_HOST_KEY_CHECKING=False`
6171

6272
![](Images/Day64_config7.png)
6373

64-
Now if we run `ansible Linux -m ping` we get success as per below.
74+
Now if we run `ansible linux -m ping` we get success as per below.
6575

6676
![](Images/Day64_config8.png)
6777

6878
We then have the node requirements, these are the target systems you wish to automate the configuration on. We are not installing anything for Ansible on these (I mean we might be installing software but there is no client from Ansible we need) Ansible will make a connection over SSH and send anything over SFTP. (If you so desire though and you have SSH configured you could use SCP vs SFTP.)
6979

7080
### Ansible Commands
7181

72-
You saw that we were able to run `ansible Linux -m ping` against our Linux machine and get a response, basically, with Ansible we can run many ad-hoc commands. But you can run this against a group of systems and get that information back. [ad hoc commands](https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html)
82+
You saw that we were able to run `ansible linux -m ping` against our Linux machine and get a response, basically, with Ansible we can run many ad-hoc commands. But you can run this against a group of systems and get that information back. [ad hoc commands](https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html)
7383

7484
If you find yourself repeating commands or even worse you are having to log into individual systems to run these commands then Ansible can help there. For example, the simple command below would give us the output of all the operating system details for all of the systems we add to our Linux group.
7585
`ansible linux -a "cat /etc/os-release"`

0 commit comments

Comments
 (0)