We’ve let our Ansible get old, though functional, and I tried out the new version. I discovered that the --private-key option seems not to be supported any more. I was able to do command line things with the ssh-agent, but we have playbooks that run from cron jobs and I’m not sure how I can run these without the private key being specified.
For instance, one of my scripts does this:
pb = ansible.playbook.PlayBook(
playbook=playbook,
module_path=self.options[‘module_path’],
host_list=self.options[‘inventory’],
forks=self.options[‘forks’],
debug=self.options[‘debug’],
remote_user=self.options[‘remote_user’],
remote_pass=self.sshpass,
callbacks=playbook_cb,
runner_callbacks=runner_cb,
stats=stats,
timeout=self.options[‘timeout’],
transport=self.options[‘connection’],
sudo=self.options[‘sudo’],
sudo_user=self.options[‘sudo_user’],
sudo_pass=self.sudopass,
extra_vars=self.extra_vars,
private_key_file=self.options[‘private_key_file’]
)
and then pb.run()
I looked at the new lib/ansible/playbook.py and discovered that it no longer looks for the private_key_file variable when initing class PlayBook.
Is there a workaround?
Thanks,
Ed G