title: Ansible AWX - write a local file
body: <p>I'm running ansible AWX in minikube and I could use some assistance in understanding how to write a file to AWXcontaner. My goal is to use a survey to create a template. This template would be written to the file system and pushed to a git repo for retention. Writing a file to AWX was a first test.</p>
  <p>I'm very new to awx and minikube but the containers seems to be running fine but when I try a simple write playbook, the file is not written. The task shows &quot;changed&quot;.</p>
  <p>In an effort to troubleshoot I attempted to create a persistent volume but the results are the same. I'd appreciate any assistance.</p>
  <p>playbook</p>
  <pre><code>---
  - name: demonstrate using surveys with templates
    hosts: localhost
    gather_facts: false
    become: false
  
  tasks:
   - name: Creating a file with content
      copy:
        dest: &quot;testOne.conf&quot;
        content: &quot;this is a test&quot;
  </code></pre>
  <p>playbook execution in awx</p>
  <pre><code>PLAY [demonstrate using surveys with templates] ********************************
  TASK [Creating a file with content] ********************************************
  changed: [localhost]
  PLAY RECAP *********************************************************************
  localhost                  : ok=1    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   
  </code></pre>
  <pre><code>~$ kubectl get pods
  NAME                            READY   STATUS    RESTARTS   AGE
  ansible-awx-dbc6f6b74-x7sv2     4/4     Running   0          3h9m
  ansible-awx-postgres-0          1/1     Running   0          3h9m
  awx-operator-69c646c48f-dd5dk   1/1     Running   0          3h10m
  </code></pre>
  <p>I've made a persistent volume</p>
  <pre><code>$ kubectl get pv
  NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                     STORAGECLASS   REASON   AGE
  pvc-0a54c0b1-33b7-449a-993c-0934aac5985a   1Gi        RWX            Delete           Bound    default/awx-pvc2                          standard                3h10m
  pvc-539dfe9b-3271-4697-a101-c1fa45daae6d   8Gi        RWO            Delete           Bound    default/postgres-ansible-awx-postgres-0   standard                3h9m
  </code></pre>
  <pre><code>apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: awx-pvc2
  spec:
    accessModes:
      - ReadWriteMany
    resources:
      requests:
        storage: 1Gi
  </code></pre>
  <pre><code>apiVersion: awx.ansible.com/v1beta1
  kind: AWX
  metadata:
    name: ansible-awx
  spec:
    service_type: nodeport
    ingress_type: none
    hostname: ansible-awx.example.com
    projects_existing_claim: awx-pvc2
    projects_persistence: true
    extra_volumes: | 
      - name: &quot;data-vol&quot;
        hostPath: 
          path: &quot;/var/lib/awx&quot;
          type: Directory 
    task_extra_volume_mounts: | 
      - name: &quot;data-vol&quot; 
        mountPath: &quot;/data&quot;
  </code></pre>