Commit Graph

1192 Commits (3ff8f01087db13f4655b8850131734e28f92569f)

Author SHA1 Message Date
Chris Church 0d1197a995 Replace Get-FileHash with MD5 code that works on PowerShell 3. 2014-08-28 01:42:22 -04:00
James Cammarata a6ad374668 Use split_args directly to check for omitted params 2014-08-27 11:51:03 -05:00
James Cammarata 04da466c7b Fixing up serialize_args utility function 2014-08-27 10:20:07 -05:00
James Cammarata e99db078b4 Additional fixes for the new omit parameter variable 2014-08-27 10:06:55 -05:00
Victor Lin fe88ba7c8d Undo changes to filter module 2014-08-27 10:04:47 -05:00
Victor Lin 559c04f324 Implement omit for module args, also add tests for it 2014-08-27 10:04:47 -05:00
Victor Lin bce6642ab6 Implement default omit correctly 2014-08-27 10:03:07 -05:00
Victor Lin 0b4d7f1574 Implement default omit filter 2014-08-27 10:03:07 -05:00
James Cammarata ed34cee36f Atomically move known hosts file into place for paramiko connections
Redo of original patch, which adds an additional check to ensure the
known_hosts file isn't trampled when host_key_checking is disabled.

Fixes #8169
2014-08-26 16:02:59 -05:00
Chris Church 57dee4545b Make sure cmd is UTF8 encoded before splitting. Fixes regression introduced by 80df2135e9. 2014-08-24 21:06:21 -04:00
Chris Baughman 07f12539ee Bugfix: #8720 winrm.py: protocol.send_message() crashes with https 2014-08-22 15:09:48 -04:00
James Cammarata d01188033f Checking for localized versions of the su password prompt
Fixes #8681
2014-08-22 09:59:40 -05:00
James Cammarata 8a1fbed5d6 Correct variable blending from vars_files with hostvars in them
Fixes #8638
2014-08-20 15:49:01 -05:00
James Cammarata cecfede85f Merge remote-tracking branch 'svg/issue_8621_8664' into svg_issue_8621_8664 2014-08-19 11:37:59 -05:00
James Cammarata d4ff0d125a Make sure password files from lookups are created with restrictive permissions
Also adds checks for the lookup integration test for passwords.

Fixes #8652
2014-08-19 11:30:04 -05:00
Serge van Ginderachter 3c06833302 group_by: make sure new group has bigger priority than all group 2014-08-19 16:34:30 +02:00
James Cammarata 379e31883c Fix check mode issues with copy module
Fixes #8639
2014-08-18 16:02:45 -05:00
James Cammarata 54cbe3dcf9 Disallow args: to be specified as a string 2014-08-14 16:05:20 -05:00
James Cammarata ee18c557ec Load group_vars for new groups loaded via add_host
Fixes #8605
2014-08-14 13:18:26 -05:00
Cristian Ciupitu b6261d05b0 Fix typo: & -> and
`and` is the boolean operator for AND in [Python][1].
`&` is the bitwise operator for AND in [Python][2].

[1]: https://docs.python.org/2/reference/expressions.html#boolean-operations
[2]: https://docs.python.org/2/reference/expressions.html#binary-bitwise-operations
2014-08-14 16:52:59 +03:00
Michael DeHaan 99c39b1ff3 By popular request, make the no_log attribute also censor tasks from callbacks. 2014-08-12 13:36:05 -04:00
James Cammarata fc7859f445 Make sure playbook_dir variable is an absolute path
Fixes #8317
2014-08-12 09:51:44 -05:00
James Cammarata 4940a7ad77 Merge pull request #8458 from Jmainguy/runner_8404
Fixes 8362, returns stderr if No space left on device
2014-08-11 23:16:57 -05:00
Michael DeHaan 56f9328f93 Merge 2014-08-11 12:22:47 -04:00
Michael DeHaan 03d150de35 Merge pull request #8020 from msabramo/error_when_private_key_file_permissions_incorrect
Error if private_key_file is group/world readable
2014-08-08 12:33:07 -04:00
Michael DeHaan 8c4161d4a1 Merge branch 'retf_py' of git://github.com/berendt/ansible into devel
Conflicts:
	lib/ansible/inventory/vars_plugins/group_vars.py
	plugins/callbacks/mail.py
2014-08-08 12:17:37 -04:00
Michael Peters 3ba516ac25 adding min() and max() filters for use in Jinja templates 2014-08-08 11:28:48 -04:00
Michael DeHaan 48a0236ec6 Merge pull request #6619 from sergevanginderachter/ansible_version_var
Introduce an ansible_version dict as runner variable
2014-08-08 11:20:17 -04:00
James Cammarata d4cedfc7f1 Fix missing variable initialization for async jid
Fixes #8491
2014-08-07 23:51:28 -05:00
James Cammarata 4a157a72a0 Catch auth errors in winrm and properly raise errors
Fixes #7875
2014-08-07 09:00:24 -05:00
James Cammarata ba4693051b Removing leftover import of atomic_move 2014-08-06 15:38:08 -05:00
James Cammarata efbad90ef8 Revert "Atomically move known hosts file into place when edited by paramiko connections"
This reverts commit bd49a835b4.
2014-08-06 15:31:54 -05:00
James Cammarata a45c3b84f3 Avoid templating raw lookup strings 2014-08-06 13:25:14 -05:00
James Cammarata dc69510bff Merge branch 'callback_template_delegate' of https://github.com/sergevanginderachter/ansible into sergevanginderachter-callback_template_delegate 2014-08-05 15:15:03 -05:00
James Cammarata eeec459f8a Merge branch 'sets_v2' of https://github.com/bcoca/ansible into bcoca-sets_v2 2014-08-05 14:58:01 -05:00
Jonathan Mainguy 535ebc4c56 Fixes 8362, returns stderr if No space left on device 2014-08-05 15:18:49 -04:00
Serge van Ginderachter 8f39c114d8 template Runner.module_vars['delegate_to'] to accommodate callbacks 2014-08-05 15:16:43 +02:00
James Cammarata bd49a835b4 Atomically move known hosts file into place when edited by paramiko connections
Fixes #8169
2014-08-04 13:08:40 -05:00
Michael DeHaan 7ff63ab754 Revert "Use atomic move function on known host file in paramiko to prevent rare occurance of Control-C"
This reverts commit 642b183fb6.
2014-08-04 13:11:40 -04:00
James Cammarata 6d94ae64ec Remove unnecessary unicode conversions from parse_kv
Fixes #8425
2014-08-04 09:59:08 -05:00
Michael DeHaan 642b183fb6 Use atomic move function on known host file in paramiko to prevent rare occurance of Control-C
during file operations.
2014-08-04 10:50:14 -04:00
Michael DeHaan a7d2e729f8 Add some whitespace to make paramiko_ssh more browseable 2014-08-04 10:38:16 -04:00
James Cammarata 9c1a89ff4e Merge branch 'patch-1' of https://github.com/debfx/ansible into debfx-patch-1 2014-07-31 11:41:21 -05:00
James Cammarata e6fa50a306 Move splitter to module_utils so modules can use it and fix command arg splitting
Fixes #8338
2014-07-29 14:55:16 -05:00
Michael DeHaan 645ab7baff Merge pull request #7950 from mesk41in/devel
Fix unsupported regexp parameter in assemble
2014-07-28 12:01:12 -04:00
James Cammarata 57f89b85eb Merge pull request #8271 from tksmd/fix-copy-set-fs-attributes-issue
fix an issue that copying directory will fail when trying to change file attributes
2014-07-25 09:38:24 -05:00
Michael DeHaan 630f080cf0 Start of unit tests for split_args function, moved split_args to utils since not needed by modules (so far). 2014-07-24 20:15:04 -04:00
James Cammarata 43154e5101 Using custom splitting function for module param counting 2014-07-24 14:42:35 -05:00
someda 1b1d5d0d3d fix an issue that copying directory will fail when trying to change file attributes and the target file already exists on remote
- the issue was introduced by the commit 84759faa09
2014-07-24 14:03:36 +09:00
James Cammarata 2cc602beea Fixes for module param counting and additional shell quoting issues 2014-07-23 22:54:59 -05:00
Benno Joy ac85d8444b fix for unarchive 8257 2014-07-23 14:50:16 +00:00
James Cammarata 84759faa09 Security fixes:
* Strip lookup calls out of inventory variables and clean unsafe data
  returned from lookup plugins (CVE-2014-4966)
* Make sure vars don't insert extra parameters into module args and prevent
  duplicate params from superseding previous params (CVE-2014-4967)
2014-07-21 11:20:49 -05:00
James Cammarata 00e089e503 Revert "Explicitly set the user option for ssh connections"
This reverts commit 0f91add86f.

Fixes #8216
2014-07-21 10:32:55 -05:00
Serge van Ginderachter 4e9a253bef Load existing group_vars file for new group_by group
if it was not loaded yet, which happens if that group
didn't exist yet in the inventory.

fixes #8159
2014-07-16 21:16:27 +02:00
Felix Geyer 0ebd19e97b Fix regression: Sanitize sudo success_key from stdout
Commit 7e3dd10 caused a regression with sanitizing the sudo success_key from stdout.
There is no newline in front of SUDO-SUCCESS when using sudo.
This change adapts the regex to make the line break optional.

Tested on Ubuntu 14.04.
2014-07-16 18:14:35 +02:00
James Cammarata e74853300a Merge branch 'task-host-loop-bypass' of https://github.com/sivel/ansible into sivel-task-host-loop-bypass 2014-07-14 14:21:25 -05:00
James Cammarata b8ac094eaa Tweak to only show msg on assert failure if set 2014-07-08 14:05:24 -05:00
James Cammarata 16332b8488 Merge branch 'assert-with-msg' of https://github.com/darkk/ansible into darkk-assert-with-msg 2014-07-08 13:56:08 -05:00
Leonid Evdokimov d94395f48c assert: add optional `msg` argument
Sample playbook when it may be useful:
```
- uri: return_content=yes url={{ api_base }}/action/{{ inventory_hostname }}
  register: output
- assert:
    msg: '{{ output.json | to_nice_json }}'
    that:
      - output.json.foo != "bar"
      - output.json.boo == 42
```
2014-07-07 19:05:17 +04:00
James Cammarata ff04b2b532 Allow empty yaml vars files
Fixes #7843
2014-07-04 23:10:32 -05:00
Marc Abramowitz 5b783e0bc6 Error if private_key_file is group/world readable
Currently, if you have this, ansible fails with a generic error and
suggests running again with `-vvvv`. This isn't bad but pinpointing the
specific problem immediately is even more user-friendly.

```
$ ls -l devops.pem
-rw-r--r--+ 1 marca  staff  1679 Jul  2 11:25 devops.pem

$ ansible -m ping --private-key=devops.pem mt3-pyweb01
mt3-pyweb01 | FAILED => private_key_file (devops.pem) is group-readable or world-readable and thus insecure - you will probably get an SSH failure
```
2014-07-02 13:44:53 -07:00
James Cammarata 8ed6350e65 When parsing json from untrusted sources, remove templating tags 2014-07-01 14:14:14 -05:00
Michael Scherer f0a7139290 Fix exec_command prototype for the plugin 2014-06-28 13:06:40 +02:00
mesk41in 488aec3936 Fix unsupported regexp parameter in assemble 2014-06-27 13:54:59 +04:00
James Cammarata 1adb6dfa05 Remove redundant 'self.user or' added by 0f91add 2014-06-24 10:45:38 -05:00
Thomas Mangin 0f91add86f Explicitly set the user option for ssh connections
Fixes #7170
2014-06-23 15:57:49 -05:00
Paul Sokolovsky f8bf9cdeec Handle TemplateNotFound to render more helpful error message.
At the point the exception is handled, it is likely due to error loading
a sub-template included from main template. Besides file not found, it
can be caused also by include path failing Jinja2 checks. Now, when
rendering the exception from Jinja, it will include exception name. This
will give basic context or *what* the error is.

