We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, many variables in the playbook are supplied via ansible-playbook xxx.yaml --extra-vars "@some_file.yaml"
ansible-playbook xxx.yaml --extra-vars "@some_file.yaml"
Here's a cleaner (arguably better) way:
vars_files: - vars/api.yml - vars/resources.yml - vars/ordering_org.yml
While all different ways are essentially the same, using vars_files has the following advantages:
vars_files
api_endpoint
api_key
ansible-playbook xxx.yaml
<DATA_FIELD>
note: the actual var/*.yaml files should be gitignored in production, but the file name included in the playbook is fine.
var/*.yaml
new edit: there is one scenario to use --extra-vars, when deploying multiple org each of which has the same playbook but different data.
--extra-vars
for i in $(seq 1 10); do ansible-playbook 02-endorsing-org.yaml --extra-vars "@vars/org$i.yaml" done
The text was updated successfully, but these errors were encountered:
This is a great idea @alxiong, I wasn't aware you could do this!
Sorry, something went wrong.
Use vars_files in playbooks instead of --extra-vars on CLI (resolves I…
b64faa1
…BM-Blockchain#250) Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
db25a8a
1e17318
6a4506e
sstone1
No branches or pull requests
Currently, many variables in the playbook are supplied via
ansible-playbook xxx.yaml --extra-vars "@some_file.yaml"
Here's a cleaner (arguably better) way:
While all different ways are essentially the same, using
vars_files
has the following advantages:api_endpoint
,api_key
etc that should be shared across playbooks.ansible-playbook xxx.yaml
now<DATA_FIELD>
under specified tasknote: the actual
var/*.yaml
files should be gitignored in production, but the file name included in the playbook is fine.new edit: there is one scenario to use
--extra-vars
, when deploying multiple org each of which has the same playbook but different data.The text was updated successfully, but these errors were encountered: