Commit Graph

1122 Commits (9edf3a749ac137c8b51b8c7a2ba6c63991f162d5)

Author SHA1 Message Date
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
James Cammarata 92f16b3d6f Merge pull request #7539 from jimi-c/issue_7503_freebsd_su_fixes
Fixes for su on freebsd
2014-05-25 15:09:58 -05:00
Brian Coca 0dce5dae26 set theory v2, now can handle non hashable items like dicts 2014-05-25 13:20:55 -04:00
James Cammarata d77a6965b3 Merge module_vars into inject during template instead of updating
This way we won't overwrite values that are stored in the inject
with module_vars that should be lower precedence.

Fixes #7510
2014-05-23 13:36:45 -05:00
James Cammarata 1e672a0fec Fixes for su on freebsd
Addresses multiple issues when using su on freebsd including
* su prompt differs between platforms, so turned that check into a
  regex comparison instead of a simple string comparison
* not using '-c' after su causes problems, so added that for all
  platforms
* fixed quoting issues due to multiple uses of '-c' introduced by
  the above fix

Fixes #7503
Fixes #7507
2014-05-23 10:06:09 -05:00
James Cammarata 32628eef85 Merge pull request #7481 from jimi-c/issue_7396_env_lookup
Don't use listify_ function, when all we want to do is template variable...
2014-05-21 15:02:35 -05:00
WAKAYAMA shirou 56880b76bb fix UnicodeEncode error when using pause module with unicode prompt. 2014-05-22 00:21:14 +09:00
James Cammarata 365bfd732e Don't use listify_ function, when all we want to do is template variables
This was causing a bug in the env module, due to the fact that we now
pass variables for the module through the templating engine combined
with the fact that we split-up the hostvars and setup variables. As a
result, if a variable in the env lookup had the same name as the variable
in Ansible, it would try and template itself over and over again until
the recursion limit would be hit, at which time an empty string was
returned.

Fixes #7396
2014-05-20 13:39:23 -05:00
Matt Martz 0e953c2863 Add run_once task key
This caused the task to act like  bypass host loop plugin and
execute only on a single host. Can be used with delegate_to
2014-05-19 12:33:47 -05:00
James Cammarata 79731ce491 Evaluate changed_when only if task is not skipped
Fixes #7405
2014-05-14 16:04:37 -05:00
James Cammarata 809b931640 Merge pull request #7382 from jimi-c/issue_7366_synchronize_inventory_dir
Do not base synchronize source on the inventory directory
2014-05-13 11:05:19 -05:00
Marco Re 712f4a631c Update ssh.py
Convert to string to fix runtime error due to string concat in self.common_args += ["-o", "User="+self.user] when ansible_ssh_user is numeric
2014-05-13 11:29:19 +02:00
Chris Church d725636469 Correctly initialize combined_cache for hosts if setup is skipped
Fixes #7364
2014-05-12 13:48:11 -05:00
James Cammarata 38c2c60849 Do not base synchronize source on the inventory directory
Fixes #7366
2014-05-12 12:02:38 -05:00
James Cammarata fd27afdc0d Adding ansible_shell_type and basic environment construction on it
Previously we assumed the shell on the target systems were 'sh'-
compliant when formatting environment variables preceding command
strings. This patch corrects that by basing the target shell type
on the DEFAULT_EXECUTABLE setting, which can be overridden on a
per-host basis using the inventory variable 'ansible_shell_type'.

Fixes #7352
2014-05-09 16:29:56 -05:00
James Cammarata 51ef28b0d2 Merge branch 'warn_wrong_sudo_password' of https://github.com/tyll/ansible into tyll-warn_wrong_sudo_password 2014-05-08 14:16:58 -05:00
James Cammarata 2e2e5d5321 Use the existing module_vars during the templating of module_vars
Since some of the vars contained in there may be used in the templating
of other variables. This also reverts e83a494 which originally fixed
issue #6979 but broke some other variable related things.

Fixes #6979
Fixes #7321
Fixes #7332
2014-05-08 13:09:36 -05:00
James Cammarata 77a47dbb2d Merge pull request #7304 from jimi-c/issue_7296_synchronize_relative_path
Make sure dwim'd relative path ends in a "/" if the original does
2014-05-07 12:58:04 -05:00
Chris Church f9c74d6e57 Add integration tests for group_by module. Fixed bug introduced by ansible/ansible#7273 while also fixing issue described in ansible/ansible#6953 2014-05-06 22:30:37 -04:00
James Cammarata 4d118d1c72 Make sure dwim'd relative path ends in a "/" if the original does
Fixes #7296
2014-05-06 13:54:41 -05:00
James Cammarata fd03cc04e6 Merge branch 'devel' of https://github.com/denisphillips/ansible into denisphillips-devel 2014-05-05 09:22:01 -05:00
Veeti Paananen d6f4d9b76d Fix error handling on missing dest with unarchive
fixes #7107
2014-05-04 18:22:00 +03:00
Denis Phillips cd0134d290 Used module_args passed to function instead of from runner 2014-05-04 08:49:12 -04:00
Christian Berendt 6676720ce5 fixed typos found by RETF rules in PY files
rules are avaialble at https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos
2014-05-03 18:40:05 +02:00
James Cammarata deb532c367 Remove OrderedDict references from runner
Fixes #7256
2014-05-02 12:52:36 -05:00
James Cammarata 54b1f820fb Modify the way we set the localization environment
Previously, we set the LANG (and LC_CTYPE) environment variables
directly in the module code and applied them with os.environ().
Instead, we are now pre-pending those variables to the environment
string used to execute the command which allows the user to
override the localization values by setting the environment values
directly (even on a per-task basis):

  - subversion: repo=file:///path/to/repos/svn_über dest=/tmp/svntest
    environment:
      LANG: "C"
      LC_CTYPE: "en_US.UTF-8"

