Commit Graph

153 Commits (37b91c7b81b09cf768d538936a9063bb70c8e7a6)

Author SHA1 Message Date
Michael DeHaan 9006d4557d Added code to allow insertion of boilerplate into modules to make them able to share lots of code, the result
should be a huge reduction of total ansible source, at a slight cost of difficulty in original module development.

We need to apply this now to all modules, but may need to have some exemptions to things like command, which should
subclass this module.
2012-07-17 22:34:52 -04:00
Michael DeHaan 8bb8314d10 Inject vars need to pushed further up to make with_items work as desired. 2012-07-17 20:09:18 -04:00
Dave Hatton 72ca9e58e7 meaningful messages if the remote md5 fails 2012-07-17 09:14:16 +01:00
Michael DeHaan 0edd0d4736 Fixing template calls 2012-07-16 20:26:39 -04:00
Michael DeHaan 5f69c557b9 Fix for the way host variables were being swallowed, plus some overall simplification. Deciding what
dictionary to use for templating now happens in exactly one place (executor_internal) and the "inject"
dictionary is passed to what needs it.
2012-07-15 14:19:11 -04:00
Dave Hatton c3205595b3 format fixes to make fetch more usable 2012-07-16 11:43:37 +01:00
Michael DeHaan 80edea2934 with_items handling code should apply to all modules, was screwed up in refactoring to only apply to 'normal'
modules.
2012-07-15 12:51:56 -04:00
Michael DeHaan 1754de3335 Misc code cleanup, mostly whitespace preferences, removing unused imports, plus a few fixes here and there. 2012-07-15 12:29:53 -04:00
Michael DeHaan 4b73931351 misc code cleanup, don't pass parameters to the connection object we can already get from Runner 2012-07-15 11:54:39 -04:00
Michael DeHaan 1d8bb17785 misc code cleanup 2012-07-15 10:57:22 -04:00
Michael DeHaan 5a63a48e6b No need to feed variables into the setup module for preservation since the file is no longer saved to disk. 2012-07-15 10:24:38 -04:00
Michael DeHaan 227c500ad7 Misc cleanup/formatting 2012-07-15 10:22:15 -04:00
Michael DeHaan 867b2437cc consolidate output code in callbacks.py, from utils, remove extra functions 2012-07-15 10:12:49 -04:00
Michael DeHaan cb55cd6f8d removed unused function 2012-07-15 09:33:22 -04:00
Michael DeHaan 68a9adc1be Indentation cleanup (partial) 2012-07-15 09:32:47 -04:00
Michael DeHaan 244b923559 No longer need to calculate setup metadata location since we don't write
the setup file to disk.
2012-07-15 09:25:17 -04:00
Michael DeHaan 64c51ade1e Change the way we do with_items to make them happen next to each other in runner, which eliminates the problem of with_items and vars_files sometimes not playing nice with each other.
(Also a fix for the user module error handling when the user
is not present at the time of the return.  This can only really be caused by multiple ansible executions).
2012-07-14 19:18:33 -04:00
Michael DeHaan 931f9f1a61 Setup module no longer saves to disk, as templates are mostly useful in playbooks and this allows lots of simplifications
around file pathing and removes occasional permissions conflicts depending on how things are used.
2012-07-14 11:59:12 -04:00
Dave Hatton 55694db7c3 switch to hashlib.md5 or md5 instead of OS md5 commands 2012-07-09 08:52:00 +01:00
Michael DeHaan 0d28466b22 When sudo'ing to root, keep the setup file location as /etc/ansible/setup 2012-07-07 09:29:03 -04:00
Michael DeHaan c2b8fabf66 Take a remote md5sum before a file transfer to decide whether to transfer the file or not.
Allows for efficient transfer of large files.  Templates do not sample first because they are small.
2012-07-07 09:10:18 -04:00
Michael DeHaan 8220d57690 Clean up md5 functions + make the fetch module stay happy if the remote file does not exist. 2012-07-07 08:47:32 -04:00
Michael DeHaan e3aba7770f Merge pull request #518 from brainpage/devel
adds 'groups' variable, essentially making hosts file accessible as a var
2012-07-04 11:28:46 -07:00
alex f72b1f4fd7 Fixed: pathname for tmp 2012-07-02 22:04:56 +02:00
alex bbf2939063 Fixed: executing templates outside playbooks 2012-07-02 21:34:11 +02:00
Jonathan Palley cedbcfcc0a adds 'groups' variable, essentially making hosts file accessible as a variable 2012-07-01 15:04:53 +08:00
Michael DeHaan efac68b636 Remove the -D module debug flag, which no longer is functional due to sudo pty requirements, and replace with -v/--verbose.
This flag will show playbook output from non-failing commands.  -v is also added to /usr/bin/ansible, but not  yet used.

