useful snippets from my various playbooks
Script/comand output as usable variables in playbook. This playbook executes a script using a script module and sets it's output for further use in the playbook
Useradd with setting disk quota - sample use of authorized_key module
-pub asks for publick key of user (preferred way - private remains with user) other will check the configured directory for ~/all-keys/user or create it
provides the difference between two files - you can further extend this to execute some action if the difference is less or more than expected e.g. ETL jobs that create intermediate state data ...
a sample play to automate the playbook execution that expects password to connect with the target server using ansible-vault, expect module and another playbook executing this playbook with -|--ask-pass and being itself executed with --vault-pass-file
Uses find module to remove older log files. Interesting use of with_items and item.key