Commit Graph

1686 Commits (d3a97bfb078c4393142b24d4d2aa3c699bfc94c2)

Author SHA1 Message Date
Michael DeHaan 2123507315 Merge branch 'sha256' of git://github.com/jlund/ansible into devel
Conflicts:
	library/network/get_url
12 years ago
Michael DeHaan 92754065bf Remove debug statement. 12 years ago
Michael DeHaan 5a504e3a3b Tweak error messages for undefined variables feature. 12 years ago
Michael DeHaan 637983cf31 cleanup example config file + Squashed commit of the following:
commit c36b66dc952dfff91043ecbca56cf3f1f8f00703
Merge: 240d7bf f4cf934
Author: Michael DeHaan <michael@ansibleworks.com>
Date:   Tue Jun 18 13:04:51 2013 -0400

    Merge branch 'unevaluated-vars' of git://github.com/lorin/ansible into lorin_undefined

    Conflicts:
    	lib/ansible/runner/__init__.py

commit f4cf934367
Merge: 2531440 07a1365
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Thu Jun 6 11:07:41 2013 -0400

    Merge branch 'devel' into unevaluated-vars

commit 253144045c
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Thu Jun 6 11:06:37 2013 -0400

    Fail template from file on undefined vars

    If config option is set, raise an exception if templating from a
    file and a variable is undefined.

commit aecb71d8b7
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Wed Jun 5 17:12:12 2013 -0400

    Add fail_on_undefined flag

    Add a fail_on_undefined flag to the template and template_from_string methods.

    If this flag is true, then re-raise the ninja2.excpetions.UndefinedError instead of
    swallowing it.

commit cbb1808f05
Merge: d4bbf49 41425fb
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Wed Jun 5 16:14:12 2013 -0400

    Merge branch 'devel' into unevaluated-vars

commit d4bbf492b0
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Mon Jun 3 19:46:13 2013 -0400

    template: Raise UndefinedError exception

    In template_from_string, raise an undefined error if it occurs.

    Have the caller catch it and throw an AnsibleUndefinedVariable

commit c947802805
Merge: 8d919d6 be33bcf
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Mon Jun 3 10:09:43 2013 -0400

    Merge branch 'devel' into unevaluated-vars

commit 8d919d6c97
Merge: 0f68ad8 b8630d2
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Thu May 30 16:27:48 2013 -0400

    Merge branch 'devel' into unevaluated-vars

commit 0f68ad8193
Author: Lorin Hochstein <lorin@nimbisservices.com>
Date:   Thu May 30 14:32:03 2013 -0400

    Optionally fail task on undefined variables

    This patch introduces a new configuration option called
    error_on_undefined_vars, which defaults to false.

    If this option is set to true, then a task which has unevaluated
    variables in its arguments will fail instead of running. Output looks
    like this:

        TASK: [set rabbitmq password] *************************************************
        fatal: [10.20.0.7] => Undefined variables: rabbitmq_user, rabbitmq_password
12 years ago
Gilles Cornu 48fe7ac19d Enlarge scope of 'ansible_ssh_user' magic variable
Allow to use ansible_ssh_user variable in `sudo_user` or `when` clauses
12 years ago
Scott Sturdivant b10b676158 Print the default value if one is provided. 12 years ago
Michael DeHaan e128e8b563 Merge pull request #3162 from strawlab/apt-key-binary-fix
allow apt-key module to work with binary key
12 years ago
Michael DeHaan aa340c1508 Merge pull request #3169 from Debilski/fix-duplicate-host-reads
Allow inventory to be read from a pipe
12 years ago
Michael DeHaan 70a9be27f6 Merge pull request #3217 from dagolden/topic/late-sudo_user
Expand sudo_user after variable merging
12 years ago
Michael DeHaan d9f91be34a Merge pull request #3227 from bcoca/modules_wantlist
implementing with_items list globbing made easier for modules
12 years ago
trbs a4223e119d fixed x-bits in git 12 years ago
Brian Coca 4942a06bc2 now modules can implement with_items list globbing w/o updating
hardcoded lists in ansible code, just add WITH_ITEMS_USES_LIST in a
comment anywhere, and of course, support recieving params as list.

Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
12 years ago
David Golden d65f45f0b2 Expand sudo_user after variable merging
Previous commit c3659741 expanded sudo_user during task construction,
but this is too early as it does not pick up variables set during
the play.

