Perhaps you should provide the details of the playbook as well here. There are many possibilities. For example, this can happen due to the ssh user in the cron. When you run the playbook in a ssh session, you are running with you as the logged-in user. The cron user must have similar privileges on the remote host (if you are using passwordless ssh setup, for instance) for it to succeed.
Regards On Tuesday, January 26, 2016 at 6:35:13 AM UTC-8, Uwe Kruse wrote: > > Hello, i try to run an ansible playbook every day and i use cron. > i get the following error: > > + sshpass -p xxxxxxxxx ansible-playbook -i all_actual_sp3_hosts.txt > uk_key.yml --ask-pass -c paramiko > Traceback (most recent call last): > File "/usr/bin/ansible-playbook", line 323, in <module> > sys.exit(main(sys.argv[1:])) > File "/usr/bin/ansible-playbook", line 112, in main > utils.check_mutually_exclusive_privilege(options, parser) > AttributeError: 'module' object has no attribute > 'check_mutually_exclusive_privilege' > + ansible-playbook -i all_actual_sp3_hosts.txt paketliste.yml > Traceback (most recent call last): > File "/usr/bin/ansible-playbook", line 323, in <module> > sys.exit(main(sys.argv[1:])) > File "/usr/bin/ansible-playbook", line 112, in main > utils.check_mutually_exclusive_privilege(options, parser) > AttributeError: 'module' object has no attribute > 'check_mutually_exclusive_privilege' > + ansible alle -i all_actual_sp3_hosts.txt -m setup --tree > /home/kruseu/setup > Traceback (most recent call last): > File "/usr/bin/ansible", line 195, in <module> > (options, args) = cli.parse() > File "/usr/bin/ansible", line 86, in parse > utils.check_mutually_exclusive_privilege(options, parser) > AttributeError: 'module' object has no attribute > 'check_mutually_exclusive_privilege' > ? > > When i run it in a ssh-session everything works fine. > > What can i do to run the playbook inside a cron job? > > Ansible runs in a Ubuntu 14.04 system. The ansible version is 1.9.0.1-1. > > Greetings Uwe Kruse > > > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/eee3a612-9549-4b1f-809e-819eba1a23f9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
