如何导入 metadata.yml 文件中定义的所有项目?

如何导入 metadata.yml 文件中定义的所有项目?

这是我第一次尝试 AWX/Ansible,所以请温柔一点 :)

我在 Kubernetes 中设置了一个新的 AWX 实例(使用 AWX Operator),并尝试从旧实例(我没有设置,也无法控制)导入我们现有的作业模板。metadata.yml我们的剧本存储库中有一个文件定义它们。格式为:

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'
  ...

有多个这样的“awx.awx.job_template”对象。我真的很想不是手动导入每一个。Tower 中是否有可以自动导入它们的东西?我是否遗漏了某些显而易见的东西?

相关内容