0

This is my first foray into anything AWX/Ansible, so please be gentle :)

I've set up a new AWX instance in Kubernetes (using the AWX Operator), and am trying to import our existing job-templates from an old instance (that I did not set up, nor have control over). There is a metadata.yml file in our playbooks repo that defines them. The format is:

project_name: playbooks
project_version: 2.5.7
project_type:
   - ansible
awx:
##################################
# Project List
##################################
  - name: patching playbooks
    awx.awx.project:
      name: 'patching.playbooks'
      description: "General purpose server patching playbooks."
      organization: "our-team"
      state: present
      update_project: yes
      scm_type: git
      scm_clean: yes
      scm_url: "https://git.company.com/our-team/repo.git"
      scm_branch: master
      allow_override: yes

  - name: "ubuntu-patching"
    awx.awx.job_template:
      name: "Ubuntu-Patching"
      description: "Patch Ubuntu servers."
      organization: "our-team"
      state: present
      execution_environment: "AWX EE"
      project: patching.playbooks
      credentials: ['awx-ssh-key', ]
      inventory: 'non-prod'
      playbook: patch_ubuntu.yml
      job_type: check
      limit: 'invalid.company.com'
      allow_simultaneous: true
      ask_inventory_on_launch: true
      ask_credential_on_launch: true
      ask_job_type_on_launch: true
      ask_limit_on_launch: true
      ask_scm_branch_on_launch: true
      ask_variables_on_launch: true
      ask_verbosity_on_launch: true
      extra_vars:
        resize_disks: true
      notification_templates_error:
        - 'notify-us'
  ...

There are multiple of these "awx.awx.job_template" objects. I would really like to not import every one of them manually. Is there something in Tower that I can use to import them automatically? Am I missing something obvious?

Sagar
  • 534
  • 3
  • 7
  • 21

0 Answers0