This commit moves sudo_user expansion to the runner after variables
have been merged.
12 years ago
Serge van Ginderachter 2a7f9df109 add support for callback_plugins/ relative to playbook 12 years ago
Michael DeHaan 404b082d82 Version bump and assorted things to start new development version. 12 years ago
Michael DeHaan 3d21dab705 Small fix so template plugins can see inject variables. 12 years ago
Rike-Benjamin Schuppner 71afb9e432 Use with guard for file reads. 12 years ago
Rike-Benjamin Schuppner deaf499ba1 Remove duplicate host file reads by removing a legacy check.
This allows using a form such as

    ansible -i <( arbitrary command ) all -m ping
12 years ago
Andrew Straw 94e66ef558 allow apt-key module to work with binary key 12 years ago
Chris Church d1de7839d7 Renamed on_no_hosts_matched/on_no_hosts_remaining to correct names in noop callback, added methods to callback plugin examples. 12 years ago
Chris Church 3f17a39238 Set current play/task to None for callback context when finished running the current play/task. 12 years ago
bennojoy 017e7f24ed bug fix for #3077, environment settings for script 12 years ago
Joshua Lund 2ce7f136b2 * Added a sha256 method to module_common
* Added a sha256sum parameter to the get_url module to enable
cryptographic verification of downloaded files
* Fixed a few typos in the documentation
12 years ago
Chris Jacobs 588d4080df don't want to ignore explicit cwd 12 years ago
Chris Jacobs 69db160e2f Skip dotfile in hosts dirs 12 years ago
Serge van Ginderachter f1cf81b086 optimization when adding child groups 12 years ago
Peter Hudec e8ff3c43ad fixed first_available_file and roles support
for copy and template action
12 years ago
Steven Dossett e0a15d0c50 Updated to support inventory options from command line 12 years ago
Michael DeHaan c52abd40b0 Fix for the directory inventory source where depth information on the group was being discarded
due to initial copy.  New model will reuse the first object and copy attributes on the second.
12 years ago
Michael DeHaan be33bcf16f Merge pull request #3105 from shirou/devel
fix utf-8 named task failed with --step.
12 years ago
Michael DeHaan 3783dc42d4 normalize path 12 years ago
WAKAYAMA Shirou 66247042a5 fix utf-8 named task failed with --step. 12 years ago
Darryl Stoflet c0baf10845 Support for all:vars in script inventories 12 years ago
Michael DeHaan 3b77d17a26 Spelling fix. 12 years ago
Michael DeHaan 1f7c197a9d os.path.dirname returns '' not None in some cases, handle this so inventory can be specified with ./ 12 years ago
Michael DeHaan 4a93c247bd Another lookup plugin relative path tweak. 12 years ago
Michael DeHaan b8a66ce5bb Lookup plugins in included files now look in paths relative to their files, allowing role usage. 12 years ago
Michael DeHaan c4a125e6d9 Add ability to use |success and |failed as Jinja2 filters.
Example:

when: registered_variable|failed
12 years ago
Michael DeHaan 4840e59b90 Allow cowsay to be removed mid playbook run. 12 years ago
Steven Dossett 1ff93e6b08 Plugin with_inventory_hostnames - loops generated from groups or
hosts in inventory
12 years ago
Michael DeHaan 6cd3ba5b06 Allow the group_vars and host_vars directories to be stored alongside the playbook as well as inventory. 12 years ago
node a58baae2c4 Make the actual user used for executing play available as 'ansible_ssh_user' variable 12 years ago
Pol Llovet 4432c01ceb Handle '#' in var strings by splitting on ' #'
If someone has a " #" in a quoted var string, it
will interpret that as a comment and refuse to
load the inventory file due to an unbalanced
quote. Noisy failure > unexpected behavior.
12 years ago
Pol Llovet ba78360c52 Remove inline comments from inventory tokenizing. 12 years ago
Michael DeHaan fd77804bff Merge pull request #3017 from sergevanginderachter/roles-script
Add roles support for the script module
12 years ago
Michael DeHaan 44e32cc45e Some formatting fixes so docs will build, etc. 12 years ago
Michael DeHaan a9fcea5893 Merge branch 'escape' of git://github.com/ngrilly/ansible into repr 12 years ago
Jeremiah Heller 7de718cd51 Fix copy when force=no and update _remote_md5 docs.
Previously setting force=no caused copy to subversively
fail when target did not exist on remote host.

