# docker installation problems

**URL:** <https://forum.ansible.com/t/docker-installation-problems/35054>\
**Category:** Ansible Project\
**Tags:** vmware, ubuntu\
**Created:** [April 26, 2021, 10:21am UTC](https://forum.ansible.com/t/docker-installation-problems/35054 "2021-04-26T10:21:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![bec12317](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@bec12317](https://forum.ansible.com/u/bec12317)\
**Post date:** [April 26, 2021, 10:21am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/1 "2021-04-26T10:21:05Z")

</div>

I am using ansible to install a docker but I get this error. How can i solve this please?  
Please help me, this installation has taken me a whole week

Control node is ubuntu server 20.04  
Target node is ubuntu desktop 18.04 on vmware esxi

this is my playbook:

---

<div class="post-metadata">

**Author:** ![Thanh\_Nguyen\_Duc](https://avatars.discourse-cdn.com/v4/letter/t/c89c15/32.png) [@Thanh\_Nguyen\_Duc](https://forum.ansible.com/u/Thanh_Nguyen_Duc)\
**Post date:** [April 26, 2021, 10:27am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/2 "2021-04-26T10:27:18Z")

</div>

Look like you need to add become\_user option there

---

<div class="post-metadata">

**Author:** ![bec12317](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@bec12317](https://forum.ansible.com/u/bec12317)\
**Post date:** [April 26, 2021, 10:30am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/3 "2021-04-26T10:30:30Z")

</div>

I just added become\_user: root but the same problem

---

<div class="post-metadata">

**Author:** ![Thanh\_Nguyen\_Duc](https://avatars.discourse-cdn.com/v4/letter/t/c89c15/32.png) [@Thanh\_Nguyen\_Duc](https://forum.ansible.com/u/Thanh_Nguyen_Duc)\
**Post date:** [April 26, 2021, 10:45am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/4 "2021-04-26T10:45:36Z")

</div>

Sorry, it should be become: true  
By default it will elevate the account to root. You may need to pass become\_user\_pass as well.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [April 26, 2021, 10:46am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/5 "2021-04-26T10:46:42Z")

</div>

You're using localhost as the target, which is OK for the vmware  
module (as that is an API based one), but then you also target  
localhost for the docker stuff.  
Split your deployment into separate playbook and make sure you're  
targeting the correct host.  
This may involve add\_host etc.

---

<div class="post-metadata">

**Author:** ![bec12317](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@bec12317](https://forum.ansible.com/u/bec12317)\
**Post date:** [April 26, 2021, 11:05am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/6 "2021-04-26T11:05:14Z")

</div>

I added become\_user: true  
become\_user\_pass: true  
I got the same error without the pass, but when i add the pass, i get this:

ERROR! ‘become\_user\_pass’ is not a valid attribute for a Play

---

<div class="post-metadata">

**Author:** ![bec12317](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@bec12317](https://forum.ansible.com/u/bec12317)\
**Post date:** [April 26, 2021, 11:07am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/7 "2021-04-26T11:07:52Z")

</div>

I wish i could separate them as you have told me but i am very new to ansible and I am using it for my final project. I dont know how to do that. I changed the host to the target node’s name. I think you are right because the localhost does the installation of the docker on the control node. But I do not know what to do.

---

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [April 26, 2021, 11:39am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/8 "2021-04-26T11:39:33Z")

</div>

> I wish i could separate them as you have told me but i am very new to ansible and I am using it for my final project. I dont know how to do that. I changed the host to the target node's name. I think you are right because the localhost does the installation of the docker on the control node. But I do not know what to do.

Here is a sample ansible playbook; don't know who wrote it. Take a  
look at it. Ask questions. Once you understand it, what you are trying  
to do should make sense.

[https://www.ansible.com/blog/getting-started-writing-your-first-playbook](https://www.ansible.com/blog/getting-started-writing-your-first-playbook)

---

<div class="post-metadata">

**Author:** ![Nuno\_Jordao](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nuno\_Jordao](https://forum.ansible.com/u/Nuno_Jordao)\
**Post date:** [April 26, 2021, 11:44am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/9 "2021-04-26T11:44:34Z")

</div>

A playbook is a list of plays. Example:

---

<div class="post-metadata">

**Author:** ![bec12317](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@bec12317](https://forum.ansible.com/u/bec12317)\
**Post date:** [April 26, 2021, 11:46am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/10 "2021-04-26T11:46:20Z")

</div>

Thank you so much. I am looking at it

---

<div class="post-metadata">

**Author:** ![bec12317](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@bec12317](https://forum.ansible.com/u/bec12317)\
**Post date:** [April 26, 2021, 11:48am UTC](https://forum.ansible.com/t/docker-installation-problems/35054/11 "2021-04-26T11:48:26Z")

</div>

Thank you very much…taking a look at it
