How to solve intermittent Ansible issues? -
i sure @ point or must have faced situation 1 unable install package via ansible same thing done logging machine , doing so. intermittent persistent. why so? because once in while might happen package refuses installed throuwing error like
failed: [10.12.10.57] => {"failed": true, "parsed": false} become-success-yqymkgrsndxbhkcnyfjgvzrxvoxpmads traceback (most recent call last): file "/home/ubuntu/.ansible/tmp/ansible-tmp-1461058305.77-7941776655744/apt", line 2258, in <module> main() file "/home/ubuntu/.ansible/tmp/ansible-tmp-1461058305.77-7941776655744/apt", line 554, in main cache = apt.cache() file "/usr/lib/python2.7/dist-packages/apt/cache.py", line 107, in __init__ self.open(progress) file "/usr/lib/python2.7/dist-packages/apt/cache.py", line 151, in open self._cache = apt_pkg.cache(progress) systemerror: e:unable parse package file /var/lib/apt/lists/us-west-2.ec2.archive.ubuntu.com_ubuntu_dists_trusty-updates_main_i18n_translation-en (1), e:the package lists or status file not parsed or opened. openssh_6.6.1, openssl 1.0.1f 6 jan 2014 debug1: reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: applying options * debug1: auto-mux: trying existing master debug1: mux_client_request_session: master session id: 2 shared connection 10.12.10.57 closed.
you can run play again , again won't go away, once inside machine , apt-get update
, goes away though machine updated. happens in 1 out of 100 cases , occur, unable figure out why?
it fact you're trying run playbook after ec2 instance started? have feeling other client (say system) locking apt directory. if case, wait until server started. can take /var/log/cloud-init-output.log
see box when it's starting (you'll see apt-get
outputs there).
when happens again, try find if reason removing lock files like:
sudo rm /var/lib/apt/lists/lock sudo rm /var/cache/apt/archives/lock
and run playbook again. if succeeds, point problem. in addition, if find problem due playbook runs soon, might want consider add delay explained here: http://docs.ansible.com/ansible/wait_for_module.html or other kind of event catcher determine if system ready used.
Comments
Post a Comment