Commit Graph

283 Commits (346df537b4dbdd768b99a54971aaeacd49014ddf)

Author SHA1 Message Date
Michael DeHaan 346df537b4 Merge branch 'integration' of https://github.com/jkleint/ansible into jkleint-integration 13 years ago
Michael DeHaan 7de90c4e64 Version bump for integration branch (soon to be renamed 'devel'), didn't update package
changelogs yet since this isn't released yet (but 0.3 is)
13 years ago
Michael DeHaan 4d62510997 Version bump for 0.3 release 13 years ago
Michael DeHaan a8707e48e8 Fix merge issue 13 years ago
Michael DeHaan c00699d0ef Merge branch 'integration'
Conflicts:
	lib/ansible/playbook.py
	lib/ansible/runner.py
	library/apt
13 years ago
Michael DeHaan 321ed53e3a Fetch module doesn't set invocation parameter as it invokes nothing, so don't let that be an error. 13 years ago
jkleint e69e078569 More robust remote sudo.
The basic idea is sudo /bin/sh -c 'quoted_command'.  We use Paramiko's low-level API to set a timeout, get a pseudo tty, execute sudo and the (shell quoted) command atomically, wait just until sudo is ready to accept the password before sending it down the pipe, and then return the command's stdout and stderr.

This should be faster, as there are no unneeded sleeps.  There are no permissions issues reading the output.  It will raise socket.timeout if the command takes too long.  However, this is a per-read timeout, not a total execution timeout, so as long as the command is writing output and you are reading it, it will not time out.

Local and non-sudo commands remain unchanged, but should probably adopt a similar approach.

Since this is a significant change, it needs a lot of testing.  Also, someone smarter than I should double-check the quoting and execution, since it is a security issue.
13 years ago
Michael DeHaan 533c2c6126 Make it possible to use facts from hosts in templates for other hosts.
It works like this:

{{ hostvars['127.0.0.1']['ansible_eth0']['ipv4']['address'] }}
13 years ago
Michael DeHaan 767282df2a Small style fixes for indentation and spacing. 13 years ago
Michael DeHaan bed5da6086 Remove unused assignment 13 years ago
Michael DeHaan ddc0342920 Unused import 13 years ago
Michael DeHaan 1e7b60b9a5 Unused import 13 years ago
Michael DeHaan 9d0f2a6e9b Unused import 13 years ago
Michael DeHaan 3081bb93f1 Use /var/tmp for root by default to avoid /tmp being mounted noexec, and segregate tmp files for other users
into their home directories.
13 years ago
Michael DeHaan 3d72260887 Make it such that modules with no arguments work fine in playbooks (like ping, which is
non-sensical, but also if the user wrote a module that took none)
13 years ago
Michael DeHaan c6b8e1621d A better fix for slurp, expand path in the module. 13 years ago
Michael DeHaan 13ba31231e Fixup slurp module usage when not running as root, fix error handling path in slurp module. 13 years ago
Michael DeHaan 8a433ecb96 Merge branch 'align-vars-syntax' of https://github.com/jhoekx/ansible into jhoekx-align-vars-syntax 13 years ago
Jeroen Hoekx cdb8213dcc Supported 'listed' vars in playbooks. 13 years ago
Jeroen Hoekx 903e4f6eae Support dicts in inventory vars. 13 years ago
Michael DeHaan 9cd492befe make all templating happen locally, so no jinja2 deps are ever required 13 years ago
Michael DeHaan 30d06dbcea Don't force down ansible facts back to setup, the setup module won't like parsing them on input and that
data is already there.
13 years ago
Michael DeHaan 5fa3d9b148 Teach playbooks to template locally to eliminate the need for Jinja2 on remote nodes.
You still need jinja2 if using /usr/bin/ansible vs /usr/bin/ansible-playbook though
this could change later by fetching the ansible file with a 'slurp' module.
13 years ago
Michael DeHaan da0209dbc4 The fetch module really should preserve the whole directory structure being fetched to allow subsequent calls,
particularly in playbook, to recreate the host tree structure.  Making it thus.
13 years ago
Jeroen Hoekx 22ff8282a8 Template template module source. 13 years ago
Jeroen Hoekx b678cf783c Template the source file of the copy module. 13 years ago
Michael DeHaan de70277173 No need to save setup files to disk, this is what SETUP_CACHE effectively does. 13 years ago
Jeroen Hoekx aa555b8b16 Inventory: AnsibleError is not global... 13 years ago
Michael DeHaan da6cb1ca6e Less scrolling over constructor params now that documentation follows 13 years ago
Michael DeHaan 3f26a1c7f6 verbose option is not being used, so remove it. debug variable still exists. 13 years ago
Michael DeHaan 78b5cd64d0 Add pydoc for constructors. Some arguments can be trimmed as we plan to remove the need for them (like setup_cache and
maybe module_vars) with various pending refactoring.
13 years ago
Michael DeHaan 9ce27be878 Remove extra_vars tests 13 years ago
Michael DeHaan 35fdf6636b Allow --user for playbooks, no need for port setting as can specify in inventory file now. 13 years ago
Michael DeHaan 08468dcb0c Fixes to make ports DWIM. 13 years ago
Michael DeHaan 957867e088 Merge branch 'yaml-inventory' of https://github.com/jhoekx/ansible into jhoekx-yaml-inventory
Conflicts:
	lib/ansible/runner.py
