# AWX change project base path Kubernetes

**URL:** <https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473>\
**Category:** Get Help\
**Tags:** awx, collections, kubernetes\
**Created:** [November 20, 2023, 8:32pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473 "2023-11-20T20:32:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScorpionKing34](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/scorpionking34/32/1592_2.png) [@ScorpionKing34](https://forum.ansible.com/u/ScorpionKing34)\
**Post date:** [November 20, 2023, 8:32pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/1 "2023-11-20T20:32:28Z")

</div>

Dear people,

I have successfully installed AWX with Kubernetes on Debian 12 with the following guide  
‘[https://computingforgeeks.com/how-to-install-ansible-awx-on-debian-buster/?expand\_article=1](https://computingforgeeks.com/how-to-install-ansible-awx-on-debian-buster/?expand_article=1)’

How can I change project base path ‘/var/lib/awx/projects’ from Kubernetes to the underlining Debian OS to ‘/opt/awx/projects’ or link between to directories?

I’ve searched my ass off but I can’t find a good tutorial or configuration.  
I hope someone can help me.

---

<div class="post-metadata">

**Author:** ![thedoubl3j](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thedoubl3j/32/103_2.png) [@thedoubl3j](https://forum.ansible.com/u/thedoubl3j)\
**Post date:** [November 20, 2023, 9:16pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/2 "2023-11-20T21:16:50Z")

</div>

Hey @ScorpionKing34, welcome! You can do this by changing the conf file found at `/etc/awx/conf.d/custom.py` per [15. Projects — Ansible AWX community documentation](https://ansible.readthedocs.io/projects/awx/en/latest/userguide/projects.html#projects)

Though I would heed its warning of “…as incorrect settings can disable your installation.”.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![ScorpionKing34](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/scorpionking34/32/1592_2.png) [@ScorpionKing34](https://forum.ansible.com/u/ScorpionKing34)\
**Post date:** [November 20, 2023, 9:20pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/3 "2023-11-20T21:20:30Z")

</div>

Is this in the shell of the Kubernetes? If so with one:  
awx-operator-controller-manager 1/1 1 1 40m  
awx-task 1/1 1 1 21m  
awx-web 1/1 1 1 20m

On Debian OS I have no `/etc/awx/conf.d` directory.

---

<div class="post-metadata">

**Author:** ![thedoubl3j](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thedoubl3j/32/103_2.png) [@thedoubl3j](https://forum.ansible.com/u/thedoubl3j)\
**Post date:** [November 20, 2023, 9:38pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/4 "2023-11-20T21:38:12Z")

</div>

_opens issues on docs to get this changed to be more clear_

In your spec for the operator, how did you set (or did you set) project\_persistence?

Reason I am asking is as I am looking over the operator, it looks like we don’t even set local project storage if its not passed per [https://github.com/ansible/awx-operator/blob/devel/roles/installer/templates/deployments/task.yaml.j2#L122](https://github.com/ansible/awx-operator/blob/devel/roles/installer/templates/deployments/task.yaml.j2#L122)

---

<div class="post-metadata">

**Author:** ![ScorpionKing34](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/scorpionking34/32/1592_2.png) [@ScorpionKing34](https://forum.ansible.com/u/ScorpionKing34)\
**Post date:** [November 20, 2023, 9:39pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/5 "2023-11-20T21:39:27Z")

</div>

> [@ScorpionKing34](#):
>
> /var/lib/awx/projects

I followed the guide with this command:  
$ **tee awx-deploy.yml\<\<EOF**

**–**  
**apiVersion: [awx.ansible.com/v1beta1](http://awx.ansible.com/v1beta1)**  
**kind: AWX**  
**metadata:**  
**name: awx**

**spec:**  
**service\_type: nodeport**  
**projects\_persistence: true**  
**projects\_storage\_access\_mode: ReadWriteOnce**  
**web\_extra\_volume\_mounts: |**  
**- name: static-data**  
**mountPath: /var/lib/projects**  
**extra\_volumes: |**  
**- name: static-data**  
**persistentVolumeClaim:**  
**claimName: static-data-pvc**

**EOF**

Tried also with the following option under extra\_volumes no luck.

- hostPath:  
path: /opt/awx/projects  
type: Directory  
name: os-mount

So, does anyone how to mount a local host OS directory ‘/opt/awx/projects’ into pod of AWX? So that I can use the Source Control Type ‘Manual’ to import project directories.

Also a side questions:

1. If is suspend my vm and resume the vm, the pods does not run any more. Need to reboot to get AWX to work again. How can I fix this, search my ass of to find a solution.

2. How can AWX in Kubernetes be configured with a ssl certificate and https?

3. How can AWX in Kubernetes be configured with ldap?

I’ll hope someone could help me.

---

<div class="post-metadata">

**Author:** ![ScorpionKing34](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/scorpionking34/32/1592_2.png) [@ScorpionKing34](https://forum.ansible.com/u/ScorpionKing34)\
**Post date:** [December 6, 2023, 6:56pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/6 "2023-12-06T18:56:18Z")

</div>

Does someone have a solution for this?

---

<div class="post-metadata">

**Author:** ![TheRealHaoLiu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/therealhaoliu/32/100_2.png) [@TheRealHaoLiu](https://forum.ansible.com/u/TheRealHaoLiu)\
**Post date:** [December 6, 2023, 7:41pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/7 "2023-12-06T19:41:36Z")

</div>

in your snippet

```auto
hostPath:
path: /opt/awx/projects
type: Directory
name: os-mount

```

the volume is defined as `os-mount` and in your other snippet the volumeMount is refering to `static-data`

also the project dir need to be mounted to both web and task container for this to work correctly

---

<div class="post-metadata">

**Author:** ![ScorpionKing34](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/scorpionking34/32/1592_2.png) [@ScorpionKing34](https://forum.ansible.com/u/ScorpionKing34)\
**Post date:** [December 6, 2023, 8:08pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/8 "2023-12-06T20:08:49Z")

</div>

> [@ScorpionKing34](#):
>
> [https://computingforgeeks.com/how-to-install-ansible-awx-on-debian-buster/?expand\_article=1](https://computingforgeeks.com/how-to-install-ansible-awx-on-debian-buster/?expand_article=1)

I follow this tutorial:  
[https://computingforgeeks.com/how-to-install-ansible-awx-on-debian-buster/?expand\_article=1](https://computingforgeeks.com/how-to-install-ansible-awx-on-debian-buster/?expand_article=1)

How can I apply your suggestion? Or do you know a good step-by-step instruction also for Ubuntu and enable /opt/awx/projects?

---

<div class="post-metadata">

**Author:** ![ScorpionKing34](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/scorpionking34/32/1592_2.png) [@ScorpionKing34](https://forum.ansible.com/u/ScorpionKing34)\
**Post date:** [December 12, 2023, 5:02pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/9 "2023-12-12T17:02:48Z")

</div>

Is there anyone who can help me with my issue?

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [December 14, 2023, 3:44pm UTC](https://forum.ansible.com/t/awx-change-project-base-path-kubernetes/2473/10 "2023-12-14T15:44:53Z")

</div>

Here are quick steps:

```bash
# Change permission and owner for /opt/awx/projects
$ sudo chmod 775 /opt/awx/projects
$ sudo chown 1000:0 /opt/awx/projects

# Create pv.yml and pvc.yml
$ tee pv.yml << EOF
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: awx-projects-volume
spec:
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  capacity:
    storage: 2Gi
  storageClassName: awx-projects-volume
  hostPath:
    path: /opt/awx/projects
EOF

$ tee pvc.yml << EOF
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: awx-projects-claim
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 2Gi
  storageClassName: awx-projects-volume
EOF

# Apply pv.yml and pvc.yml
$ kubectl apply -f pv.yml
$ kubectl -n awx apply -f pvc.yml

# Update your awx-deploy.yml
$ tee awx-deploy.yml << EOF
---
apiVersion: awx.ansible.com/v1beta1
kind: AWX
metadata:
  name: awx
spec:
  service_type: nodeport
  projects_persistence: true
  projects_existing_claim: awx-projects-claim

  # Following lines are superfluous settings that serves no purpose and may be deleted
  # web_extra_volume_mounts: |
  # - name: static-data
  # mountPath: /var/lib/projects
  # extra_volumes: |
  # - name: static-data
  # persistentVolumeClaim:
  # claimName: static-data-pvc
EOF

```

Then go back to your guide to deploy updated `awx-deploy.yml`.
