Commit Graph

90 Commits (8475a92dec781dfe75aab46b94be6795a44338b4)

Author SHA1 Message Date
Stoned Elipot 94ba0f740a Fix for issue #2916 : for each host promote the host variables as globally scoped variables for the sake of the groups determination 2013-05-16 18:57:05 +02:00
Michael DeHaan 05a4513a03 Merge branch 'group-by-global' of git://github.com/stoned/ansible into devel
Conflicts:
	lib/ansible/runner/action_plugins/group_by.py
2013-05-11 14:28:04 -04:00
Michael DeHaan ad777f6538 Fix contrib link. 2013-05-11 14:03:07 -04:00
Stoned Elipot 75100201a2 Allow globally scoped variables with group_by module's conditionals and key argument 2013-05-10 00:02:14 +02:00
Michael DeHaan 35e61d8f16 Merge pull request #2688 from dagwieers/module-global
New module 'set_fact' to define host facts
2013-04-22 21:16:46 -07:00
Dag Wieers b13beb3689 New module 'set_fact' to define host facts
This module allows you to set host facts (or export play variables to the playbook scope if you fancy that).

The module also accepts complex arguments.

```yaml
 - action: set_fact fact="something" global_fact="${local_var}"'
 - action: set_fact
   args:
      fact: something
      global_fact: ${local_var}
```
2013-04-18 23:06:58 +02:00
Dale Sedivec 515fd9e915 copy action plug-in check mode respects force=no
The copy action accepts force=no, which tells it not to replace an
existing file even if it differs from the source.  The copy action
plug-in wasn't respecting this option when operated in check mode, so it
would report that changes are necessary in check mode even though copy
would make no changes when run normally.

Runner._remote_md5 was changed to make the logic for setting rc perhaps
a little more clear, and to make sure that rc=0 when the file does not
exist.
2013-04-16 20:22:51 -04:00
Michael DeHaan 7037023aa8 Make debug print things nicer if {{ foo }} didn't interpolate 2013-04-12 15:02:54 -04:00
Michael DeHaan 85099be48f Merge pull request #2656 from dstoflet/first_available_file_fix
Quick fix for first_available_file and role support
2013-04-12 08:56:26 -07:00
Michael DeHaan 251f19263c Remove unneeded import. 2013-04-12 10:23:53 -04:00
Michael DeHaan 8457cf433d Update pause module to not use utils.template 2013-04-12 10:00:20 -04:00
Darryl Stoflet c63207bf75 Quick fix for first_available_file and roles 2013-04-11 20:40:23 -07:00
Michael DeHaan a6777f7e7c Fix template call in group_by module. 2013-04-11 12:43:02 -04:00
Michael DeHaan 81a926547c Some continued work on new-style templates and associated test code changes. Legacy template functions
are marked with "legacy_" for possible future removal.
2013-04-10 19:09:57 -04:00
Michael DeHaan b09ef21ec9 Add code to flag legacy templating like $foo.{bar} as deprecated in favor of Jinja2 {{ foo.bar }} so we
can remove the legacy system at a later date.
2013-04-10 17:52:35 -04:00
Michael DeHaan 892484812e Much requested feature -- allows relative imports of content within roles or relative to any task or handler include (../templates for template ../files for copy) 2013-04-06 12:13:04 -04:00
Michael DeHaan cdaa2085ee Preliminary ability to use Jinja2 {{ }} to replace ${foo.bar} in playbooks. Can't use both at the same time per line. 2013-04-03 01:04:16 -04:00
Michael DeHaan 3c5890f42b Ensure that when transferring a file to a directory the name of the file is the correct basename and not 'source'. 2013-03-25 22:19:35 -04:00
Michael DeHaan e304cc3d8e Simple fix for spaces in filenames with the template module. 2013-03-11 17:13:59 -04:00
Michael DeHaan 6e2ea327d1 A very simple fix to enable spaces in the files sent via the copy module. 2013-03-11 17:11:53 -04:00
Michael DeHaan f2c8df2a93 Clarify an error message 2013-03-17 23:33:13 -04:00
Patrick Pelletier c7c7a63ee5 Add support to directly set content in copy module 2013-03-17 23:33:13 -04:00
Michael DeHaan b2c8ed9cc2 Merge pull request #2279 from dorfsmay/fetch-fail_on_missing
Added a fail_on_missing option to fetch.
2013-03-10 16:18:28 -07:00
Daniel Hokka Zakrisson 76f3351b02 Move complex_args templating to be with module_args
Keeps every action plugin from having to do the same thing.
2013-03-07 11:09:29 +01:00
Michael DeHaan ffbd4b5a2c Template options sooner on complex args copy 2013-03-07 00:35:40 -05:00
Michael DeHaan 2bb305f6d5 Fix args templating for complex args with the copy module. 2013-03-07 00:28:06 -05:00
Michael DeHaan fe8547cac0 Ensure template arguments if complex are still properly templated 2013-03-07 00:04:48 -05:00
Yves Dorfsman e45a0fd61d Added a fail_on_missing option to fetch. 2013-03-02 11:04:48 -07:00
Michael DeHaan 6ad390a92b Revert "Revert "for #2196 now gruopby module invalidates host cached variables so they can be reevaluated with new groups""
This reverts commit dc0515a88a.