13 years ago
Michael DeHaan a5cb16c9d7 Use correct user to determine host files path, do not reuse .ansible
which is already taken for ansible management ops.
13 years ago
Michael DeHaan 6307267cf3 As part of the support for access to external nodes information, save fact data into /var/lib/ansible/setup_data
OR a per-user directory when running from playbooks.  Technically this info is also available via the SETUP_CACHE
but that is a bit more complex of a construct and it would be better to not cross the streams.
13 years ago
Jeroen Hoekx 8c3206c99f Return a copy of the host variables. 13 years ago
Jeroen Hoekx 961ccdb2f4 List hosts in no group in the ungrouped group. 13 years ago
Jeroen Hoekx 3a24aa9a70 Add YAML inventory format.
See test/yaml_hosts for an example.

Hosts can be part of multiple groups.

Groups can also have variables, inherited by the hosts.
There is no variable scope, last variable seen wins.
13 years ago
Jeroen Hoekx 54f4526160 Export SSH port number as host variable. 13 years ago
Jeroen Hoekx f04041b37d Ignore port numbers in simple inventory format 13 years ago
Jeroen Hoekx 746f1b92ae Reimplement the class method on Runner. 13 years ago
Jeroen Hoekx c5cae87eca Refactor inventory code out of Runner.
This introduces the Inventory class.

Playbook uses the internals of Runner to limit the number of hosts to poll
asynchronously. To accomodate this, Inventory can be restricted to specific
hosts.
13 years ago
Michael DeHaan d8f9d7c6c9 Use correct user to determine host files path, do not reuse .ansible
which is already taken for ansible management ops.
13 years ago
Rafal Lewczuk a87c77958c clean exec bits from lib/ansible/*.py, ignore Eclipse/PyDev files 13 years ago
Michael DeHaan 3454fa9950 As part of the support for access to external nodes information, save fact data into /var/lib/ansible/setup_data
OR a per-user directory when running from playbooks.  Technically this info is also available via the SETUP_CACHE
but that is a bit more complex of a construct and it would be better to not cross the streams.
13 years ago
Michael DeHaan 31d4ee32d1 Looping! With items! See examples/playbook/loop_with_items.yml for details 13 years ago
Michael DeHaan 347637339c Merge remote branch 'public/integration' into integration 13 years ago
Michael DeHaan c3cad50075 Update manpages, fix missing variable assignment 13 years ago