[Klug-general] Ansible

Kevin Groves kgroves at cix.co.uk
Mon Feb 2 19:53:22 UTC 2015


LOL I would suggest switching off that host for system checks at run 
time. I've had it do something like this myself and I think it comes 
down to the auto gather facts failing due to some non-dependancy at the 
client end. You can turn off the gather facts for all hosts (makes it 
run quicker - and then only check hosts you want) or switch it off on a 
host basis. Now you are going to ask how :-)

Take a look here:

http://docs.ansible.com/playbooks_variables.html#turning-off-facts

- hosts: whatever
   gather_facts: no



That will switch it all off and what I would then do is run any specific fact gathering on a host by host basis, although tbh if you know your systems then you shouldn't really need to do this.

Kev,




On 02/02/15 10:52, Dan Attwood wrote:
> After Kevins talk at the last klug I've been having another play with 
> ansible.
>
> I've got my list of hosts set up and I've exported my ssh key from my 
> ansible server to them.
>
> I can do:
>
>
> ansible all -m ping vvvv
>
> and they all ping and check fine.
>
>
> when I run my playbook though (That checks for and applies updates) it 
> runs through the gathering facts section and then just sits on the 
> last host;
>
>
>
> <10.0.100.99> ESTABLISH CONNECTION FOR USER: administrator
> <10.0.100.99> REMOTE_MODULE setup
> <10.0.100.99> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o 
> ControlPersist=60s -o 
> ControlPath="/home/administrator/.ansible/cp/ansible-ssh-%h-%p-%r" -o 
> Port=22 -o KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o User=administrator -o 
> ConnectTimeout=10 10.0.100.99 /bin/sh -c 'mkdir -p 
> $HOME/.ansible/tmp/ansible-tmp-1422870360.74-45757553727916 && chmod 
> a+rx $HOME/.ansible/tmp/ansible-tmp-1422870360.74-45757553727916 && 
> echo $HOME/.ansible/tmp/ansible-tmp-1422870360.74-45757553727916'
> <10.0.100.99> PUT /tmp/tmpaGcn6F TO 
> /home/administrator/.ansible/tmp/ansible-tmp-1422870360.74-45757553727916/setup
> <10.0.100.99> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o 
> ControlPersist=60s -o 
> ControlPath="/home/administrator/.ansible/cp/ansible-ssh-%h-%p-%r" -o 
> Port=22 -o KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o User=administrator -o 
> ConnectTimeout=10 10.0.100.99 /bin/sh -c 'sudo -k && sudo -H -S -p 
> "[sudo via ansible, key=qwqneiukdxvgdklcqsbekawxtfyrcfaw] password: " 
> -u root /bin/sh -c '"'"'echo 
> SUDO-SUCCESS-qwqneiukdxvgdklcqsbekawxtfyrcfaw; LANG=C LC_CTYPE=C 
> /usr/bin/python 
> /home/administrator/.ansible/tmp/ansible-tmp-1422870360.74-45757553727916/setup; 
> rm -rf 
> /home/administrator/.ansible/tmp/ansible-tmp-1422870360.74-45757553727916/ 
> >/dev/null 2>&1'"'"''
> ok: [10.0.100.99]
>
>
>
> and thats it - now moving on to apply the next sections.
>
> And ideas anyone - by which I mean Kevin :-)
>
>
>
>
> _______________________________________________
> Kent mailing list
> Kent at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/kent

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/kent/attachments/20150202/545cda45/attachment.html>


More information about the Kent mailing list