We didn't need to revert this :)
2013-03-02 10:38:51 -05:00
Daniel Hokka Zakrisson 5d82b4b1b7 group_by needs the untemplated module_args 2013-03-02 16:30:30 +01:00
Michael DeHaan dc0515a88a Revert "for #2196 now gruopby module invalidates host cached variables so they can be reevaluated with new groups"
This reverts commit 2d86671aa5.
2013-03-02 10:21:36 -05:00
Daniel Hokka Zakrisson 43ce2caa4f Fix parse_kv invocation in group_by to use imported name
Fixes #2277.
2013-03-02 15:18:16 +01:00
Michael DeHaan b6f7a22de5 Merge pull request #2261 from bcoca/groupby_2186
now group by module invalidates host cached variables
2013-03-01 15:16:47 -08:00
Brian Coca 2d86671aa5 for #2196 now gruopby module invalidates host cached variables so they can be reevaluated with new groups
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
2013-03-01 18:00:34 -05:00
Daniel Hokka Zakrisson ae8d6ac303 Ensure complex_args is considered in all action_plugins 2013-02-28 14:27:42 +01:00
Stoned Elipot 8816dc7ca7 Make diff header lines more explicit about what the diff is about
This gives a more readable output when producing diff for a task
with multiple items (with_items).
2013-02-26 16:53:59 +01:00
Stoned Elipot 1b8c9bab35 Fix diff when template destination is absent 2013-02-26 16:45:56 +01:00
Stoned Elipot 10e9f1fc1e Implement --diff for the copy module. 2013-02-25 23:32:52 +01:00
Michael DeHaan 6d604469d8 Always adjust file attributes with the template module. 2013-02-20 08:05:59 -05:00
Michael DeHaan ab389d8908 For consistency, add host should take a key named 'name' in addition to 'hostname'. 2013-02-17 20:45:37 -05:00
Michael DeHaan 9cf66f4376 Fixes from 'make pep8'. Partial, more to come. 2013-02-17 19:40:38 -05:00
Kavin Kankeshwar 359ac9a495 Fixing syntax error
running install_lib
byte-compiling /usr/lib/python2.6/site-packages/ansible/runner/action_plugins/add_host.py to add_host.pyc
SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/ansible/runner/action_plugins/add_host.py', 37, 92, '    def run(self, conn, tmp, module_name, module_args, inject, complex_args=None, **kwargs)\n'))
2013-02-17 15:35:58 -08:00
Michael DeHaan 1ecf4a6943 Working on complex argument support. 2013-02-17 15:01:49 -05:00
Michael DeHaan b365e04616 Allow add_host to add hosts to multiple groups, groups is now an alias for groupname. 2013-02-17 11:22:50 -05:00
Rob Parrott ef17fc9f20 add the ability to take variables in the add_host module, and be willing to parse a host:port hostname handed to add_host 2013-02-16 20:27:38 -05:00
Daniel Hokka Zakrisson 7e2999ed2d Add directory detection to _remote_md5 and use this in copy
If it is a directory, change the destination path by appending the
basename of the source file, like is done if the destination ends with a
/, and try to get the MD5 of the new path.
2013-02-12 22:39:05 +01:00
Michael DeHaan 72a05ae2a0 Move diff code more into runner code. 2013-02-09 23:24:03 -05:00
Matt Cordial 2ccfc8d2b6 Fix Issue #2025 where templates were not being transfered. 2013-02-08 12:03:54 -07:00
Michael DeHaan a9162a86f2 Very basic --diff option for showing what happens when templates change.
Probably output is not useful if not used with --limit

Works well with --check mode
2013-02-07 22:52:25 -05:00
Daniel Hokka Zakrisson 1becc665b2 Fix missing ) in add_host
Fixes #1980.
2013-02-04 12:21:33 +01:00