Skip to content

Instantly share code, notes, and snippets.

@zeitounator
Created November 30, 2023 18:26
Show Gist options
  • Save zeitounator/b71b216ffe5d05d67d2af8a3441eba4a to your computer and use it in GitHub Desktop.
Save zeitounator/b71b216ffe5d05d67d2af8a3441eba4a to your computer and use it in GitHub Desktop.
$ ansible --version
ansible [core 2.15.6]
config file = None
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/user/.local/lib/python3.10/site-packages/ansible
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
executable location = /home/user/.local/bin/ansible
python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True
$ cat test.yml
---
- hosts: localhost
gather_facts: false
tasks:
- ini_file:
path: toto.conf
section: null
option: fav
value: juice
$ # Create the empty conf file
$ cat /dev/null > toto.conf
$ ansible-playbook test.yml
PLAY [localhost] ****************************************************************************************************************************************************
TASK [ini_file] *****************************************************************************************************************************************************
changed: [localhost]
PLAY RECAP **********************************************************************************************************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
$ cat toto.conf
fav = juice
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment