Commit graph

275 commits

Author SHA1 Message Date
cocoy
c844a2d072 Fix to skip /.ssh/config if don't exist rather than raise an error. 2012-04-23 14:32:57 +08:00
cocoy
645b7a2dff Add .ssh/config support 2012-04-23 09:48:42 +08:00
Michael DeHaan
533c2c6126 Make it possible to use facts from hosts in templates for other hosts.
It works like this:

{{ hostvars['127.0.0.1']['ansible_eth0']['ipv4']['address'] }}
2012-04-21 12:45:37 -04:00
Michael DeHaan
767282df2a Small style fixes for indentation and spacing. 2012-04-21 12:06:54 -04:00
Michael DeHaan
bed5da6086 Remove unused assignment 2012-04-21 12:03:29 -04:00
Michael DeHaan
ddc0342920 Unused import 2012-04-21 12:01:37 -04:00
Michael DeHaan
1e7b60b9a5 Unused import 2012-04-21 12:01:26 -04:00
Michael DeHaan
9d0f2a6e9b Unused import 2012-04-21 12:01:15 -04:00
Michael DeHaan
3081bb93f1 Use /var/tmp for root by default to avoid /tmp being mounted noexec, and segregate tmp files for other users
into their home directories.
2012-04-21 11:38:39 -04:00
Michael DeHaan
3d72260887 Make it such that modules with no arguments work fine in playbooks (like ping, which is
non-sensical, but also if the user wrote a module that took none)
2012-04-21 11:26:48 -04:00
Michael DeHaan
c6b8e1621d A better fix for slurp, expand path in the module. 2012-04-20 07:54:38 -04:00
Michael DeHaan
13ba31231e Fixup slurp module usage when not running as root, fix error handling path in slurp module. 2012-04-19 11:38:44 -04:00
Michael DeHaan
8a433ecb96 Merge branch 'align-vars-syntax' of https://github.com/jhoekx/ansible into jhoekx-align-vars-syntax 2012-04-19 09:15:48 -04:00
Jeroen Hoekx
cdb8213dcc Supported 'listed' vars in playbooks. 2012-04-19 09:40:17 +02:00
Jeroen Hoekx
903e4f6eae Support dicts in inventory vars. 2012-04-19 09:40:17 +02:00
Michael DeHaan
9cd492befe make all templating happen locally, so no jinja2 deps are ever required 2012-04-18 22:43:17 -04:00
Michael DeHaan
30d06dbcea Don't force down ansible facts back to setup, the setup module won't like parsing them on input and that
data is already there.
2012-04-18 22:23:33 -04:00
Michael DeHaan
5fa3d9b148 Teach playbooks to template locally to eliminate the need for Jinja2 on remote nodes.
You still need jinja2 if using /usr/bin/ansible vs /usr/bin/ansible-playbook though
this could change later by fetching the ansible file with a 'slurp' module.
2012-04-18 22:19:25 -04:00
Michael DeHaan
da0209dbc4 The fetch module really should preserve the whole directory structure being fetched to allow subsequent calls,
particularly in playbook, to recreate the host tree structure.  Making it thus.
2012-04-18 21:12:48 -04:00
Jeroen Hoekx
22ff8282a8 Template template module source. 2012-04-18 14:26:33 +02:00
Jeroen Hoekx
b678cf783c Template the source file of the copy module. 2012-04-18 11:40:15 +02:00
Michael DeHaan
de70277173 No need to save setup files to disk, this is what SETUP_CACHE effectively does. 2012-04-17 19:39:11 -04:00
Jeroen Hoekx
aa555b8b16 Inventory: AnsibleError is not global... 2012-04-17 15:29:59 +02:00
Michael DeHaan
da6cb1ca6e Less scrolling over constructor params now that documentation follows 2012-04-16 23:51:03 -04:00
Michael DeHaan
3f26a1c7f6 verbose option is not being used, so remove it. debug variable still exists. 2012-04-16 23:47:41 -04:00
Michael DeHaan
78b5cd64d0 Add pydoc for constructors. Some arguments can be trimmed as we plan to remove the need for them (like setup_cache and
maybe module_vars) with various pending refactoring.
2012-04-16 23:45:15 -04:00
Michael DeHaan
9ce27be878 Remove extra_vars tests 2012-04-16 23:03:04 -04:00
Michael DeHaan
35fdf6636b Allow --user for playbooks, no need for port setting as can specify in inventory file now. 2012-04-16 22:15:55 -04:00
Michael DeHaan
08468dcb0c Fixes to make ports DWIM. 2012-04-16 21:52:15 -04:00
Michael DeHaan
957867e088 Merge branch 'yaml-inventory' of https://github.com/jhoekx/ansible into jhoekx-yaml-inventory
Conflicts:
	lib/ansible/runner.py