I also gutted some internals code dealing with 'invocations' which allowed the callback to know what module invoked
it.  This is not something 0.5 does or needed, so callbacks have been simplified.
2012-06-19 21:57:43 -04:00
Daniel Hokka Zakrisson f5ecd075f7 Remove unnecessary parse_json invocation 2012-06-20 14:54:36 +02:00
Michael DeHaan bd653c8f3c Merge pull request #488 from dhozac/jinja2-env
Create a Jinja2 environment allowing includes
2012-06-19 13:09:02 -07:00
Seth Vidal 1ec518543e make Runner options conflict errors raise AnsibleErrors not traceback in general
add catch if -c ssh and -k are passed at the same time since the ssh connection type doesn't
support passwords
2012-06-18 15:48:19 -04:00
Daniel Hokka Zakrisson 9f93839d13 Create a Jinja2 environment allowing includes 2012-06-17 22:18:08 +02:00
Daniel Hokka Zakrisson 13b814a33c Run templating function until the text doesn't change
This allows variables to contain other variables.
2012-06-16 12:51:19 +02:00
Jonte Norman 1b091a7e3e Fixed typo from results to result in _execute_raw method 2012-06-15 22:45:47 +02:00
Fred Alger 834f6a216d Make shell outs to md5sum work on FreeBSD and OS X
Tested with OS X local connection and Linux remote. The paths to the
md5sum and md5 commands are hardcoded to the most common location. This
will definitely fail if the commands are elsewhere, or if the md5
command doesn't support the -q 'quiet' option.
2012-06-15 00:04:01 -04:00
Michael DeHaan 2a8d1f07d4 Merge branch 'mktemp-vanish' of https://github.com/dagwieers/ansible into devel
Conflicts:
	lib/ansible/runner/__init__.py
2012-06-13 22:39:58 -04:00
Michael DeHaan 2a49438c37 Merge pull request #461 from dhozac/only_if-early
Evaluate only_if early
2012-06-13 19:19:25 -07:00
Stephen Fromm 9cf182c225 Add assemble module
This adds a module that concatenates (ie. assembles) a file from
fragments in a directory in alphabetical order.  It chains the file
module afterward to fix up ownership and permission.  This also adds
tests for the assemble module with fragments in assemble.d.
2012-06-11 23:09:54 -07:00
Daniel Hokka Zakrisson 7942570411 Fix on_unreachable invocation with non-existing variable 2012-06-11 15:15:29 +02:00
Daniel Hokka Zakrisson eba81ee36f Evaluate only_if early to do as little work as possible 2012-06-11 15:15:29 +02:00
Matt Goodall c1b38f62c8 Search multiple paths for modules.
Minimal change to allow a list of paths (separated by the typical path
separator) to be searched in sequence for the named module.
2012-06-10 16:22:59 +01:00
Michael DeHaan 01387520e9 Merge pull request #451 from phred/fix-fetch-module
Make 'fetch' test for local directories before creating.  Fixes issue #450
2012-06-08 12:06:02 -07:00
Michael DeHaan e265cdfa1d Merge pull request #454 from jhoekx/configure-python-interpreter
Introduce ansible_python_interpreter variable.
2012-06-08 12:03:40 -07:00
Daniel Hokka Zakrisson d0d036fd3f Expand $item for copy and fetch 2012-06-08 01:36:52 +02:00
Jeroen Hoekx 1f63c47738 Introduce ansible_python_interpreter variable.
This allows configuration of the correct python interpreter on the managed system.
2012-06-07 09:50:38 +02:00
Dag Wieërs b3b22c41e9 Get rid of mktemp dependency to support AIX
The function call has been renamed to better reflect what it does, and we
reduced the number of calls from two to one in case the remote user is not
root.

This patch also fixes a string concatenation in _copy_module() that
should use os.path.join() instead.

This closes #436
2012-06-06 14:47:47 +02:00
Fred Alger bee04de26a Fix exception in fetch module when src or dest parameter omitted. 2012-06-05 11:35:19 -04:00
Fred Alger d0c4f4015c Fix remote md5 in fetch module, related to Issue #450 2012-06-05 11:35:19 -04:00
Fred Alger 51b460e8c6 Make 'fetch' test for local directories before creating. Fixes issue #450 2012-06-05 10:38:12 -04:00
Michael DeHaan 16f0d7b333 Revert "Get rid of mktemp dependency to support AIX"
This reverts commit 4ad1b57b52d735393f6c6bcbd5524b947134fbf9.
2012-05-31 21:59:31 -04:00
Michael DeHaan 99430fa0a3 Fix for older version of sudo + some changes to imports so tests are happy 2012-05-31 21:44:56 -04:00
Dag Wieers a8fd6ee9c3 Get rid of mktemp dependency to support AIX
The function call has been renamed to better reflect what it does, and we
reduced the number of calls from two to one in case the remote user is not
root.

This patch also fixes a string concatenation in _copy_module() that
should use os.path.join()

This closes #436
2012-05-31 17:02:10 +02:00
Michael DeHaan ecb944892d Tweaks on previous refactoring of playbook, version bump a 0.4 reference, remove some debug, etc 2012-05-26 01:20:53 -04:00
Michael DeHaan cf9ddf3a30 Reorganizing file structure. Not done. 2012-05-25 19:34:13 -04:00