Commit graph

304 commits

Author SHA1 Message Date
Stephen Fromm
8592b3b40d Update user module to support group name
This changes the gid option to group.  One may provide a primary group
as either a gid or a name.  The module will then check to verify that
the group already exists.  If the group does not already exist, the
module will fail.
2012-03-26 23:03:09 -04:00
Michael DeHaan
292ac4aad2 Make it such that the 'name' element of each playbook line is optional. 2012-03-23 21:06:54 -04:00
Michael DeHaan
3814a46bbf Move playbook for user commands into examples dir 2012-03-22 00:33:10 -04:00
Michael DeHaan
a8c921cbcc Allow groups to be passed to runner API to make parse_hosts optional, misc fixes as a result of refactoring in Runner.
Cleanup in Playbooks module is next.
2012-03-22 00:30:05 -04:00
Michael DeHaan
fef73393f0 rename example files 2012-03-21 22:21:42 -04:00
Michael DeHaan
d75e69853a No need to comment this part of the example out. 2012-03-21 20:22:44 -04:00
Michael DeHaan
e6406fa5a7 Allow variable expressions to be stored as variables themselves, do some things to allow setup strings
to more easily contain spaces without being mangled, which is neccessary because of the above.
2012-03-21 20:00:48 -04:00
Michael DeHaan
a5f4ca50b8 Ratchet up logging a few notches prior to controlling w/ verbosity settings 2012-03-20 22:29:21 -04:00
Michael DeHaan
b5c62ec068 Enhance logging, way to gate verbosity levels pending. 2012-03-20 21:44:01 -04:00
Michael DeHaan
54b98effdf Add demonstration of only_if capability 2012-03-20 19:55:24 -04:00
Michael DeHaan
64471db94a Remove test from bottom of example that doesn't really make sense in the context of the example's use case. 2012-03-19 22:44:11 -04:00
Michael DeHaan
4de7bbb169 Allow conditional imports, see examples/playbook3.yml comments for a full explanation. Extensive
refactoring of playbooks now warranted, which we'll do before we move on.   This variable assignment
system makes nearly all possible magic possible, for we can use these variables however we like,
even as module names!
2012-03-19 22:42:31 -04:00
Michael DeHaan
b8eeb0f906 Add note about localhost/auth 2012-03-30 19:58:28 -04:00
Michael DeHaan
3d2a7ebd68 Added cobbler external inventory script, which is a demo of how external inventory
works in Ansible in general.
2012-03-30 19:56:22 -04:00
Michael DeHaan
f200a467e7 Update example to use correct state name 2012-03-15 23:11:09 -04:00
Michael DeHaan
f39944b89b Update example to use correct service state; minor pep8 indent/spacing fixes 2012-03-15 23:10:03 -04:00
Michael DeHaan
f681425453 Rename hosts file back since included by MANIFEST.in 2012-03-13 22:00:03 -04:00
Michael DeHaan
2e1b59a9d2 restructure the examples directory 2012-03-13 19:27:13 -04:00
Michael DeHaan
09a7119e74 Annotate more files, fix missing imports messing with playbooks. Hey Tim, please test your stuff :) 2012-03-13 19:19:54 -04:00
Michael DeHaan
238fffd6ef Annotated playbook example 2012-03-13 18:55:04 -04:00
Michael DeHaan
adf1492da2 Add external vars example 2012-03-12 22:03:20 -04:00
Michael DeHaan
e582bd5ec5 Add fire and forget example 2012-03-12 21:02:38 -04:00
Michael DeHaan
86e19cd8c8 This adds async poll support to playbooks. See examples. Some more testing due + docs
but this is more or less a mirror of what /bin/ansible does.  It also has a 'fire and
forget' mode if the poll interval is left off or set to 0.
2012-03-12 20:53:10 -04:00
Tim Bielawa
dce6074a81 Fixes for better RPM packaging
Spec file installs default example hosts files
Spec file marks the contents of /etc/ansible as %config(noreplace)

