4 ms·
> I'm almost surprised that you can't add a shebang line pointing to Ansible at the top of your YAML. You actually can do that, with something like: #!/us
by drybjed 5y ago
> I'm almost surprised that you can't add a shebang line pointing to Ansible at the top of your YAML.
You actually can do that, with something like:
#!/usr/bin/env ansible-playbook
---
- hosts: localhost
tasks:
- debug: var=ansible_distribution_release
It works pretty nicely, just remember to make your playbook file executable. It's a bit cumbersome though since you cannot use `ansible-playbook` arguments like `--limit`, `--diff`, `--check` and so on to have better control over the playbook execution.