"ansible_env_vars": [ "ANSIBLE_NOCOLOR=True","become_user=root","become=true" ],
Is incorrect, it should be: "ansible_env_vars": [ "ANSIBLE_NOCOLOR=True" ], "extra_arguments": [ "--become" ], (and --become-user root can be omitted since that is the default, unless you configured this in a custom config file and need to set it back.) On Tue, Oct 23, 2018 at 4:27 AM Ibrahim Buamod <[email protected]> wrote: > I am using packer and the amazon-ebs module but I keep getting this error > > [0;32m amazon-ebs: fatal: [default]: FAILED! => {"changed": false, "msg": > "You need to be root to perform this command.\n", "rc": 1, "results": > ["Loaded plugins: priorities, update-motd, upgrade-helper\n"]} [0m > > > the provisioner > > { > "type": "ansible", > "ansible_env_vars": [ > "ANSIBLE_NOCOLOR=True","become_user=root","become=true" ], > "playbook_file": "./Ansible/playbook.yml" > } > > > > the ansible playbook is > > --- > > - name: Provision Python > hosts: all > gather_facts: no > tasks: > - name: install git > package: > name: git > state: present > > > -- > 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/5f8f6b8e-8943-458a-b6d2-6fd050224a95%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/5f8f6b8e-8943-458a-b6d2-6fd050224a95%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CALz9Rt8QWh6g90n9jJ62as%3D8%2BFR%2Be5cL7%2BXLZQmm0P9TfuTRMg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
