Commit Graph

8 Commits (43f48a2e021f12cfe3547904ce0a97c7dfdbf893)

Author SHA1 Message Date
Michael Scherer 12bf9a8b69 add a way for callback to disable itself
The idea is that some plugin would not be called in some
specific case, and the callback should decide by itself.

Having a way to globally disable it is much cleaner than
disabling every method one by one on the plugin side.

My use case is for fedora-infrastructure that cannot be run
from git checkout since it try to connect to the message bus,
but another case would be to bootstrap infrastructure, or to
run the code on a test servers without having all the callback
infrastructure setup.
2013-08-14 22:32:28 +02:00
Chris Church d1de7839d7 Renamed on_no_hosts_matched/on_no_hosts_remaining to correct names in noop callback, added methods to callback plugin examples. 2013-06-09 12:19:07 -04:00
Michael DeHaan c8878998d1 update some of many copyright dates but we can just do this when editing each file, not super high priority 2013-02-16 15:32:01 -05:00
Rodney Quillo 395093e0bf Move default arguments to the end of the function call. 2013-01-19 08:34:47 +08:00
Rodney Quillo 7ae100611c Adding default on vars_prompt 2013-01-18 19:00:57 +08:00
Dag Wieers 20c1a67711 Abort a play at the start when no hosts matches, or no hosts are remaining
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
```
2012-10-02 15:54:24 +02:00
Michael DeHaan 6fb1884a03 Add __init__'s to git 2012-09-06 18:43:28 -04:00
Michael DeHaan 3de4e45741 Move plugin directories 2012-08-21 20:32:21 -04:00