We now check explicitely for 'module_setup' in the SETUP_CACHE in order to avoid skipping setup because SETUP_CACHE was populated some other way. Other modules can implement the same mechanism to test if they've already run.
This closes#1206.
Since a skipped/ignored action is _very_ different from actual changes to a system, it always bothered me that it was not easily distinguishable when skimming the output. This change makes ignore/skip a different color, and I chose cyan. Contemplated using dark-gray/blue, but prefered something that is readable with most terminal colors.
This change makes a distinction between no_hosts_matched and no_hosts_remaining.
In both cases we do not start facts-gathering, or run any tasks.
In the case that there are no more hosts remaining, we abort running tasks and abort the playbook.
I also cleaned up the leftovers from the previous patchsets, as these are no longer required.
This closes#1187.
Example playbook:
```yaml
---
- hosts: emptygroup
tasks:
- action: command date
- action: command false
- hosts: all
gather_facts: False
tasks:
- action: command ls
- action: command false
- action: command true
- hosts: all
tasks:
- action: command true
- action: command false
- hosts: all
tasks:
- action: command pwd
```
Since BOOLEANS also contains integers, joining the list returns an error. Easy to test by giving a wrong value to a boolean argument:
service name=httpd enabled=True
Since True is not in the allowed BOOLEANS, it will cause the error, which in its turn bails out because it joins strings and integers.
We may want to remove the integers from the choices since '0' and '1' are already in the list as strings. Personally I would expect only strings as arguments, not sure where these could be integers ??
Automatic quoting of variables in only_if breaks existing playbooks
where entire statements are put in a variable, and other cases. See
issue #1120 for details.
This fixes a few issues,
- ${foo}${bar} would be parsed as a variable named foo}${bar,
which wouldn't be easily fixed without breaking ${foo.${bar}}
- allows escaping . in variable parts so e.g.
${hostvars.{test.example.com}.foo} works
This is slower than using re. 3 million templating calls take about
about twice as long to complete with this compared to the regexp,
from ~65 seconds to ~115 seconds on my laptop.
This fixes e.g. only_if: ${task.changed} which would always
evaluate to true due to it having been replaced by a string for its
boolean value. Also adds a test case to ensure it doesn't get
missed again.