2012-04-16 21:14:44 -04:00
Jeroen Hoekx
8c3206c99f Return a copy of the host variables. 2012-04-16 10:59:34 +02:00
Jeroen Hoekx
961ccdb2f4 List hosts in no group in the ungrouped group. 2012-04-16 10:55:08 +02:00
Jeroen Hoekx
3a24aa9a70 Add YAML inventory format.
See test/yaml_hosts for an example.

Hosts can be part of multiple groups.

Groups can also have variables, inherited by the hosts.
There is no variable scope, last variable seen wins.
2012-04-16 10:38:35 +02:00
Jeroen Hoekx
54f4526160 Export SSH port number as host variable. 2012-04-16 09:16:29 +02:00
Jeroen Hoekx
f04041b37d Ignore port numbers in simple inventory format 2012-04-16 09:16:29 +02:00
Jeroen Hoekx
746f1b92ae Reimplement the class method on Runner. 2012-04-16 09:16:29 +02:00
Jeroen Hoekx
c5cae87eca Refactor inventory code out of Runner.
This introduces the Inventory class.

Playbook uses the internals of Runner to limit the number of hosts to poll
asynchronously. To accomodate this, Inventory can be restricted to specific
hosts.
2012-04-16 09:16:28 +02:00
Michael DeHaan
d8f9d7c6c9 Use correct user to determine host files path, do not reuse .ansible
which is already taken for ansible management ops.
2012-04-14 16:08:04 -04:00
Michael DeHaan
3454fa9950 As part of the support for access to external nodes information, save fact data into /var/lib/ansible/setup_data
OR a per-user directory when running from playbooks.  Technically this info is also available via the SETUP_CACHE
but that is a bit more complex of a construct and it would be better to not cross the streams.
2012-04-14 11:58:08 -04:00
Michael DeHaan
31d4ee32d1 Looping! With items! See examples/playbook/loop_with_items.yml for details 2012-04-14 09:55:24 -04:00
Michael DeHaan
347637339c Merge remote branch 'public/integration' into integration 2012-04-13 19:33:57 -04:00
Michael DeHaan
c3cad50075 Update manpages, fix missing variable assignment 2012-04-13 19:33:19 -04:00
Michael DeHaan
f2465e0571 Add support for specifying sudo passwords to both ansible & playbook. Nopasswd sudo is no longer required. 2012-04-13 19:06:11 -04:00
Jeroen Hoekx
a975852f66 Module_arguments can be unicode. 2012-04-13 15:32:33 +02:00
Michael DeHaan
6b50078881 Add defaults to command help to avoid a certain class of user questions. 2012-04-12 21:30:49 -04:00
Michael DeHaan
6129574290 Include default value for connection in help. 2012-04-12 21:20:37 -04:00
Michael DeHaan
09a0b9bea8 If the module return is not parsed, always show stderr information even if -D (debug)
is not specified.  This will help for users that don't have prerequisites installed
(like python-simplejson on old RHEL) and do not know to run -D.
2012-04-12 21:18:09 -04:00
Stephen Fromm
0675f2511b Merge branch 'master' into localconnection
Merge the SortedOptParser bits and debug attribute commits into
localconnection.

Conflicts:
	bin/ansible
	lib/ansible/playbook.py
	lib/ansible/runner.py
	lib/ansible/utils.py
2012-04-12 11:18:35 -07:00
Michael DeHaan
08c593bee1 Warn if no hosts matched 2012-04-11 21:05:46 -04:00
Michael DeHaan
f3489a53cd English error messages if src and dest are left off the copy, template, or fetch modules 2012-04-11 20:57:41 -04:00