Caused by Runner._remote_md5 returning 1
when files don't exist, rather than 0.
12 years ago
Kavin Kankeshwar 8217e0706f Avoid crash in module_common when the file cannot be moved/copy 12 years ago
Serge van Ginderachter 0c0d6c0b4e performance optimization in inventory.groups_list()
don't calculate all hosts for every parent group of every group
when that parent group was already in the cache
12 years ago
Serge van Ginderachter dd9919342b hide magic variables used bin/ansible output
'verbose_override' and 'verbose_always'
12 years ago
Serge van Ginderachter 5859af7285 script support for roles: use the files/ directory
instead of an additional scripts/ directory
12 years ago
Michael DeHaan 3a635d2d26 Lots of formatting fixes 12 years ago
Michael DeHaan 11792a9daa Merge pull request #2987 from kentfrazier/sudo_user
Fix bug with include-level vars and sudo_user.
12 years ago
Michael DeHaan 84623441e1 Merge pull request #2945 from jsmartin/new_fetch
Fetch destination path can now be overriden.
12 years ago
Michael DeHaan 4fc6be8579 Merge pull request #2993 from SirScott/pkgng
Make pkgng and with_items result in a single module call.
12 years ago
Michael DeHaan 4b988dbd43 Merge pull request #2978 from bryanlarsen/basename
add basename and dirname to the core jinja2 filters
12 years ago
Michael DeHaan 27236cf598 Merge pull request #2998 from SirScott/runner-permissions
Ensure the tmp_path is sufficiently open.
12 years ago
Michael DeHaan 159ba7d68a Merge pull request #2956 from akerl/unicodefix
ignore unicode errors in stdout
12 years ago
Michael DeHaan 98a4331107 Merge pull request #2999 from ngrilly/python
Python
12 years ago
Michael DeHaan 5fdca267ac Merge pull request #3018 from dsedivec/devel
Plug-ins loaded from top-level plug-in directory
12 years ago
Serge van Ginderachter 94028852d9 Make debug module always verbose in playbooks
Created a new flag 'verbose_always' handled by
on_ok callback, similar to the 'verbose_override'
flag used by the setup module.
12 years ago
Dale Sedivec 611d56dc4c Plug-ins loaded from top-level plug-in directory
PluginLoader._get_paths, as of 391fb98e, was only finding plug-ins that
were in a subdirectory of one of the basedirs (i.e. in a category
directory).  For example, action_plugins/foo.py would never be loaded,
but action_plugins/bar/foo.py would work.

This makes it so that "uncategorized" plug-ins in the top level of a
directory such as action_plugins will be loaded, though plug-ins in a
"category" subdirectory will still be preferred.  For example,
action_plugins/bar/foo.py would be preferred over action_plugins/foo.py.
12 years ago
Serge van Ginderachter 4c9ebe8522 Add roles support for the script module
allows to put scripts directly in a dir within the
role:

 roles/<role>/scripts/..

Same as the copy and template module.

As requested in and closes #2969
12 years ago
Nicolas Grilly 75ceb80572 Escape args injected in new style modules 12 years ago
Scott Sturdivant 5516ece859 Ensure the tmp_path is sufficiently open. 12 years ago
Nicolas Grilly 7aee588918 Idiomatic Python: use in operator instead of method find 12 years ago
Nicolas Grilly 7babd30cf7 Idiomatic Python: use isinstance instead of type 12 years ago
James Martin 3c131dbd2b Initial Commit. 12 years ago
Scott Sturdivant d91bc1692e Make pkgng and with_items result in a single module call. 12 years ago
Kent Frazier 4c6583bd00 Fix bug with include-level vars and sudo_user.
If a variable was provided for an include, in either of these ways:

    ---
    - hosts: all
      tasks:
      - include: included.yml param=www-data
      - include: included.yml
        vars:
          param: www-data

and then that param was used as the value of sudo_user in the included
tasks:

    ---
    - name: do something as a parameterized sudo_user
      command: whoami
      sudo: yes
      sudo_user: $param

you would receive a "failed to parse: usage: sudo" error back and the
command would not execute.

