You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using ansible for similar projects for quite some time now. Perhaps I could share some ideas that have proved useful in my daily work.
I usually make ansible less verbose (more user friendly) and significantly faster (by re-using the ssh connection once it has been established within a task).
NOTE: Normally I leave the inventory = entry out - I'm used to add a Makefile to my project that passes the inventory via environment variable.
stdout_callback = selective replaces successful steps in a task by a single dot by default. If this is undesirable, I add the print_action tag to override this, e.g. to show a positive [OK] message as in the following example on a raspberry pi:
- name: check if we have a AUTOBOOT partition
shell:
cmd: >
blkid -o export /dev/{{ bootdev.stdout }}1 | grep -Fq 'LABEL_FATBOOT=AUTOBOOT'
register: autoboot
failed_when: autoboot.rc > 1
- assert:
that: autoboot.rc == 0
success_msg: "[OK] found AUTOBOOT partition"
fail_msg: "[FAIL] missing AUTOBOOT partition at /dev/{{ bootdev.stdout }}1"
tags: [print_action]
Regards
Marcel
The text was updated successfully, but these errors were encountered:
I'm using ansible for similar projects for quite some time now. Perhaps I could share some ideas that have proved useful in my daily work.
I usually make ansible less verbose (more user friendly) and significantly faster (by re-using the ssh connection once it has been established within a task).
My usual settings for ansible.cfg:
NOTE: Normally I leave the
inventory =
entry out - I'm used to add aMakefile
to my project that passes the inventory via environment variable.stdout_callback = selective
replaces successful steps in a task by a single dot by default. If this is undesirable, I add theprint_action
tag to override this, e.g. to show a positive[OK]
message as in the following example on a raspberry pi:Regards
Marcel
The text was updated successfully, but these errors were encountered: