Commit Graph

140 Commits (ec56b30248899c80c16d90111a61e1f4806d4c25)

Author SHA1 Message Date
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 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 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 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
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 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 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 347637339c Merge remote branch 'public/integration' into integration 2012-04-13 19:33:57 -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 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
Michael DeHaan 95e045d153 Remove remote logging as we're going to move this logging to the modules for performance reasons. 2012-04-11 20:15:17 -04:00
Michael DeHaan 245aa9bf8e Some tweaks to the fetch module. 'err' return was for stderr, so that should be empty string.
Some minor code shortening.  Added a test to TestRunner.
2012-04-11 20:12:01 -04:00
Michael DeHaan 62224271e9 Merge pull request #131 from mgwilliams/feature-fetch-module
Fetch Module
2012-04-11 16:55:51 -07:00
Matthew Williams 31d3f52b28 fetch to host specific directory 2012-04-11 09:14:36 -07:00
Matthew Williams 611e3fec4c fetch 'module' -- working with paramiko and local connections 2012-04-10 20:23:25 -07:00
Michael DeHaan 1d75a29ec9 Allow variables coming in from the playbook and the API to be expressed as dictionaries throughout their full life cycle
such that nested data can be made available in templates and playbooks.
2012-04-10 20:58:40 -04:00
Stephen Fromm b5061bb62e Verify that effective uid == remote_user when transport is local
Raise exception if effective uid of process is not the same as
remote_user.
2012-04-10 16:27:19 -07:00
Stephen Fromm 5d74fedeb9 Update Runner to default to C.DEFAULT_TRANSPORT
This also uses self.transport when instantiating Connection object.
2012-04-10 16:17:39 -07:00
Jeroen Hoekx ab86726a15 Introduce per task variables and push them to templates. 2012-04-04 13:39:03 +02:00
Jeroen Hoekx edd5baad8b Refactor _transfer_argsfile to generic string transfer function. 2012-04-04 13:36:21 +02:00
Michael DeHaan 09e690fd7c Indentation error causing forks to not be parallel. Ahem :) 2012-04-03 20:20:55 -04:00
Michael DeHaan e5d5b072db Merge remote branch 'public/integration' 2012-04-02 20:02:46 -04:00
Matthew Williams 461a4e78c2 raise error if executable host file execution fails 2012-04-02 15:00:28 -07:00
Seth Vidal 04aecdcf34 before we run the actual module/command - emit what that would be to the logs 2012-04-02 13:29:12 -04:00
Jeroen Hoekx 74ae4b29ad Add a debug attribute to Runner/Playbook.
This prints the stderr of the executed modules on local stderr.
Most methods on Runner now return a fourth "err" parameter.
2012-03-31 09:32:13 +02:00
Michael DeHaan 3ded27fe35 Treat module args as strings everywhere to avoid unneccessary shlex and requoting 2012-03-30 22:47:58 -04:00
Michael DeHaan f11de2f5c9 --extra-vars option for ansible-playbook
Conflicts:

	lib/ansible/playbook.py

Removed unneccessary shlex and replaced with basic split, some repurcussions in runner
that can be eliminated once we consistently pass args as a string (soon).
2012-03-30 22:29:06 -04:00
Michael DeHaan 2372a3b734 Sudo support operational in both playbooks and main program. Implementation could use some cleanup. 2012-03-29 22:59:29 -04:00