Recent posts

How to replace multiple lines in file

less than 1 minute read

Replacing multiple lines in file - name: Set some kernel parameters lineinfile: dest: /etc/sysctl.conf regexp: "" line: "" with_items: - ...

How to use virtualenv Python on localhost

less than 1 minute read

Force to use virtualenv python When running modules that require virtualenv, such as Azure, local_action or localhost connection sometimes still use the de...

How to determine variable precedence

less than 1 minute read

Lowest precedence to hightest Role default variables Inventory variables Inventory group_vars variables: Inventory host_vars variables: group_vars...

How to check yaml syntax

less than 1 minute read

Using python yaml module python -c 'import yaml, sys; print yaml.load(sys.stdin);' < my_playbook.yml If no syntax error exists, Python prints the content...

How to call groups in the inventory

less than 1 minute read

# To see all hosts in the inventory ansible all -i inventory --list-hosts ansible '*' -i inventory --list-hosts To see all hosts by wild cards ansible '*.ex...