Example hosts file now with instructional comments
2012-03-10 16:19:33 -05:00
Michael DeHaan
8e20ed3714 src= parameters for template and copy operations can be relative to the playbook (for /usr/bin/ansible-playbook) or current directory (for /usr/bin/ansible) 2012-03-06 21:13:50 -05:00
Michael DeHaan
4ee4ddcd7c Parameterized include statements can see top level variables and also be passed specific variables!
Code needs cleanup, but works
2012-03-05 22:00:22 -05:00
Michael DeHaan
8d57ceecf1 Factoids and push variables via setup are now available to be templated in command args
as well as template files.  PLUS, variables are now expressed in playbooks without having
to know about the setup task, which means playbooks are simpler to read now.
2012-03-05 20:09:03 -05:00
Michael DeHaan
8d06c074b1 * Added uptime.py as an example of somewhat minimal API usage & reporting
* Pattern in API now has a default
* Fixed bug in template module operation detected from running playbook (tests for that pending)
* Workaround for multiprocessing lib being harmlessly squeaky (feeder thread got sentinel)
2012-04-04 10:27:24 -04:00
Michael DeHaan
1ed212513c Add user to playbook example so it's clear that this is available 2012-03-03 11:02:14 -05:00
Michael DeHaan
ab408b0000 Ability to import task lists and handler lists from a top level playbook file. It is possible
to use multiple import statements to implement 'class' like behavior, and also to share
a common list of handlers between multiple patterns.
2012-03-03 10:53:15 -05:00
Michael DeHaan
e4304a0ac5 Make sure tempdirs are cleaned up after execution steps, fix notifiers, make sure
service module is installed by setup.py
2012-03-02 22:38:55 -05:00
Michael DeHaan
5040c01640 rename 'pattern' to 'hosts' in playbook format. 2012-03-01 22:20:45 -05:00
Michael DeHaan
4ce1f1dd5e README/doc/example updates to go with group support and CLI option changes.
Minimizing manpage until CLI options stabilize.
2012-03-01 21:18:32 -05:00
Michael DeHaan
155c3ca89e update playbook docs with updated syntax / minor edits 2012-02-27 22:48:45 -05:00
Michael DeHaan
1caafb7bd9 Stop evaluating a host in a playbook when it encounters the first failure. 2012-02-27 22:28:01 -05:00
Michael DeHaan
ba4e36a9a9 Rename 'ensure' to 'state' because I think it's a bit cleaner and doesn't imply
all modules take a common parameter name.  But more or less we still work idempotently
in modules.
2012-02-26 22:31:42 -05:00
Michael DeHaan
5781e6e02f Merge pull request #32 from tbielawa/DocsFixin
Docs fixin
2012-02-26 18:44:14 -08:00
Tim Bielawa
6612772711 Update man pages. Fix formatting in playbook example. Also, YAML documents by definition start with '---', so I have added this to the example and the manpage 2012-02-26 21:09:56 -05:00
Michael DeHaan
f7cff27f3d Drastically simply playbook syntax 2012-02-26 20:54:51 -05:00
Michael DeHaan
78a254fc52 In playbooks, each pattern stanza can reference it's own user to run as, so you can
run things as multiple sets of users (if you want) in the same playbook.
2012-02-26 19:58:56 -05:00
Michael DeHaan
61d064d011 Fixed up KV munging in runner, misc fixes to copy, setup, and template modules 2012-02-26 19:55:26 -05:00
Michael DeHaan
e5f62f20b1 make copy & template module take key/value parameters so we're consistent. Only the command
module works differently now

starter manpage for modules

allow template file location to be passed into template & setup modules
2012-02-26 19:21:44 -05:00
Michael DeHaan
d308254eae A basic service module with 'ensure' idempotence semantics. Playbook updated to use service
module vs command module for restarting.  May be some bugs and requires the service to implement 'status' -- and probably some better error handling (i.e. return JSON with "failed" element if failed).

Improvements welcome.
2012-02-25 20:27:11 -05:00
Michael DeHaan
3c3111c1f3 Add optional hosts parameter to examples to show how we can
override the host file in a playbook to load different groups
of hosts.
2012-02-25 19:56:06 -05:00
Michael DeHaan
a5039eec62 Update reporting on playbook runs. 2012-02-25 15:21:11 -05:00
Michael DeHaan
79fdc1b6f4 Notifable handlers only run when something is changed. Awesome. 2012-02-25 14:42:41 -05:00
Michael DeHaan
ba9468266f Can it get an easier? Yes it can! Further simply playbook format. 2012-02-05 13:05:09 -05:00
Michael DeHaan
6d0fd2bfde Compress the playbook format for readability 2012-02-05 12:52:07 -05:00
Michael DeHaan
6cceaa5f6a Implment copy with an actual minion-side module such that we can get md5sum's and
onchange events like Puppet's file providers do.
2012-02-24 05:15:28 -05:00
Michael DeHaan
5d6b0280d5 Added stub for template execution, WIP. 2012-02-24 03:45:36 -05:00
Michael DeHaan
102385e4ad Added a setup module which can be used to place key-value JSON data
on the system for use in a later template module.   These values
could also be used for module-specific config.
2012-02-24 03:25:09 -05:00
Michael DeHaan
43f7dee247 Added rough sketch of what I want for playbook support. Debug heavy at the moment
as I figure out how logging/output might look.  A couple of major TODO features
also listed in the file.
2012-02-24 01:02:24 -05:00
Michael DeHaan
7730341d24 We don't have modules that list when things change just yet. I plan to handle
this by having a changed=True/False in the JSON for these modules.  Added a note
so folks won't think we can only execute shell :)
2012-02-23 23:54:16 -05:00
Michael DeHaan
381b3c971a Example for list of hosts syntax
TODO: add a command to auto-add a host, list hosts, etc
2012-02-23 14:20:28 -05:00