# openstack: fatal: \[default\]: FAILED! =\> {"msg": "Missing sudo password"}

**URL:** <https://forum.ansible.com/t/openstack-fatal-default-failed-msg-missing-sudo-password/30832>\
**Category:** Ansible Project\
**Created:** [July 22, 2019, 3:02am UTC](https://forum.ansible.com/t/openstack-fatal-default-failed-msg-missing-sudo-password/30832 "2019-07-22T03:02:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toan\_Huynh\_Van](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Toan\_Huynh\_Van](https://forum.ansible.com/u/Toan_Huynh_Van)\
**Post date:** [July 22, 2019, 3:02am UTC](https://forum.ansible.com/t/openstack-fatal-default-failed-msg-missing-sudo-password/30832/1 "2019-07-22T03:02:51Z")

</div>

Hi all,

I have a issue about sudo password when using packer to build image and Ansible for provisioning. The error as title.

below is my json file and playbook. Please help me resolve this issue.

packer.json

{  
“builders”: [  
{  
“type”: “openstack”,  
“identity\_endpoint”: “URL://”,  
“tenant\_name”: “tenant”,  
“username”: “hvtoan”,  
“password”: “hvtoan”,  
“availability\_zone”: “nova”,  
“region”: “RegionOne”,  
“image\_name”: “Test\_image\_Packer”,  
“source\_image”: “d3e5cbab-061d-4f7f-987d-c0d69b7e0bff”,  
“ssh\_username”: “abc”,  
“ssh\_password”: “xyz”,  
“flavor”: “m1.small”,  
“security\_groups”: “default”,  
“insecure”: “true”,  
“networks”: [  
“9b2bc188-4e27-4cdf-81ef-82287c3dce5c”  
]  
}  
],  
“provisioners”: [  
{  
“type”: “ansible”,  
“playbook\_file”: “./create\_image.yml”  
}  
]  
}

create\_image.yml

> **(attachments)**
>
> ![Auto Generated Inline Image 1.png](https://us1.discourse-cdn.com/ansible/original/2X/a/a700786991af9531b3750624b3abf2bdc7c296de.png)

---

<div class="post-metadata">

**Author:** ![Vino\_Thiyagu](https://avatars.discourse-cdn.com/v4/letter/v/5f9b8f/32.png) [@Vino\_Thiyagu](https://forum.ansible.com/u/Vino_Thiyagu)\
**Post date:** [July 22, 2019, 5:29am UTC](https://forum.ansible.com/t/openstack-fatal-default-failed-msg-missing-sudo-password/30832/2 "2019-07-22T05:29:16Z")

</div>

Make an entry for Sudo passwd in your ansible.cfg or keep your sudo passwd in your Json as you kept for ssh pass

> **(attachments)**
>
> ![Auto Generated Inline Image 1.png](https://us1.discourse-cdn.com/ansible/original/2X/a/a700786991af9531b3750624b3abf2bdc7c296de.png)

---

<div class="post-metadata">

**Author:** ![Toan\_Huynh\_Van](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Toan\_Huynh\_Van](https://forum.ansible.com/u/Toan_Huynh_Van)\
**Post date:** [July 23, 2019, 3:02am UTC](https://forum.ansible.com/t/openstack-fatal-default-failed-msg-missing-sudo-password/30832/3 "2019-07-23T03:02:06Z")

</div>

Thanks Vino, i added to Json file as below, it runs successfully, but I don’t understand command in yellow. Can you explain to me that command?

{  
“type”: “shell”,  
“execute\_command”: “echo ‘{{user `ssh_pass`}}’ | {{ .Vars }} sudo -E -S sh ‘{{ .Path }}’”,  
“inline”: [  
“echo ‘%sudo ALL=(ALL) NOPASSWD:ALL’ \>\> /etc/sudoers”]  
},  
{  
“type”: “ansible”,  
“playbook\_file”: “./create\_image.yml”  
}  
],

“variables”: {  
“ssh\_pass”: “shipped!!”  
}

Vào 12:29:37 UTC+7 Thứ Hai, ngày 22 tháng 7 năm 2019, Vino Thiyagu đã viết:
