1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

346 commits

Author SHA1 Message Date
Michael DeHaan
cbea17e4c5 Fix up async 2012-07-23 20:46:35 -04:00
Michael DeHaan
cac7afd700 async is under construction 2012-07-23 20:06:18 -04:00
Michael DeHaan
1f44c07ddf Fix assemble usage, some issues still with async. 2012-07-23 19:40:21 -04:00
Timothy Appnel
4b9b9a8a5b Importing re in runner for doing conditional tasks using pattern matching i.e. re.search(). Also conditionally outputting item when skipping. 2012-07-23 19:36:26 -04:00
Michael DeHaan
ec12cc4154 Save the transfer of the module file for new style modules, because we can inject the arguments into the modules.
Module consumers using the API don't have to know how this works.  base64 stuff is only there
because escaping a docstring inside a docstring was a bit of a challenge :)
2012-07-23 19:18:45 -04:00
Michael DeHaan
0b891fc8fb Tweaking daisychain internals to allow get_url to modify the path destination when downloading to a directory.
Minor module refactoring.
2012-07-22 11:08:16 -04:00
Michael DeHaan
d76c8c9c85 Various cleanup around runner's constructor and how daisy chaining is invoked. 2012-07-21 16:51:31 -04:00
Michael DeHaan
1682dd06c0 Avoid duplicate call to fetch inventory variables 2012-07-21 16:23:00 -04:00
Michael DeHaan
54c9c1e25c Some streamlining of first_available_file code 2012-07-21 16:15:36 -04:00
Michael DeHaan
2d06ee4c0d Fix some subtle things that were keeping 'hostvars' from being usable in templates. 2012-07-20 12:34:26 -04:00
Michael DeHaan
2b6d8a8be5 Fix some issues with the setup cache 2012-07-20 11:58:08 -04:00
Michael DeHaan
5a67a556cd Script to migrate YAML users to the INI format, so we can deprecate YAML inventory (which we are now doing). 2012-07-20 11:15:57 -04:00
Michael DeHaan
dcca08b27b Don't let with_items erase 'hostvars' 2012-07-20 10:02:35 -04:00
Michael DeHaan
db1a4d8fac Make 'assemble' use the new daisychain logic 2012-07-20 09:17:42 -04:00
Michael DeHaan
6fb74ae2f9 preserve 'changed' attributes in daisychain logic 2012-07-20 09:13:10 -04:00
Michael DeHaan
d72c0c8898 replace module daisy-chaining logic 2012-07-20 08:57:50 -04:00
Michael DeHaan
6e84374c2a Make hostvars work post refactoring 2012-07-20 08:29:44 -04:00
Michael DeHaan
b0eedfbf92 Merge pull request #639 from goozbach/issue-627
improved output in with_items fixes: #627
2012-07-20 16:36:49 -07:00
Derek Carter
34e2584220 improved output in with_items fixes: #627 2012-07-20 14:01:54 -04:00
Rodney Quillo
5f068913ee Suppress Ubuntu ssh -tt error ioctl error. 2012-07-20 13:23:14 +08:00
Michael DeHaan
9006d4557d Added code to allow insertion of boilerplate into modules to make them able to share lots of code, the result
should be a huge reduction of total ansible source, at a slight cost of difficulty in original module development.

We need to apply this now to all modules, but may need to have some exemptions to things like command, which should
subclass this module.
2012-07-17 22:34:52 -04:00
Michael DeHaan
8bb8314d10 Inject vars need to pushed further up to make with_items work as desired. 2012-07-17 20:09:18 -04:00
Ludovic Claude
26dc607c5c Revert "Change previous fix to a one line change relative to upstream"
This reverts commit 0d53b1b097.
2012-07-18 19:02:56 +02:00
Ludovic Claude
0d53b1b097 Change previous fix to a one line change relative to upstream 2012-07-18 17:52:51 +02:00
Ludovic Claude
c4303c8c04 Avoid spurious error when mixing a local play with remote plays depending on --ask-sudo-pass 2012-07-18 12:05:12 +02:00
Dave Hatton
72ca9e58e7 meaningful messages if the remote md5 fails 2012-07-17 09:14:16 +01:00
Michael DeHaan
0edd0d4736 Fixing template calls 2012-07-16 20:26:39 -04:00
Michael DeHaan
5f69c557b9 Fix for the way host variables were being swallowed, plus some overall simplification. Deciding what
dictionary to use for templating now happens in exactly one place (executor_internal) and the "inject"
dictionary is passed to what needs it.
2012-07-15 14:19:11 -04:00
Dave Hatton
c3205595b3 format fixes to make fetch more usable 2012-07-16 11:43:37 +01:00
Michael DeHaan
b542dd8466 Fix import in ssh connection 2012-07-15 13:12:11 -04:00
Michael DeHaan
80edea2934 with_items handling code should apply to all modules, was screwed up in refactoring to only apply to 'normal'
modules.
2012-07-15 12:51:56 -04:00
Michael DeHaan
1754de3335 Misc code cleanup, mostly whitespace preferences, removing unused imports, plus a few fixes here and there. 2012-07-15 12:29:53 -04:00
Michael DeHaan
4b73931351 misc code cleanup, don't pass parameters to the connection object we can already get from Runner 2012-07-15 11:54:39 -04:00
Michael DeHaan
1d8bb17785 misc code cleanup 2012-07-15 10:57:22 -04:00
Michael DeHaan
5a63a48e6b No need to feed variables into the setup module for preservation since the file is no longer saved to disk. 2012-07-15 10:24:38 -04:00
Michael DeHaan
227c500ad7 Misc cleanup/formatting 2012-07-15 10:22:15 -04:00
Michael DeHaan
867b2437cc consolidate output code in callbacks.py, from utils, remove extra functions 2012-07-15 10:12:49 -04:00
Michael DeHaan
bc71c6ddd7 add space between function 2012-07-15 09:33:48 -04:00
Michael DeHaan
cb55cd6f8d removed unused function 2012-07-15 09:33:22 -04:00
Michael DeHaan
68a9adc1be Indentation cleanup (partial) 2012-07-15 09:32:47 -04:00
Michael DeHaan
244b923559 No longer need to calculate setup metadata location since we don't write
the setup file to disk.
2012-07-15 09:25:17 -04:00
Michael DeHaan
64c51ade1e Change the way we do with_items to make them happen next to each other in runner, which eliminates the problem of with_items and vars_files sometimes not playing nice with each other.
(Also a fix for the user module error handling when the user
is not present at the time of the return.  This can only really be caused by multiple ansible executions).
2012-07-14 19:18:33 -04:00
Michael DeHaan
931f9f1a61 Setup module no longer saves to disk, as templates are mostly useful in playbooks and this allows lots of simplifications
around file pathing and removes occasional permissions conflicts depending on how things are used.
2012-07-14 11:59:12 -04:00
Michael DeHaan
cf313cde96 Soft import of paramiko since we have the SSH and local connection types now. Packaging will still
require it.
2012-07-12 00:43:51 -04:00
Dag Wieërs
cb40778b84 Wrong evaluation of a local file before fetching the remote file 2012-07-13 11:07:32 +02:00
Dave Hatton
55694db7c3 switch to hashlib.md5 or md5 instead of OS md5 commands 2012-07-09 08:52:00 +01:00
Michael DeHaan
0d28466b22 When sudo'ing to root, keep the setup file location as /etc/ansible/setup 2012-07-07 09:29:03 -04:00
Michael DeHaan
c2b8fabf66 Take a remote md5sum before a file transfer to decide whether to transfer the file or not.
Allows for efficient transfer of large files.  Templates do not sample first because they are small.
2012-07-07 09:10:18 -04:00
Michael DeHaan
8220d57690 Clean up md5 functions + make the fetch module stay happy if the remote file does not exist. 2012-07-07 08:47:32 -04:00
Michael DeHaan
e3aba7770f Merge pull request #518 from brainpage/devel
adds 'groups' variable, essentially making hosts file accessible as a var
2012-07-04 11:28:46 -07:00
alex
f72b1f4fd7 Fixed: pathname for tmp 2012-07-02 22:04:56 +02:00
alex
bbf2939063 Fixed: executing templates outside playbooks 2012-07-02 21:34:11 +02:00
Jonathan Palley
cedbcfcc0a adds 'groups' variable, essentially making hosts file accessible as a variable 2012-07-01 15:04:53 +08:00
Michael DeHaan
efac68b636 Remove the -D module debug flag, which no longer is functional due to sudo pty requirements, and replace with -v/--verbose.
This flag will show playbook output from non-failing commands.  -v is also added to /usr/bin/ansible, but not  yet used.

I also gutted some internals code dealing with 'invocations' which allowed the callback to know what module invoked
it.  This is not something 0.5 does or needed, so callbacks have been simplified.
2012-06-19 21:57:43 -04:00
Michael DeHaan
afb2e3e5ac Merge pull request #511 from dsummersl/devel
added ability to ovverride all ssh settings via ANSIBLE_SSH_ARGS
2012-06-26 15:28:49 -07:00
Dane Summers
37fce9c0f6 added ability to ovverride all ssh settings via ANSIBLE_SSH_ARGS 2012-06-26 14:59:42 -04:00
Jeroen Hoekx
6c92d2fa88 Import ansible errors in Poller. 2012-06-25 20:48:35 +02:00
Dave Hatton
d42df3a82e change to STDOUT from PIPE to get ssh connection module working 2012-06-22 12:37:23 +01:00
Dave Hatton
30d4f070a1 change STDOUT to PIPE to get ssh connection module working 2012-06-21 11:01:08 +01:00
Daniel Hokka Zakrisson
fa887bc90f Merge stdout and stderr for non-sudo 2012-06-20 20:49:52 +02:00
Daniel Hokka Zakrisson
7884bc02ea Wait for process to finish and then parse output 2012-06-20 20:49:52 +02:00
Seth Vidal
dca75033fe add -q to handle stdout/stderr being combined, add catch for ControlPersist not existing in ssh for rhel6, etc 2012-06-20 14:06:24 -04:00
Michael DeHaan
9662902c31 Merge pull request #492 from dhozac/unnecessary-parse_json
Remove unnecessary parse_json invocation
2012-06-20 10:26:17 -07:00
Michael DeHaan
071978a2e7 Merge pull request #493 from dhozac/ssh-merge-stdouterr
Merge stdout and stderr as that is what is expected
2012-06-20 10:24:32 -07:00
Daniel Hokka Zakrisson
f5ecd075f7 Remove unnecessary parse_json invocation 2012-06-20 14:54:36 +02:00
Michael DeHaan
bd653c8f3c Merge pull request #488 from dhozac/jinja2-env
Create a Jinja2 environment allowing includes
2012-06-19 13:09:02 -07:00
Michael DeHaan
e0f12292d8 Merge pull request #489 from dhozac/ssh-args-default
Default to using a ControlMaster connection
2012-06-19 13:01:09 -07:00
Daniel Hokka Zakrisson
7f6359b143 Default to using a ControlMaster connection 2012-06-19 21:58:24 +02:00
Daniel Hokka Zakrisson
d08ba12a42 Merge stdout and stderr as that is what is expected
Should also fix problems where something might output an error
before the sudo prompt.
2012-06-19 21:55:00 +02:00
Seth Vidal
1ec518543e make Runner options conflict errors raise AnsibleErrors not traceback in general
add catch if -c ssh and -k are passed at the same time since the ssh connection type doesn't
support passwords
2012-06-18 15:48:19 -04:00
Daniel Hokka Zakrisson
9f93839d13 Create a Jinja2 environment allowing includes 2012-06-17 22:18:08 +02:00
Daniel Hokka Zakrisson
ab08fea1aa Add an ssh command wrapper transport 2012-06-17 20:34:17 +02:00
Daniel Hokka Zakrisson
13b814a33c Run templating function until the text doesn't change
This allows variables to contain other variables.
2012-06-16 12:51:19 +02:00
Jonte Norman
1b091a7e3e Fixed typo from results to result in _execute_raw method 2012-06-15 22:45:47 +02:00
Fred Alger
834f6a216d Make shell outs to md5sum work on FreeBSD and OS X
Tested with OS X local connection and Linux remote. The paths to the
md5sum and md5 commands are hardcoded to the most common location. This
will definitely fail if the commands are elsewhere, or if the md5
command doesn't support the -q 'quiet' option.
2012-06-15 00:04:01 -04:00
Michael DeHaan
2a8d1f07d4 Merge branch 'mktemp-vanish' of https://github.com/dagwieers/ansible into devel
Conflicts:
	lib/ansible/runner/__init__.py
2012-06-13 22:39:58 -04:00
Michael DeHaan
2a49438c37 Merge pull request #461 from dhozac/only_if-early
Evaluate only_if early
2012-06-13 19:19:25 -07:00
Stephen Fromm
9cf182c225 Add assemble module
This adds a module that concatenates (ie. assembles) a file from
fragments in a directory in alphabetical order.  It chains the file
module afterward to fix up ownership and permission.  This also adds
tests for the assemble module with fragments in assemble.d.
2012-06-11 23:09:54 -07:00
Daniel Hokka Zakrisson
7942570411 Fix on_unreachable invocation with non-existing variable 2012-06-11 15:15:29 +02:00
Daniel Hokka Zakrisson
eba81ee36f Evaluate only_if early to do as little work as possible 2012-06-11 15:15:29 +02:00
Matt Goodall
c1b38f62c8 Search multiple paths for modules.
Minimal change to allow a list of paths (separated by the typical path
separator) to be searched in sequence for the named module.
2012-06-10 16:22:59 +01:00
Michael DeHaan
01387520e9 Merge pull request #451 from phred/fix-fetch-module
Make 'fetch' test for local directories before creating.  Fixes issue #450
2012-06-08 12:06:02 -07:00
Michael DeHaan
e265cdfa1d Merge pull request #454 from jhoekx/configure-python-interpreter
Introduce ansible_python_interpreter variable.
2012-06-08 12:03:40 -07:00
Daniel Hokka Zakrisson
d0d036fd3f Expand $item for copy and fetch 2012-06-08 01:36:52 +02:00
Jeroen Hoekx
1f63c47738 Introduce ansible_python_interpreter variable.
This allows configuration of the correct python interpreter on the managed system.
2012-06-07 09:50:38 +02:00
Dag Wieërs
b3b22c41e9 Get rid of mktemp dependency to support AIX
The function call has been renamed to better reflect what it does, and we
reduced the number of calls from two to one in case the remote user is not
root.

This patch also fixes a string concatenation in _copy_module() that
should use os.path.join() instead.

This closes #436
2012-06-06 14:47:47 +02:00
Fred Alger
bee04de26a Fix exception in fetch module when src or dest parameter omitted. 2012-06-05 11:35:19 -04:00
Fred Alger
d0c4f4015c Fix remote md5 in fetch module, related to Issue #450 2012-06-05 11:35:19 -04:00
Fred Alger
51b460e8c6 Make 'fetch' test for local directories before creating. Fixes issue #450 2012-06-05 10:38:12 -04:00
John Kleint
e9f770fa11 More helpful message when ssh fails. 2012-06-01 17:16:02 -04:00
Michael DeHaan
16f0d7b333 Revert "Get rid of mktemp dependency to support AIX"
This reverts commit 4ad1b57b52d735393f6c6bcbd5524b947134fbf9.
2012-05-31 21:59:31 -04:00
Michael DeHaan
99430fa0a3 Fix for older version of sudo + some changes to imports so tests are happy 2012-05-31 21:44:56 -04:00
Dag Wieers
a8fd6ee9c3 Get rid of mktemp dependency to support AIX
The function call has been renamed to better reflect what it does, and we
reduced the number of calls from two to one in case the remote user is not
root.

This patch also fixes a string concatenation in _copy_module() that
should use os.path.join()

This closes #436
2012-05-31 17:02:10 +02:00
Michael DeHaan
6034b5b0f3 Split connection code into submodules. 2012-05-30 20:16:31 -04:00
Michael DeHaan
ecb944892d Tweaks on previous refactoring of playbook, version bump a 0.4 reference, remove some debug, etc 2012-05-26 01:20:53 -04:00
Michael DeHaan
cf9ddf3a30 Reorganizing file structure. Not done. 2012-05-25 19:34:13 -04:00