Commit Graph

59 Commits (80bebc1806c036553cc39d2c072b132265f6f5fa)

Author SHA1 Message Date
Les Aker 1179d1bbd8 corrected indentation 2013-05-19 12:25:19 -04:00
Les Aker 2adc335481 ignore unicode errors in stdout 2013-05-19 11:57:08 -04:00
Michael DeHaan f2a8c0d612 Fix listification inside of with_items so it runs more intelligently. 2013-05-13 21:31:45 -04:00
Michael DeHaan 0a1657080b Indentation fix 2013-05-11 17:23:45 -04:00
Michael DeHaan 6fdfbb1a34 Improve variable smushing so it only has to be done in one place. This is related to shlex.split being called
on untemplated variables in some rare cases.
2013-04-24 22:00:40 -04:00
Michael DeHaan be947e5266 Resolve merge conflict 2013-04-22 23:57:20 -04:00
Michael DeHaan e12f91799c Allow args: var to be used to pass a variable in bare, and also templated versions should also DWIM. 2013-04-22 22:17:55 -04:00
Bernhard Weitzhofer fb0a99e5d8 Fix if-statement that always evaluates True 2013-04-17 19:40:06 +02:00
Michael DeHaan 7c6341718e Merge branch 'combine_vars' of git://github.com/laggyluke/ansible into exp
Conflicts:
	lib/ansible/inventory/vars_plugins/group_vars.py
	lib/ansible/runner/__init__.py
	lib/ansible/utils/__init__.py
	test/TestPlayBook.py
2013-04-16 20:06:06 -04:00
Michael DeHaan b54e955595 Remove a debug statement. 2013-04-16 19:09:12 -04:00
Michael DeHaan 86d47bce5f Make more lookup plugins tolerant of new variable system, with a little better 'do what I mean' logic to resolving
what happens if you get a string back as a template result.
2013-04-16 19:07:19 -04:00
Michael DeHaan c0f8af5202 Make more lookup plugins happy with newstyle variables. Not quite done, but this fixes up with_items/with_nested/file/fileglob. 2013-04-16 18:50:30 -04:00
Michael DeHaan 793a3d3f76 More 1.2 templating development; for legacy when_string constructs don't quote the 'in' operator 2013-04-12 13:29:49 -04:00
Michael DeHaan a05361f515 This is a fix on top of the 'airplane variable upgrade' commits that fixes legacy when_string so it evaluates correctly in the new eval construct. 2013-04-11 17:20:40 -04:00
Michael DeHaan 5b2035edd9 Changes for 'make pep8' 2013-04-10 19:12:10 -04:00
Michael DeHaan f0b21dcc0f allow references to names of variables in with_items without needing to surround them with Jinja2 '{{' delimeters 2013-04-10 18:42:54 -04:00
Michael DeHaan d7206d84bb Allows Jinja2 that starts a YAML line to not cause a syntax error.
Technically this isn't quite valid YAML when this happens, so we make it valid.  This means that if a future commander
API allows save/load it should make sure it does similar processing.
2013-04-10 18:07:19 -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 29209c4913 Style fixes so "make pep8" is clean. 2013-04-10 16:37:49 -04:00
Michael DeHaan 0113951580 Enable usage of when_set within new eval system. 2013-04-10 16:26:59 -04:00
Michael DeHaan a83e10d77d Use safe_eval vs eval. 2013-04-10 16:17:24 -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
George Miroshnykov 6826aa7360 Tweaked merge_hash to also affect Runner behavior 2013-04-06 13:06:38 +03:00
Michael DeHaan f585c4cde7 Upgraded variable support met with upgraded conditional support, see examples/playbooks/upgraded_vars.yml
for details!
2013-04-05 19:10:32 -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 7ac5e462ef Fixed a small buglet, if using with_items with yum and so on, only optimize the package list if the package list is all strings 2013-03-01 18:32:32 -05:00
Daniel Hokka Zakrisson cedfec763a jsonify needs to return a string of {}, rather than a dict 2013-02-27 19:46:31 +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 10e9f1fc1e Implement --diff for the copy module. 2013-02-25 23:32:52 +01:00
Michael DeHaan a9ea3136cf Use yaml.safe_load as we are just using basic data structures 2013-02-23 13:33:21 -05:00
Stoned Elipot 9f2bba01ba Fix diff output vertical spacing 2013-02-20 22:45:45 +01:00
Michael DeHaan 61d01f549f Show a nicer message when attempting to diff unicode files. 2013-02-17 19:32:28 -05:00
Michael DeHaan 1ecf4a6943 Working on complex argument support. 2013-02-17 15:01:49 -05:00
Daniel Hokka Zakrisson d632210941 Allow using other users' home directories as well 2013-02-11 23:43:30 +01:00
Michael DeHaan c692de6b80 Cleanup YAML parse error warning code a tiny amount. 2013-02-09 14:30:19 -05: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 70d5dad726 Also catch NameErrors which would indicate missing quotes 2013-02-07 11:56:59 +01:00
Rune Kaagaard 7a8b27f716 Fixing bug with unicode templates.
The utils.md5s() function would break when calculating checksums
for non-ascii characters. Convert to utf-8 first.
2013-02-05 14:49:59 +01:00
Daniel Hokka Zakrisson c1b63d1500 Fix for when conditional is a simple bool already
Fixes #1983.
2013-02-04 20:12:53 +01:00
Michael DeHaan fed82c2188 This implements a basic --check mode which for now is only implemented on template & copy operations. More detail will be shared with the list
shortly.
2013-02-03 20:34:13 -05:00
Daniel Hokka Zakrisson 5268d49bad Add sudo_flags configuration option to alter sudo behaviour
Default to -H to set $HOME appropriately.
2013-01-28 17:41:43 +01:00
Michel Blanc 8eb7d740b0 Fixes hash merging
No need for deep copy (vars are essentially immutable once loaded, there
should not be any modifications)
2013-01-24 00:53:12 +01:00
Michel Blanc e28e538c6e Adds user-selectable hash merging support in vars
Hash variables are currently overriden if they are redefined. This
doesn't let the user refine hash entries or overriding selected keys,
which can, for some, be a desirable feature.
This patch let the user force hash merging by setting the
hash_behaviour value to "merge" (without the quotes) in ansible.cfg

