15 Apr 2022 导出和导入aap资源

2023-10-17 10:27:02 浏览数 (2)

  • 获取aap controller管理员密码:

代码语言:javascript复制
$ oc get secret automation-controller-admin-password -n ansible-automation-platform -o json | jq -r '.data.password' | base64 -d
  • 确保可以登录到aap controller:
代码语言:javascript复制
$ awx login --conf.host https://app-controller.com/ --conf.username $USERNAME --conf.password $PASSWORD
  • 从aap导出资源:
代码语言:javascript复制
$ awx export --conf.host https://app-controller.com/ --conf.username $USERNAME --conf.password $PASSWORD > resource.json
  • 将资源导入到另一个aap环境:
代码语言:javascript复制
$ awx import < resource.json --conf.host https://app-controller.com/ --conf.username $USERNAME --conf.password $PASSWORD

links

  • https://docs.ansible.com/ansible-tower/latest/html/towercli/examples.html#import-export
  • https://docs.ansible.com/ansible-tower/latest/html/towercli/usage.html#installation

LEo at 00:12

0 人点赞