🚧
Pinned Loading
-
ansible-args-keyword
ansible-args-keyword 1Most Ansible users have come across the `args` keyword when using the `ansible.builtin.command` module. In this case the `args` keyword is used to pass a named parameter such as `chdir` or `creates` to the module that accepts a "free form" parameter.
23Example:
45- ansible.builtin.command: touch filename #Run this command
-
Jinja filtering for Ansible users
Jinja filtering for Ansible users 1I frequent the r/ansible sub and try to help out and answer as many questions as I can. One area that I see most people struggling with is using some of the more advanced jinja filters such as `select`, `selectattr` and `map`.
2In this post I will try to give some easy to understand examples of how to use these filters in order to filter lists and dictionaries in your Ansible playbooks.
34### What are tests?
5In jinja a test is a template expression that evaluates to either `True` or `False`.
-
ansible_style_guide.md
ansible_style_guide.md 1# Ansible style guide
2A list of best practises and style choices that I think are good for writing clean and consistent Ansible.
34#### Prefix global variables with the organisation / company name
5This makes it easy to differentiate between a "global" variable and a playbook/role variable.
-
python-ansible-inventory-example.py
python-ansible-inventory-example.py 1from ansible.cli import CLI
2from ansible.template import Templar
3from ansible.vars.manager import VariableManager
4from ansible.parsing.dataloader import DataLoader
5from ansible.inventory.manager import InventoryManager
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.