No description
Find a file
Dag Wieers 03af450bdc Module to assist users in understanding Ansible
After helping someone on IRC he was interested to have this debug module in upstream. This module simply 'prints' a message, and can be ordered to fail if needed. It helps to troubleshoot or understand inventory/facts issues and/or experiment with statements and conditions using only_if.

Here is a small example playbook:

```yaml
- hosts: all
  tasks:
  - local_action: debug msg="System $inventory_hostname has uuid ${ansible_product_uuid}"
  - local_action: debug msg="System $inventory_hostname lacks a gateway" fail=yes
    only_if: "is_unset('$ansible_default_ipv4.gateway')"
  - local_action: debug msg="System $inventory_hostname has gateway ${ansible_default_ipv4.gateway}"
    only_if: "is_set('$ansible_default_ipv4.gateway')"
```

outputting:
```
[root@moria ansible]# ansible-playbook -v -l localhost:x220 test6.yml

PLAY [all] *********************

GATHERING FACTS *********************
ok: [localhost]
ok: [x220]

TASK: [debug msg="System $inventory_hostname has uuid $ansible_product_uuid"] *********************
ok: [localhost] => {"msg": "System localhost has uuid d125a48c-364f-4e65-b225-fed42ed61fac"}
ok: [x220] => {"msg": "System x220 has uuid d125a48c-364f-4e65-b225-fed42ed61fac"}

TASK: [debug msg="System $inventory_hostname lacks a gateway" fail=yes] *********************
failed: [localhost] => {"failed": true, "msg": "System localhost lacks a gateway", "rc": 1}
ok: [x220] => {"msg": "System x220 has gateway 192.168.1.1"}

PLAY RECAP *********************
localhost                      : ok=2    changed=0    unreachable=0    failed=1
x220                           : ok=3    changed=0    unreachable=0    failed=0

```

I had some other plans for the module, like displaying host inventory and complete inventory to help understand inventory and facts modules, but that would require an action-plugin for transfering inventory information etc... And I am not sure this is wanted/best done in a module.
2012-10-04 09:50:18 +02:00
bin If all hosts in a play fail, fail the whole playbook and don't bother printing out every remaining task. 2012-09-30 21:06:00 -04:00
docs/man Check in generated manpage documentation from modules 2012-10-02 22:46:49 -04:00
examples Simplify register example 2012-09-29 08:10:45 -04:00
hacking include version added info for individual fields 2012-10-02 22:36:27 -04:00
lib/ansible Merge pull request #1204 from dagwieers/fatal-red 2012-10-02 19:06:36 -07:00
library Module to assist users in understanding Ansible 2012-10-04 09:50:18 +02:00
packaging distribution packaging should install all manpages 2012-09-21 11:15:40 -06:00
test Allow non-string types in with_items variables 2012-10-01 17:07:51 +02:00
.gitignore Ignoring PyCharm/IntelliJ and Mac OS X stuff 2012-09-30 11:08:41 +02:00
CHANGELOG.md organize changelog 2012-09-30 21:33:38 -04:00
CONTRIBUTING.md update contributing file 2012-09-17 22:55:06 -04:00
COPYING license file should be in source tree 2012-03-15 20:24:22 -04:00
Makefile Check in generated manpage documentation from modules 2012-10-02 22:46:49 -04:00
MANIFEST.in Add some docs/examples 2012-08-14 13:05:44 -04:00
README.md Update website link 2012-09-24 21:56:37 -04:00
RELEASES.txt Release version bump 2012-09-06 18:56:38 -04:00
setup.py Add package to setup.py 2012-09-07 21:03:59 -04:00
VERSION Release version bump 2012-09-06 18:56:38 -04:00

Ansible

Ansible is a radically simple configuration-management, deployment, task-execution, and multinode orchestration framework.

Read the documentation and more at http://ansible.cc

Design Principles

  • Dead simple setup
  • Super fast & parallel by default
  • No server or client daemons; use existing SSHd
  • No additional software required on client boxes
  • Modules can be written in ANY language
  • Awesome API for creating very powerful distributed scripts
  • Be usable as non-root
  • The easiest config management system to use, ever.

Get Involved

Branch Info

  • Releases are named after Van Halen songs.
  • The devel branch corresponds to the release actively under development.
  • Various release-X.Y branches exist for previous releases
  • We'd love to have your contributions, read "CONTRIBUTING.md" for process notes.

Author

Michael DeHaan -- michael.dehaan@gmail.com

http://michaeldehaan.net