So if a user wishes to default their LANG back to C, they can still
avoid unicode issues by doing the above.

Fixes #7060
2014-05-01 10:34:53 -05:00
James Cammarata 30e4759055 Merge pull request #7208 from jf/copy-module
Fix "no_log=True" option for copy module (fixes #7193)
2014-04-29 16:11:23 -05:00
James Cammarata be4e6d359f Merge branch 'delegate_to_honor_ssh_private_key_file' of https://github.com/renard/ansible into renard-delegate_to_honor_ssh_private_key_file 2014-04-29 15:05:09 -05:00
Jeffrey 'jf' Lim 0bf1a27393 Fix "no_log=True" option for copy module (fixes #7193) 2014-04-30 02:24:16 +08:00
Cédric RICARD b8b0865ec0 Missing 'base64' import 2014-04-25 00:11:27 +02:00
James Cammarata e9d8f0639f Merge pull request #7143 from sivel/ansible-sudo-from-root-fix
Allow sudo to another user from root with the ansible command
2014-04-23 21:11:39 -05:00
Matt Martz eb8759176f Allow sudo to another user from root 2014-04-23 16:14:48 -05:00
James Cammarata 38b49476f8 Merge branch 'raw-script-su-support' of https://github.com/sivel/ansible into sivel-raw-script-su-support 2014-04-23 10:02:13 -05:00
James Cammarata a6068b09ac Fix collision in random filter name by merging functionality
Merges the functionality of the original jinja2 random filter with
the one we provide.

Fixes #7113
2014-04-22 14:21:00 -05:00
James Cammarata 086b877719 Merge pull request #7079 from mscherer/fix_error_whitespace_in_config
Clean a bit more the ssh_args configuration
2014-04-21 10:43:31 -05:00
Michael Scherer c87afc1109 Clean a bit more the ssh_args configuration
If someone add ssh_args = " " to his .ansible.cfg, it will result into
strange failure later :

    <server.example.org> ESTABLISH CONNECTION FOR USER: misc
    <server.example.org> REMOTE_MODULE ping
    <server.example.org> EXEC ['ssh', '-C', '-tt', '-q', ' ', '-o', 'KbdInteractiveAuthentication=no',
    '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no',
    '-o', 'ConnectTimeout=10', 'server.example.org', "/bin/sh -c 'mkdir -p /tmp/ansible-tmp-1397947711.21-5932460998838
    && chmod a+rx /tmp/ansible-tmp-1397947711.21-5932460998838 && echo /tmp/ansible-tmp-1397947711.21-5932460998838'"]
    server.example.org | FAILED => SSH encountered an unknown error during the connection. We recommend you re-run the
    command using -vvvv, which will enable SSH debugging output to help diagnose the issue

The root cause is the empty string between -q and -o, who kinda break mkdir.
2014-04-20 00:47:00 +02:00
Michael Scherer 3a09c99811 Enhance error message about missing ControlPersist
ansible_ssh_args is good for playbook, but in the ~/.ansible.cfg
file, it should be ssh_args in a specific section.
2014-04-20 00:35:10 +02:00
James Cammarata a32dd34359 Make sure HostVars object is instantiated before assigning it
Fixes #7006
2014-04-18 16:23:01 -05:00
Sébastien Gross 22d6572270 Honor ansible_private_key_file for delegated hosts
If a delegated host is not found in the inventory specified
private_key_file for primary host was not used.

This allows running playbooks without having to define any inventory at
all and to use the same ssh private key for both primary host and
delegated one.
2014-04-18 01:48:02 +02:00
smoothify 48bf7a000d Try to pass in item to on_skippped callback. 2014-04-16 15:40:07 +01:00
James Cammarata ba1a6c2e11 Removing .orig file merged in accidentally 2014-04-15 10:58:53 -05:00
James Tanner aad128bac7 Use combined cache for templating module vars
Fixes #6901
2014-04-15 10:56:48 -05:00
James Cammarata 40b958e348 Don't turn complex args back into a k=v string for the synchronize module
Fixes #6951
2014-04-14 16:35:16 -05:00
Aaron Iles a5507275cb Fix localhost tasks with complex executables
Enable the use of executable commands that use command line options with
the localhost command runner. These commands require parsing out the
base executable from the command string to pass to subprocess.
2014-04-14 22:15:39 +10:00
Brian Coca 80cd217eb7 simple random filter 2014-04-09 09:03:38 -04:00
James Cammarata 5ce6c86595 Merge branch 'sudo_pass_typo' of https://github.com/tyll/ansible into tyll-sudo_pass_typo 2014-04-08 14:52:42 -05:00
Serge van Ginderachter d240e2b9fb Introduce an ansible_version dict as runner variable
Given the version:
    "1.6 (ansible_version_var 14499e8bf3) last updated 2014/03/21 17:07:50 (GMT +200)"

  We get the special variable:
    "ansible_version": {
        "full": "1.6",
        "major": 1,
        "minor": 6,
        "revision": 0,
        "string": "1.6 (ansible_version_var 14499e8bf3) last updated 2014/03/21 17:07:50 (GMT +200)"
       }

	modified:   lib/ansible/playbook/__init__.py
	modified:   lib/ansible/runner/__init__.py
	modified:   lib/ansible/utils/__init__.py
2014-04-08 17:14:42 +02:00
James Tanner 318e752b6f Fixes #6845 evaluate changed_when only if task is not skipped 2014-04-07 10:51:04 -04:00
James Tanner 5a65dc3b6a Fixes #6820 fix erroneous missing vault password error when using the template module 2014-04-04 13:06:35 -04:00
James Cammarata 82b24c162e Adding delimiter fixes to action_plugin + fixing local assembling with a delimiter
Also added a new integration test for assemble using local assembly
with a delimiter.
2014-04-03 16:32:35 -05:00
Michael DeHaan 2c7275e8a9 Merge pull request #6835 from sivel/version-compare-filter
Add version_compare filter
2014-04-03 17:07:05 -04:00
James Tanner cdc0819939 Fixes #6088 turn off sudo and su if the connection is local the sudo user matches the current user 2014-04-03 12:02:51 -04:00
jctanner 2a9fcdd87c Merge pull request #6711 from j2sol/raw-unreachable
Treat 255 errors from raw as dark host
2014-04-03 11:16:54 -04:00
jctanner f6db60cbce Merge pull request #6787 from tyll/pull_ssh_prompt
ssh: propagate prompt to _communicate()
2014-04-03 09:55:17 -04:00
Matt Martz 5770428e91 Add version_compare filter 2014-04-02 20:21:30 -05:00
Michael DeHaan 904f331210 Merge pull request #6788 from tyll/pull_ssh_verbose_comments
ssh connection plugin: Make comments more verbose
2014-04-02 17:24:16 -04:00
BoscoMW 39fcbd1f10 Update ssh.py 2014-04-02 15:57:54 +03:00
BoscoMW 165406cf35 Catch permissions errors related to opening a known_hosts file
Catch permissions errors related to opening a known_hosts file
2014-04-02 13:42:07 +03:00
James Cammarata e2d86e4f43 Splitting SETUP_CACHE into two caches, one for host vars and one for setup facts 2014-04-01 16:23:33 -05:00
Till Maas e6cb32f284 ssh connection plugin: Make comments more verbose
Explain _communicate() more.
2014-04-01 09:46:51 +02:00
Till Maas 1da69309e5 ssh connection plugin: Report missing sudo password
If no password is provided, sudo hangs at the prompt. Identify this and
report that the password is missing as an error.
2014-04-01 09:36:59 +02:00
Till Maas 2cae7472ad ssh: propagate prompt to _communicate()
_communicate() uses the prompt variable to detect wrong passwords early,
therefore it needs to be passed to it from exec_command().
2014-04-01 09:24:44 +02:00
James Cammarata b9c044b8c9 Making the exception caught during os.dup of stdin explicit
Related to f23bb34
2014-03-31 13:50:23 -05:00
James Cammarata f23bb344aa Catch errors when duping stdin
Fixes #6657
2014-03-31 13:38:12 -05:00
James Cammarata 4f140be711 Merge branch 'devel' of https://github.com/Synforge/ansible into Synforge-devel 2014-03-31 13:04:56 -05:00
James Tanner efba8b4771 Merge branch 'regexreplace' of git://github.com/jacobweber/ansible into jacobweber-regexreplace 2014-03-31 13:48:13 -04:00
James Tanner 2492c2714a Fixes #5307 set relative paths to the files dir for roles and the inventory dir for non-role tasks 2014-03-31 12:25:40 -04:00
Till Maas b07113f358 ssh: Properly check for wrong su password 2014-03-31 15:51:12 +02:00
Matt Martz 7e3dd1066c Allow raw and script to support su 2014-03-28 16:46:31 -05:00
Paul Oyston 1942a69ed2 Added template call to _executor_internal to allow the passing of arbitrary data to modules. 2014-03-27 17:06:20 +00:00
Jesse Keating 3315ba0b99 Treat 255 errors from raw as dark host
Any other module is able to detect a dark host, but raw was treating 255
as a return code from the module execution, rather from the connection
attempt. This change allows 255 to be treated as a connection failure
when using the raw module.
2014-03-26 16:40:50 -07:00