I am baking a Ubuntu 16.04 VM in Azure.
I tried this
{
"type": "ansible",
"ansible_env_vars": [ "ANSIBLE_HOST_KEY_CHECKING=False",
"ANSIBLE_SSH_ARGS='-o ForwardAgent=yes -o ControlMaster=auto -o
ControlPersist=60s'", "ANSIBLE_NOCOLOR=True" ],
"playbook_file": "./hardening_playbook.yml"
}
and
{
"type": "ansible",
"playbook_file": "./hardening_playbook.yml"
}
ansible playbook has this:
#5.1.4.7 Set appropriate timeout for sudo.
- name: sudo timeout
lineinfile: dest=/etc/sudoers
regexp="^Defaults env_reset"
line="Defaults env_reset,timestamp_timeout=2"
state=present
It is failing with this error below
TASK [sudo timeout]
************************************************************
azure-arm: fatal: [default]: FAILED! => {"changed": false, "failed":
true, "module_stderr": "sudo: a password is required\nShared connection to
127.0.0.1 closed.\r\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc":
1}
azure-arm: to retry
Let me know if you have any suggestions.
Thanks
--
This mailing list is governed under the HashiCorp Community Guidelines -
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of
those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/packer-tool/4cdd3a34-1927-4ba2-926c-b3dea9afe475%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.