You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Go to file
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
bin Fix empty requirements specifications in modules documentation 12 years ago
docs/man Update release version. 12 years ago
docsite Merge pull request #2939 from mmoya/lookup-crypted-passwds 12 years ago
examples Add version added field to notification modules. 12 years ago
hacking Fixup the module formatter to explain the EXAMPLES string as well. 12 years ago
lib/ansible Fix bug with include-level vars and sudo_user. 12 years ago
library Fixed handling of urlopen result to work properly under both python 2.4 and python 2.6 12 years ago
packaging update archlinux PKGBUILD for pacman 4.1 12 years ago
plugins Do not need to chmod cache file each time 12 years ago
test Dealing with invalid symlinks and symlink permissions 12 years ago
.gitignore Add vim swap files to gitignore 12 years ago
CHANGELOG.md update changelog. 12 years ago
CONTRIBUTING.md Add a line about testing. 12 years ago
COPYING license file should be in source tree 13 years ago
MANIFEST.in Add some docs/examples 12 years ago
Makefile make path to nosetests executable configurable 12 years ago
README.md Update README.md 12 years ago
RELEASES.txt Update the release date & code names in the releases file. 12 years ago
VERSION Update release version. 12 years ago
setup.py fix package mentioned twice in setup.py 12 years ago

README.md

Ansible

Ansible is a radically simple configuration-management, deployment, task-execution, and multinode orchestration framework.

Read the documentation and more at http://ansible.cc

Many users run straight from the development branch (it's generally fine to do so), but you might also wish to consume a release. You can find instructions on http://ansible.cc/docs/gettingstarted.html for a variety of platforms. If you want a tarball of the last release, go to http://ansible.cc/releases/ and you can also install with pip (though that will bring in some optional binary dependencies you normally do not need).

Design Principles

  • Dead simple setup
  • Super fast & parallel by default
  • No server or client daemons; use existing SSHd
  • No additional software required on client boxes
  • Modules can be written in ANY language
  • Awesome API for creating very powerful distributed scripts
  • Be usable as non-root
  • The easiest config management system to use, ever.

Get Involved

Branch Info

  • Releases are named after Van Halen songs.
  • The devel branch corresponds to the release actively under development.
  • Various release-X.Y branches exist for previous releases
  • We'd love to have your contributions, read "CONTRIBUTING.md" for process notes.

Author

Michael DeHaan -- michael@ansibleworks.com

AnsibleWorks