This seemed to be due to a missing call to template.template somewhere,
because the final value being passed through ssh was still `$param`.
After some digging, the issue seems to instead have been a problem with
providing the wrong context to the template for expansion. Inside the
`Task` logic, it was passing `play.vars` as the context, where
`module_vars` seemed more appropriate. After replacing it, my test case
above ran without issue. There was a comment above suggesting that the
template call might be unnecessary, but removing it made the original
error return, since it is not getting escaped later down the line. I
removed the comment since it was inaccurate.

I tried to actually incorporate my test case above into the test suite
as a regression test, but was unable to figure out how to structure it.
The existing test infrastructure seemed to only be testing for correct
number of counts in things (ok vs. changed, etc.), without regard for
whether the content generated by the command is correct. If there is an
example of a test similar to this one (where I would want to check the
JSON generated to make sure sudo_user had been converted), please let me
know and I will be happy to submit an additional patch.
12 years ago
Bryan Larsen f629baef11 add basename and dirname to the core jinja2 filters 12 years ago
Michael DeHaan 753ebea186 Prefer categorized modules to uncategorized, such that if someone does an install on top of old content
the categorized modules will win over the 1.1 uncategorized modules, as the packages may not automatically
clean up the old content.
12 years ago
Michael DeHaan cd57d59913 If ansible is configured to use a log file but cannot write to it, exit, but don't traceback. 12 years ago
Michael DeHaan 496f06c3c9 Pass variables to lookup function for those that want to use them. 12 years ago
Michael DeHaan 16709ecd76 Replace tab with spaces. 12 years ago
Dimos Alevizos e96bc981ce Set paramiko's logging level
Excplicity set paramiko's logging level to WARNING.
By default it inherits ansible's DEBUG logging level (set in
callbacks.py) and fills the log file with useless debug messages.
Obviously it only applies if log_path is set in ansible.cfg
12 years ago
Les Aker 1179d1bbd8 corrected indentation 12 years ago
Les Aker 2adc335481 ignore unicode errors in stdout 12 years ago
Maykel Moya 60f24bb077 Remove unused modules 12 years ago
Maykel Moya f52e3dee70 Don't hardcode chroot executable path 12 years ago
Ben Ritcey 0938d4d89a Allow the remote MD5 checks to be run via sudo 12 years ago
Michael DeHaan 8475a92dec Merge pull request #2939 from mmoya/lookup-crypted-passwds
Add support for crypted passwords to password lookup
12 years ago
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 12 years ago
Maykel Moya 45f5447f9f Fix name in copyright 12 years ago
Maykel Moya 96afc3f462 Add support for crypted passwords to password lookup
Added new parameter 'encrypt' with same semantics from that of
vars_prompt. When encryption is requested a random salt will be
generated and stored along the password in the form:
'<password> salt=<salt>'.

Also store passwords with an ending '\n' for easier looking at files
with console tools. File content was being already rstripped so this
is harmless.
12 years ago
Brian Coca 8dd72d2828 changed lockfile to be opened in write mode (solaris for one doesn't like
exclusive locks on read)
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
12 years ago
Michael DeHaan f2a8c0d612 Fix listification inside of with_items so it runs more intelligently. 12 years ago
Michael DeHaan 161f3e3670 Merge pull request #2899 from sergevanginderachter/host-group-vars-no-subdirs
don't parse subdirs in host/group_vars
12 years ago
Michael DeHaan ff3625b0c9 Merge pull request #2902 from timhabermaas/fix-grammatical-error
Fix grammatical error in error message
12 years ago
Serge van Ginderachter 7eeab168bc bug fix in first_found search path assembly 12 years ago
Tim Habermaas 4d24faeeb1 Fix grammatical error in error message 12 years ago
Serge van Ginderachter a6b827ca07 don't parse subdirs in host/group_vars
as those are not supported in
core vars_plugins/group_vars.py
but might be used by other vars_plugins
12 years ago
Michael DeHaan 2a091a3505 Remove duplicate import. 12 years ago
Michael DeHaan a78edbb45c More pep8 12 years ago
Michael DeHaan 50586928b2 No need for trailing semicolon. 12 years ago
Michael DeHaan ea8302e68d Indentation. 12 years ago
Michael DeHaan 9f47d13306 Misc identation. 12 years ago
Michael DeHaan 0a1657080b Indentation fix 12 years ago
Michael DeHaan 3fdf15fa8a template code fixes for 'make pep8' 12 years ago