However, by default, ansible behaves like it always did and if any value
besides "merge" is used ("replace" is suggested in the example ansible.cfg
file), it will also behave as always.
2013-01-23 21:39:34 +01:00
Daniel Hokka Zakrisson a16ddb57c1 Default module search path is included already
Adding it to runner's module_path makes it override local modules.
2013-01-22 15:42:49 +01:00
Michael DeHaan 35c7ebf7a4 Revert "Update lib/ansible/utils/__init__.py"
Reported hanging of no-password sudo in some cases.  Need to explore.

This reverts commit 87f6739e20.

Conflicts:

	lib/ansible/utils/__init__.py
2013-01-20 09:05:07 -05:00
ron1 280660b8a7 Support sudo alternatives that offer sudo-compatible interfaces 2013-01-19 08:40:32 -05:00
Michael DeHaan c8fc353bc3 Merge pull request #1811 from fdavis/devel
add when_{failed,changed}, and extended when_{set,unset}
2013-01-18 15:18:00 -08:00
Michel Blanc 87f6739e20 Update lib/ansible/utils/__init__.py
Adds -i to  make_sudo_cmd so target user's environment gets loaded when configurationslike this are used :


    - hosts: ubuntu 
      name: Install ruby for the configured ruby user 
      sudo: True 
      sudo_user: rubyuser 
      # should be ${ruby_user}, but can't for now because of #1665 
      tasks: 
      - name: Gets current ruby version 
        action: shell rbenv version 
        register: ruby_current_version
2013-01-18 16:03:50 +01:00
Daniel Hokka Zakrisson 7ecab22302 Move sudo command making to one common function 2013-01-13 15:16:13 +01:00
Daniel Hokka Zakrisson 7782923ea2 Revert #1818 but avoid double-dwim, fixing relative fileglob 2013-01-09 14:52:52 +01:00