How to configure VMware Snapshot

Hi All

Just wanted to know what is the process to set AWX to run VMware snapshot?
I found this article but unsure how to perform this on the platform

As there is a playbook & a vars.yml to enter all the hostname etc
How would do this as I want the project & Playbook to be stored in GitHub, without exposing the password and username?

I thought of putting it locally as a project on the box but get an error "

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 Source Control Type option above."

Any advise would be great, I am also just a beginner on this platform

Thanks

Hi, it is recommended to store project files in SCM like github, bitbucket

if your project is private, then you’ll need a source control credential to attach to your project https://docs.ansible.com/automation-controller/latest/html/userguide/credentials.html#source-control

if you don’t want to enter username/password you can use an external manager vault and do a lookup, see these docs about configuring that https://docs.ansible.com/automation-controller/latest/html/userguide/credential_plugins.html#configure-and-link-secret-lookups

Let us know if you have more questions about this

AWX Team

Hi

Thanks for the response

If I was to use the below and store in Github

Add the credentials, hostname etc for this within AWX would that work?

The questions I ask are basic for you but you have to excuse as I am newbie to this all

Thanks

---
- name: vm snapshot demo
  hosts: localhost
  become: false
  gather_facts: false
  collections:
    - community.vmware
  pre_tasks:
    - include_vars: vars.yml
  tasks:
    - name: create snapshot
      vmware_guest_snapshot:
        hostname: "{{ vcenter_hostname }}"
        username: "{{ vcenter_username }}"
        password: "{{ vcenter_password }}"
        datacenter: "{{ vcenter_datacenter }}"
        validate_certs: "{{ vcenter_validate_certs }}"
        name: "{{ vm_name }}"
        state: present
        snapshot_name: "Ansible Managed Snapshot"
        folder: "{{ vm_folder }}"
        description: "This snapshot is created by Ansible Playbook"