Fixes #7103
Fixes #7105
2014-06-23 15:02:58 -05:00
James Cammarata 5d65c1c4a4 Merge branch 'Mbosco-patch-1' into devel 2014-06-23 13:00:51 -05:00
James Cammarata 1702c2fd50 Merge branch 'patch-1' of https://github.com/Mbosco/ansible into Mbosco-patch-1 2014-06-23 12:57:13 -05:00
Jakub Jirutka 726a61eb43 Add os relpath filter 2014-06-23 16:10:07 +02:00
Chris Church 6aaad5dc9b Fix missing arg for _remote_chmod method. 2014-06-23 06:09:08 -04:00
James Cammarata 94963290b9 Merge pull request #6981 from aliles/fix-localhost-executable-with-flags
Fix localhost tasks with complex executables
2014-06-20 12:51:54 -05:00
Chris Church 615f70e3f4 Fix missing space in script action plugin. 2014-06-19 21:54:21 -05:00
Chris Church dd3f7c2dab Fix trailing slash on returned temp path. 2014-06-19 16:20:18 -05:00
Chris Church 8a121fd6ae Squeeze a few more bytes out of put_file script. 2014-06-19 16:20:17 -05:00
Chris Church 4e738e6fa9 Optimize buffer size for put_file. 2014-06-19 15:37:42 -05:00
Chris Church 43a7a5a990 Collapse extra whitespace in encoded powershell scripts. 2014-06-19 14:25:50 -05:00
Chris Church 61c236be9e Fix for creating temp dir with older powershell versions. 2014-06-19 14:25:28 -05:00
Chris Church 243cd877ae Add integration tests for fetch/slurp, make powershell fetch/slurp work as close as possible to existing fetch/slurp modules. 2014-06-19 14:25:28 -05:00
Chris Church a8ca579761 Fix host parameter to vvvvv. 2014-06-19 14:25:27 -05:00
Chris Church 74c43c94cf Allow specifying remote powershell version via environment variable. 2014-06-19 14:24:14 -05:00
Chris Church 8f762a7d15 Update logging based on verbosity, add vvvvv support to show details of put/fetch file. 2014-06-19 14:24:14 -05:00
Chris Church 21ba529fbe Fixes/notes related to slashes in remote paths. 2014-06-19 14:24:14 -05:00
Chris Church 7e8cc65829 Refactor common args used for building PowerShell commands. 2014-06-19 14:24:13 -05:00
Chris Church f7af29680b Add default license boilerplate, refactor common powershell code, fixes for raw/script modules. 2014-06-19 14:24:13 -05:00
Michael DeHaan 35a7c93c76 Added comment about implementation line. 2014-06-19 14:24:13 -05:00
Michael DeHaan 3ac86e57f4 FIXME comment cleanup 2014-06-19 14:24:13 -05:00
Michael DeHaan 80499346d1 Remove stray FIXME 2014-06-19 14:24:13 -05:00
Chris Church 5dcaa30476 Add shell_plugins to abstract shell-specific functions out of runner, add winrm connection plugin, add initial Windows modules. 2014-06-19 14:24:12 -05:00
Eri Bastos a65fd06338 Added quotes around key path - Issue 7713 2014-06-10 16:39:47 -03:00
James Cammarata e5ef0eca03 Merge pull request #6507 from brdo/patch-1
Set keepalive to 5 seconds in paramiko_ssh.py
2014-06-09 23:44:06 -05:00
smoothify e3530dcbc2 Add environmentfilter to random filter, to ensure the result doesn't get cached. Mirrors default jinja filter. 2014-06-09 18:52:39 +01:00
James Cammarata ad97c618cf Add support for relative paths in the file lookup plugin for roles
Fixes #7628
2014-06-04 15:20:59 -05:00
James Cammarata d9df607972 Fix order of merging variables for the combined cache
Fixes #7598
2014-06-04 10:50:41 -05:00
Brian Coca ce8c8ab146 now unique actually works, all operations also now use it to return
unique lists.
2014-06-01 16:32:48 -04:00
James Cammarata 188ab7b952 Check groupnames for None as well as an empty string in add_host
Fixes #7585
2014-05-29 11:01:11 -05:00
James Cammarata feafc4cd8a Merge branch 'fix_mutable_inventory_vars' of https://github.com/banterchat/ansible into banterchat-fix_mutable_inventory_vars 2014-05-27 22:09:25 -05:00
Isao Jonas 72524e1f3b dont mutate inventory vars 2014-05-27 19:07:58 -05:00
James Cammarata fa86eef9f9 Make sure value in regex_replace is a string
Fixes #7551
2014-05-27 14:30:12 -05:00
Brian Coca 8f58ae3305 changed exception handling for hashable test 2014-05-26 08:52:57 -04:00