AWX and NFS mounts

,

Continuing the discussion from The default execution environment cannot mount the local nfs storage volume:

@wxh9527 , Would you mind sharing exactly what you did to resolve it please?

What exactly did you put into the custom pod spec as well as anything else you may have done.

I’m asking because in the past w/straight ansible I would run playbooks to backup my cisco switches. etc. Those configs would be stored on my ansible (cli) host that I could access when needed. When I do the same in AWX, the configs would be stored in a container that goes away after execution.

Perhaps someone can tell me if I’m on the right path at least:

I created an instance group with the following custom pod specs:

apiVersion: v1
kind: Pod
metadata:
namespace: awx
spec:
serviceAccountName: default
automountServiceAccountToken: false
containers:
- image: quay.io/ansible/awx-ee:latest
name: worker
args:
- ansible-runner
- worker
- ‘–private-data-dir=/runner’
volumeMounts:
- name: nfststmnt
mountPath: /scratch
volumes:

  • name: nfststmnt
    nfs:
    server: 192.168.1.22 # not actual ip
    path: /shared

Then in my template, I select the instance group created above. In that template I’m attempting to save output to scratch. Here is my template:


  • hosts: all
    connection: httpapi
    gather_facts: no
    vars:
    vdom: “root”
    ansible_httpapi_use_ssl: yes
    ansible_httpapi_validate_certs: no
    ansible_httpapi_port: 443
    ansible_network_os: fortinet.fortios.fortios
    tasks:
    • name: Backup
      fortinet.fortios.fortios_monitor:
      selector: ‘backup.system.config’
      vdom: “root”
      params:
      scope: ‘global’
      register: backupinfo

    • name: Save the backup information.
      copy:
      content: ‘{{ backupinfo.meta.raw }}’
      dest: ‘/scratch/fw1.cfg’

The playbook runs, gathers the fortigate backup, its failing to save to /scratch (my nfs share).

Any help would be extremely appreciated.

It was an issue w/nfs export… I figured I may as well check that while Im waiting.

Issue resolved, thanks anyway :wink:

2 Likes