August 2015
Intermediate to advanced
168 pages
3h 32m
English
At times, a specific task in a role may need to be executed only once during a playbook execution, even though the role is applied to many hosts. This could be achieved with the run_once conditional:
name: initialize wordpress database script: initialize_wp_database.sh run_once: true
Since we are using the run_once option, the preceding task would run on the first host in the inventory that the role is being applied to. All consequent hosts would skip this task.
Read now
Unlock full access