# mounted playbook dir in docker

**URL:** <https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 19, 2017, 9:03pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534 "2017-09-19T21:03:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [September 19, 2017, 9:03pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/1 "2017-09-19T21:03:38Z")

</div>

I am running AWX in docker containers and have mounted the playbooks directory (I modified local\_docker/tasks/main.yml:“Activate AWX Task Container” to include a volume argument).

I created a directory and a playbook and it shows up inside the container:

> $ docker exec -it awx\_task /bin/ls -hal /var/lib/awx/projects/helloworld/  
> total 4.0K  
> drwxr-xr-x 3 root root 102 Sep 19 18:49 .  
> drwxr-xr-x 3 root root 102 Sep 19 18:49 …  
> -rw-r–r-- 1 root root 116 Sep 19 18:38 helloworld.yml

Yet, I still get the warning when I try to create a manual project:

> > WARNING: There are no available playbook directories in /var/lib/awx/projects. Either that directory is empty, or all of the contents are already assigned to other projects. Create a new directory there and make sure the playbook files can be read by the “awx” system user, or have AWX directly retrieve your playbooks from source control using the SCM Type option above.

The “helloworld” project/playbook also don’t show up when creating a new Job Template.

Is there some special trick to getting AWX to recognize this directory?

thanks,

-MikeB

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 20, 2017, 12:53am UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/2 "2017-09-20T00:53:27Z")

</div>

Does it work without the volume mount if you populate it the same way in a container?

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [September 20, 2017, 1:28pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/3 "2017-09-20T13:28:37Z")

</div>

Same behavior. fwiw, I had to create the /var/lib/awx/projects/ directory:

---

<div class="post-metadata">

**Author:** ![James\_Laska1](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@James\_Laska1](https://forum.ansible.com/u/James_Laska1)\
**Post date:** [September 20, 2017, 1:48pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/4 "2017-09-20T13:48:11Z")

</div>

Perhaps silly, but make sure the `awx` user has access to read the files+directory. In addition, confirm whether SELinux is active and denying access to that file/dir. That may not be the case in the container environment, I don’t recall off hand.

Thanks,  
James

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [September 20, 2017, 2:16pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/5 "2017-09-20T14:16:18Z")

</div>

I’ve maxed the perms and it’s the same user as the projects that I’ve imported through the UI. Also, there is no ‘awx’ user in the container:

[root@awx projects]# id awx

id: awx: no such user

[root@awx projects]# ls -ahl /var/lib/awx/projects/

total 16K

drwxrwxrwx 4 root root 4.0K Sep 20 14:01 .

drwxrwxr-x 8 root root 4.0K Sep 20 13:47 **…**

drwxr-xr-x 7 root root 4.0K Sep 20 13:44 **\_12\_\_mikeb\_test**

drwxrwxrwx 2 root root 4.0K Sep 20 13:23 helloworld

Fwiw, this isn’t a must-have because I don’t want to be managing these by hand directly on the system. In production, I want every playbook to be behind git control, in which case, I can install through the GUI. This is more for quick testing and debugging.

I might have an idea, though…

I’m going to try this:

1. install my global roles on the host machine
2. mount the global roles as a volume: /opt/myroles/
3. add an ansible.cfg file to each playbook that specifies role\_path=/opt/myroles.

I will report back what happens.

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 20, 2017, 2:18pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/6 "2017-09-20T14:18:59Z")

</div>

So something you might not realize is that if you have a manual project that projects needs to be put on the web _and_ task nodes… it sounds like you are only putting it on one.

---

<div class="post-metadata">

**Author:** ![Guillem\_Lozano](https://avatars.discourse-cdn.com/v4/letter/g/8c91f0/32.png) [@Guillem\_Lozano](https://forum.ansible.com/u/Guillem_Lozano)\
**Post date:** [September 20, 2017, 2:33pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/7 "2017-09-20T14:33:01Z")

</div>

Hello,

Reached same behavior when I try to create a new project using SCM Type=Manual

But in the “awx\_web” does not exist any folder called projects (/var/lib/awx/)

I Had to create the folder manually and now runs like a charm!

Thx!

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [September 20, 2017, 2:36pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/8 "2017-09-20T14:36:58Z")

</div>

@Guillem so, you had to create /var/lib/awx/projects/ in both awx\_task and awx\_web?

Where do you put your playbooks? in tasks or web or both?

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [September 20, 2017, 2:37pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/9 "2017-09-20T14:37:27Z")

</div>

Same contents?

---

<div class="post-metadata">

**Author:** ![Guillem\_Lozano](https://avatars.discourse-cdn.com/v4/letter/g/8c91f0/32.png) [@Guillem\_Lozano](https://forum.ansible.com/u/Guillem_Lozano)\
**Post date:** [September 20, 2017, 2:42pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/10 "2017-09-20T14:42:25Z")

</div>

@Mike Yes! just create the folder projects//.yml same in awx\_task and awx\_web.

---

<div class="post-metadata">

**Author:** ![matburt](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/matburt/32/3612_2.png) [@matburt](https://forum.ansible.com/u/matburt)\
**Post date:** [September 20, 2017, 2:42pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/11 "2017-09-20T14:42:41Z")

</div>

As I said, you have to put them in both.

---

<div class="post-metadata">

**Author:** ![Prashant\_Solanki](https://avatars.discourse-cdn.com/v4/letter/p/7ba0ec/32.png) [@Prashant\_Solanki](https://forum.ansible.com/u/Prashant_Solanki)\
**Post date:** [November 25, 2017, 10:42am UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/12 "2017-11-25T10:42:51Z")

</div>

Hello mike  
I am facing the same issue can u please help me for the error. i have tried to create the same directory also but no resoult

WARNING: There are no available playbook directories in /var/lib/awx/projects. Either that directory is empty, or all of the contents are already assigned to other projects. Create a new directory there and make sure the playbook files can be read by the “awx” system user, or have AWX directly retrieve your playbooks from source control using the SCM Type option above

---

<div class="post-metadata">

**Author:** ![Mike\_Biancaniello](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Mike\_Biancaniello](https://forum.ansible.com/u/Mike_Biancaniello)\
**Post date:** [November 26, 2017, 5:40pm UTC](https://forum.ansible.com/t/mounted-playbook-dir-in-docker/25534/13 "2017-11-26T17:40:19Z")

</div>

Prashant,

I mounted (as volumes) my projects dir into **_both_** the web and task containers. This worked great.

L:201, 231

[https://github.com/chepazzo/awx/blob/custom\_packages\_volumes/installer/local\_docker/tasks/main.yml](https://github.com/chepazzo/awx/blob/custom_packages_volumes/installer/local_docker/tasks/main.yml)

That branch is a bit outdated, so the code needs to be cleaned up a bit before it could be used with the most recent devel branch, but the concept should remain the same.
