英文:
in ansiblePlaybook plugin how to add multiple inventory files
问题
这是 Ansible Playbook。我有两个清单文件。如何在下面的命令中添加这两个?
ansiblePlaybook(
playbook: 'ansible/playbooks/stop-start.yml',
inventory: ['ansible-inventory-file1', 'ansible-inventory-file2'],
credentialsId: 'test-ssh',
hostKeyChecking: false,
extraVars: [
action: "stop",
deploy_env: "${Environment}",
],
)
英文:
This is ansible playbook. I have two inventory files. How can I add those two in the below command?
ansible-inventory-file1
ansible-inventory-file1
ansiblePlaybook(
playbook: 'ansible/playbooks/stop-start.yml',
inventory: 'ansible-inventory-file1',
credentialsId: 'test-ssh',
hostKeyChecking: false,
extraVars: [
action: "stop",
deploy_env: "${Environment}",
],
答案1
得分: 2
把文件放入一个目录中
shell> tree ansible-inventory/
ansible-inventory/
├── file1
└── file2
0 directories, 2 files
使用这个目录
inventory: 'ansible-inventory',
英文:
Put the files into a directory
shell> tree ansible-inventory/
ansible-inventory/
├── file1
└── file2
0 directories, 2 files
Use this directory
inventory: 'ansible-inventory',
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论