
Table with Ansible commands I use often:
Command | Explanation |
$ ansible-playbook playbook.yml -i ~/inventory/production -e "target=host1" | Run a playbook with some common options. |
$ ansible-vault encrypt_string 'secret' --name 'foobar' | Encrypt a variable. |
$ ansible localhost -m debug -a var='foobar' -e '@inventory/group_vars/all/foobar.yml' | Decrypt a variable. |
$ ansible-inventory --list -i ./inventory/production | Parse the inventory. |
$ ansible-galaxy collection install -r requirements.yml --upgrade | Install and upgrade collections from a requirements.yml file. |
Leave a Reply