Commit graph

7163 commits

Author SHA1 Message Date
Brian Coca
60c1155d50 added common azure tags fragment 2016-04-27 16:55:41 -04:00
Peter Sprygada
c43ea83275 fixes #15496
changed to using OrderedDict to preserve order of lines
2016-04-27 14:41:00 -04:00
Toshio Kuratomi
13532027ff Update submodules ref 2016-04-27 07:17:32 -07:00
Toshio Kuratomi
2583f2774d Some beginning python3 porting for urls.py 2016-04-27 07:15:51 -07:00
Toshio Kuratomi
c2efb0b7e6 Update submodule refs 2016-04-27 06:49:17 -07:00
Toshio Kuratomi
a0f397eb6c Fix traceback in fetch_urls when status code is in info as well as the error. 2016-04-27 06:49:12 -07:00
chouseknecht
9ddcf13661
Add aliases 2016-04-27 04:12:47 -04:00
chouseknecht
2e19a1d86a
Updated doc fragment to be consistent with the getting started guide. 2016-04-27 04:02:15 -04:00
Robin Roth
b861083dfb move machine_id back to Facts class 2016-04-27 09:29:39 +02:00
Robin Roth
5626c540ce refactor distribution version parsing
* split code as separate class
* split different distributions as individual functions
* keep program logic mostly identical (for now)
* increase readability, reduce complexity/indentation
* make future testing/refactoring easier
* step towards making distribution parsing independent of the Facts class
* add some changes to make facts.py python3 parsable
2016-04-27 09:15:01 +02:00
James Cammarata
8103793b55 Version bump to 2.2.0 for devel 2016-04-26 16:29:52 -04:00
nitzmahone
8c27018038 update submodule refs 2016-04-26 09:51:16 -07:00
Brian Coca
0652fa0ce6 ran dos2unix and renamed tags cannonical option 2016-04-26 11:27:01 -04:00
Toshio Kuratomi
008bde91a8 Update submodule refs 2016-04-26 07:24:27 -07:00
Rob
bc859eec7e Add shared functionality to return list of security group IDs from list of names (#15054)
* Add shared functionality to return list of security group IDs from list of security group names - this functionality can be used by nearly all ec2 modules

* Improved doc string for get_ec2_security_group_ids_from_names function
2016-04-26 09:17:36 -04:00
Chris Houseknecht
2790929e73 Fix bugs from API version 1.20 testing. (#15586) 2016-04-25 16:07:24 -04:00
Nathaniel Case
250b975704 Clarify exception handling in net modules (#15507)
* Clarify exception handling in EOS

Also modify to EOS to standardize modules. It makes vimdiff a lot less angry

* Move IOS exception handling into Cli

* Move IOS-XR exception handling into Cli

* Move JUNOS exception handling into Cli

* Move NXOS exception handling into Cli

And reorganize to make it match the other modules

* Move OpenSwitch exception handling into Cli

More speculative restructuring here
2016-04-25 16:04:19 -04:00
James Cammarata
50792f46a5 Submodule pointer update 2016-04-25 15:58:44 -04:00
Jonathan Davila
1999e71658 Added basic auth argument spec to utils (#15585) 2016-04-25 14:55:39 -04:00
Matt Davis
8bf1c53b21 winrm connection tweaks for pywinrm (#15584)
added warnings for invalid kwargs
sniff supported authtypes (for new pywinrm)
use default authtypes (for old pywinrm)
error on unsupported authtype
allow no username/password to be specified (kerb SSO)
tested w/ old and new pywinrm
hacky CLIXML parsing of stderr
2016-04-25 14:20:27 -04:00
René Moser
4e0013d161 playbook, include: fix Unexpected Exception: 'NoneType' object has no attribute 'strip' (#15574)
If `include:` statement is used without argument, we get a traceback.
2016-04-25 13:40:49 -04:00
Olivier GROSJEANNE
4647e8b74e HTTPError can also function as a non-exceptional file-like return value (#14915)
* HTTPError can also function as a non-exceptional file-like return value (the same thing that urlopen() returns)

* HTTPError - adding response to info dictionnary

* HTTPError - adding response to info dictionnary

* HTTPError - adding body response to info dictionnary
2016-04-25 13:21:45 -04:00
Jonathan Davila
f296d74329 Documentation fragment. To be used with modules that use basic auth. (#15582)
Supplies a doc fragment for:
- api_username
- api_password
- api_url
- validate_certs
2016-04-25 12:54:11 -04:00
Toshio Kuratomi
2fd7f194c8 Convert byte strings to unicode strings in our task results (#15581)
Fixes #15367
2016-04-25 12:35:25 -04:00
Robin Roth
f7c589b049 get ssh_keys without using distribution info (#15301)
* use list of possible directories directly instead of checking distribution info
* this could fail if someone has keys in one of the other directories, but there could also be custom ssh key directories, which
  are not checked at all
* this is work towards separating Facts from Distribution in facts.py
2016-04-25 12:15:35 -04:00
Darragh Bailey
be17ba67b2 Prevent race in key setup for accelerate daemon (#15299)
Ensure that initial setup in creating the key directory for ansible
accelerate mode keys, and generation/storage of the key for a
particular host are completed in a multiprocess safe manner.

Creating directories/files and then assigning permissions and contents
to them means that paths may exist and satisfy the os.path.exists()
method in python for other processes before they are usable.

Use a combination of locking around operations with use of unique named
files and an OS file system move to ensure that the conditions of
checking whether a file or directory exists, where it is potentially
created by another thread, will only succeed when the file has both the
correct contents and permissions.

Fixes #13850
2016-04-25 12:13:42 -04:00
Matt Davis
2becd79e5f Merge pull request #15314 from nitzmahone/win_reboot
add win_reboot action
2016-04-25 09:13:18 -07:00
Peter Sprygada
2f411c9aa9 fix default REST ports for http and https in openswitch (#15580)
properly uses the right default ports for http (80) and https (443)
2016-04-25 11:42:28 -04:00
Tegan Snyder
bf0da4aa3c add centrify dzdo escalation (#15219)
add dzdo context, and test
2016-04-25 11:24:26 -04:00
Adam Hamsik
2424d57868 Add sas_address and sas_device_handle to ansible disk device facts (#15201) 2016-04-25 11:22:46 -04:00
James Cammarata
1211a0fa12 Fixing the way we iterate over child states for tasks
Previously we were first checking the fail/run state of the child
state for tasks/rescue/always portions of the block. Instead we are now
always recursively iterating over the child state and then evaluating
whether the child state is failed or complete before changing the failed/
run state within the current block.

Fixes #14324
2016-04-25 11:13:44 -04:00
Brian Coca
0f9eaedfa9 added missing alias to docker doc fragment 2016-04-25 10:20:59 -04:00
Toshio Kuratomi
87d2345cf5 Merge pull request #15562 from abadger/ziploader-minor
Quite a few individually minor changes to ziploader
2016-04-25 06:59:22 -07:00
Toshio Kuratomi
bdd73e31dc Have test-module clean up the local temp dir when it exits
Get test-module's debugger switch to do something useful with ziploader modules
2016-04-24 20:44:42 -07:00
Toshio Kuratomi
3ffd55ce7f Don't include "ansible" in the module output as there are a few files in the upper directory (args and the module) 2016-04-24 20:42:14 -07:00
Toshio Kuratomi
3c135ef3f2 Push debug files into a subdirectory to keep things cleaner.
We now have the ansible module directory, ansible_module_*.py script
file and the args file.  Makes sense to push them all into a separate
subdir.
2016-04-24 20:42:14 -07:00
Toshio Kuratomi
e9553c975f Add debug usage to comments in the ziploader wrapper and don't strip comments if ANSIBLE_KEEP_REMOTE_FILES=1 2016-04-24 20:42:13 -07:00
Peter Sprygada
03a77e025d Merge pull request #15569 from privateip/local_action_junos_template
updates action plugin junos_template to guess file format
2016-04-24 13:13:34 -04:00
Peter Sprygada
a1a732e24d updates action plugin junos_template to guess file format
This update will attempt to guess the file format based on the template
extension if the format argument isnt set.  It will also set the commit
comment to the task name if the comment isnt' explicitly defined.
2016-04-24 11:41:00 -04:00
Peter Sprygada
ffd42118d9 Revert "add new action plugin junos_config" 2016-04-24 10:34:29 -04:00
Peter Sprygada
cea6d858bc Merge pull request #15566 from privateip/junos
adds config_format to junos shared module
2016-04-24 08:57:08 -04:00
Peter Sprygada
c4bd1c5a33 Merge pull request #15553 from privateip/local_action_junos_config
add new action plugin junos_config
2016-04-24 08:25:30 -04:00
Peter Sprygada
c87300f9e7 adds check on config_format kwarg in junos
This adds a check to validate the arugment for config_format kwarg in
get_config.  If the specified format is not a valid option, the shared
module will call fail_json
2016-04-24 08:20:14 -04:00
Peter Sprygada
61baf41edc Merge pull request #5 from dgarros/pyez
Add options to get_config to accept format (text, set or xml)
2016-04-24 08:18:10 -04:00
Peter Sprygada
2c90472609 Merge pull request #15410 from privateip/junos
adds support for netconf to junos shared module
2016-04-24 06:57:18 -04:00
Toshio Kuratomi
44e21f7062 Allow AnsibleModules to be instantiated more than once in a module
Fix SELINUX monkeypatch in test_basic
2016-04-23 14:04:45 -07:00
chouseknecht
dc9b784432
Update per PR comments. 2016-04-23 12:47:16 -04:00
chouseknecht
8dc04770b6 Fix syntax error 2016-04-23 12:46:47 -04:00
chouseknecht
48a2165310 Adding docker_common util module. 2016-04-23 12:46:47 -04:00
Toshio Kuratomi
d7189a442e ziploader currently needs absolute imports to know whether to include another module 2016-04-23 07:25:21 -07:00
Yannig Perre
72f17f3ff3 New get_all_subclasses function in basic modules and use it in fact modules. 2016-04-23 07:24:26 -07:00
Yannig Perre
eb18767f91 Visit all network class not just direct sub classes.
Fix for https://github.com/ansible/ansible/issues/15446
2016-04-23 07:24:26 -07:00
Toshio Kuratomi
09605ce806 Fix facts for the FieldAttribute list change in 30a38f9 2016-04-22 16:31:53 -07:00
Peter Sprygada
edbdf0d955 add new action plugin junos_config
This adds a new action plugin for junos for working with the junos configuration
file on the remote device
2016-04-22 15:48:51 -04:00
Peter Sprygada
32329b493d adds support for netconf to junos shared module
Netconf support is provided using the junos-eznc library and the shared
module depends on junos-eznc to be installed on the local Ansible host.  This
commit also adds changes to the netcfg library to handle receiving messages
over netconf.

To use netconf, specify transport=netconf for junos module.  Be sure that
netconf has been enabled on the remote device.
2016-04-22 15:28:53 -04:00
James Cammarata
30a38f94ce Create a special class of list FieldAttribute for splitting on commas
Which we're use on a case-by-case basis if we find people were actually
using comma-separated strings for list values outside of hosts. Support
for doing so is now deprecated and users should instead use the full
YAML syntax for lists of values.

Fixes #15291
2016-04-22 14:21:14 -04:00
Toshio Kuratomi
fcd6d7010d Fixup perms dont rely on privileged user named root (#15482)
* Don't rely on username to check for root privileges

The SSH username isn't a reliable way to check if we've got root privileges on
the remote system (think "toor" on FreeBSD). Because of this check, Ansible
previously tried to use the fallback solutions for granting file access (ACLs,
world-readable files) even on systems where it had root privileges when the
remote username didn't match the literal string "root".

Instead of running checks on the username, just try using `chmod` in any case
and fall back to the previous "non-root" solution when that fails.

* Fail if we are root and changing ownership failed

Since this code is security sensitive we document exactly the expected
permissions of the temporary files once this function has run.  That way
if a flaw is found in one end-result we know more precisely what scenarios
are affected and which are not.
2016-04-22 08:40:34 -07:00
jctanner
76f73dc81f Change the raw module's detection of environment settings. (#15535)
The task_vars datastructure always contains an environment key,
so use the _task.environment property to look for a non-empty
list instead.
2016-04-21 22:58:07 -04:00
chouseknecht
a79e9182e1
Set the name of the user_agent in each mangement client. 2016-04-21 17:51:28 -04:00
Kei Nohguchi
9d5b4fe212 openswitch.py: Use new ops.dc declarative Config(DC) module (#15489)
Instead of using the old OpenSwitch runconfig, we'll use
Mir's new ops.dc declarative config for the DC interaction
with OpenSwitch.  This gives us the clearer separation between
ansible and the OpenSwitch, as well as the performance
improvement done inside the ops.dc module itself.

Squashed the original Mir's change into single commit.

Tested-by: Kei Nohguchi <kei@nohguchi.com>
2016-04-21 17:23:43 -04:00
Brian Coca
a76531ca3a submodule ref update 2016-04-21 16:30:27 -04:00
chouseknecht
af5e4abf66
Rename azure inventory script. Fix bug preventing AD user login via environment vars. 2016-04-21 14:34:08 -04:00
James Cammarata
772d659929 Updating CHANGELOG and extras submodule pointer for new kubernetes module 2016-04-21 13:23:32 -04:00
Toshio Kuratomi
bac47f6281 Update submodule refs 2016-04-21 07:42:08 -07:00
Chris Houseknecht
ba74f5f3e5 Adding docker doc frag (#15494) 2016-04-20 13:56:19 -04:00
Brian Coca
a5d79a39d5 Ensure action plugins remove tmp dirs created (#15501)
fixes #14917
2016-04-20 13:39:12 -04:00
Matt Davis
67e6bd18e4 Merge pull request #15488 from jctanner/AMC-32
WARN if the play or the task attempts to pass environment to the raw module
2016-04-20 10:03:17 -07:00
Toshio Kuratomi
6520312a65 Update submodule refs 2016-04-20 09:17:19 -07:00
Brian Coca
b1c3d2aacb removed unused section regex, corrected group one 2016-04-20 11:52:50 -04:00
Toshio Kuratomi
5fc90058e4 Make ziploader handle python packages as well as python modules 2016-04-19 20:10:51 -07:00
James Tanner
095ec760ac Provide a warning if the play or the task attempts to pass environment to the raw module.
Addresses ansible-modules-core/issues/32
2016-04-19 22:41:46 -04:00
James Cammarata
f32592f092 Merge pull request #14400 from d3matt/FIX/paramiko_lecture
paramiko transport appears to hang if it gets a sudo lecture
2016-04-19 13:31:17 -04:00
Toshio Kuratomi
ee18af48ef Merge pull request #15385 from bjne/mysql_unix_socket
mysql_*: enable mysql connection via unix socket
2016-04-19 10:09:12 -07:00
James Cammarata
a0dea1ac35 Fix var precedence bug introduced in ff9f5d7d
Fixes #14067
2016-04-19 12:40:31 -04:00
Toshio Kuratomi
7b5d2d3bec Make sure that args are interpreted as utf8 on python3 2016-04-19 09:37:17 -07:00
Toshio Kuratomi
e386a51cf8 Trnasform file name to bytes before opening it to avoid unicode errors if python tries to encode it implicitly 2016-04-19 08:33:01 -07:00
Toshio Kuratomi
0a31c24938 Merge pull request #15419 from nitzmahone/module_debug_arg_override
add _load_params debug overrides for module args/file passed on cmdline
2016-04-19 07:49:05 -07:00
Toshio Kuratomi
596f6e0894 Update core submodule ref again for another git fix 2016-04-19 07:44:26 -07:00
Toshio Kuratomi
0e63f09d5a Fix for apt module test failures 2016-04-19 07:36:46 -07:00
Brian Coca
33761efd19 Merge pull request #15417 from bcoca/copy_vaulted
Copy vaulted
2016-04-19 10:22:30 -04:00
Toshio Kuratomi
c8cb5e1042 Update submodule refs 2016-04-19 07:01:50 -07:00
Matt Davis
822f904aa6 Merge pull request #14813 from mattclay/lxd-plugin
Add lxd connection plugin.
2016-04-19 02:06:31 -07:00
James Cammarata
0e2f1b423d Merge pull request #15455 from chemikadze/devel
Fix duplicate host with different uuid created after add_host
2016-04-19 02:50:27 -04:00
James Cammarata
6eefc11c39 Make the loop variable (item by default) settable per task
Required for include+with* tasks which may include files that also
have tasks containing a with* loop.

Fixes #12736
2016-04-19 01:42:40 -04:00
Toshio Kuratomi
d2a7be142e A couple fixes for ziploader:
* Move zipcache temp dir creation into the locked section otherwise it
  races with other workers.
* Catch IOError and turn it into an AnsibleError.  IOErrors can hang
  multiprocessng.
2016-04-18 11:51:45 -07:00
nitzmahone
5b336832af add _load_params debug overrides for module args/file passed on cmdline
Updated python module wrapper explode method to drop 'args' file next to module.
Both execute() and excommunicate() debug methods now pass the module args via file to enable debuggers that are picky about stdin.
Updated unit tests to use a context manager for masking/restoring default streams and argv.
2016-04-18 11:06:46 -07:00
James Cammarata
ed35e8bce2 Don't override the http status code when successful in urls.py 2016-04-18 13:20:24 -04:00
Toshio Kuratomi
7833b5bec4 Merge pull request #15420 from robinro/distribution_version_tests
Distribution version tests
2016-04-18 10:05:55 -07:00
Chris Houseknecht
f28a0ca4bb Update Azure doc fragment (#15450)
* Add default attribute to all option doc strings.

* Fix fragment file name.
2016-04-18 11:05:30 -04:00
Brian Coca
621b98668f fixed boto.ec2 import
alternative to #15224 and fixes #11755
2016-04-18 10:34:44 -04:00
Nikolay Sokolov
d8867d7ce3 Fix duplicate host with different uuid created after add_host
If add_host is performed with hostname existing in inventory, but
not yet accessed and put in inventory cache, additional host with
same hostname and different uuid is created, causing patterns to
misbehave.
2016-04-18 00:10:09 -07:00
Ritesh Khadgaray
3608829b1b vmware.py: allow for better search functionality (#15053)
- search entity by path
 - search vm based on folder
 - search for a vm based on given id ( uuid/name/dns_name/ip/inventory_path)
 - search for a cluster by name, in a given datacenter (optionally)
 - search for objects of a given type in a folder

Note: instance uuid is unique to a VM
2016-04-17 19:10:24 +02:00
chouseknecht
ea07afe67b
Add missing AD user params. 2016-04-17 01:43:39 -04:00
Chris Houseknecht
9e6988c7b5 Merge pull request #15359 from chouseknecht/azure_common
Adding common utils module for new Azure modules.
2016-04-16 04:17:56 -04:00
chouseknecht
98d8da1e67 Adding Azure module doc fragments. 2016-04-16 01:19:59 -04:00
chouseknecht
47620737fb Adding common utils module for new Azure modules. 2016-04-16 01:13:19 -04:00
Matt Clay
5fc76df18b Add lxd connection plugin. 2016-04-15 19:10:57 -07:00
Matt Martz
a985bf6a31 Don't pass context to urlopen, instead add it to the handlers. Fixes https://github.com/ansible/ansible-modules-core/issues/3437 2016-04-15 16:10:54 -05:00
Robin Roth
37188ea336 cleanup tests
* use nose test generator
* more comments
* move facts import inside the skipped function, fix python3 warning
2016-04-15 17:14:14 +02:00
Robin Roth
2b104fe6ad fix tests for SLES and CoreOS
* include #15230
2016-04-15 17:13:59 +02:00
Brian Coca
7062e086d4 made paging marker configurable as boto differs 2016-04-15 10:37:32 -04:00
nitzmahone
e75077fb23 bump submodule refs 2016-04-14 15:57:45 -07:00
Peter Sprygada
9111efc975 adds two new regex filters for use in playbooks (#14696)
The first filter is regex_search which adds the ability to do a regex
search on a fact.  The filter supports returning either all capture groups
or a set of capture groups (either by index or named).

Example usage of regex_search filter

debug: msg="{{ out.stdout[0] | regex_search('image version. (?P<test>\d+).(\d+)', '\\g<test>', '\\2' ) }}"

The second filter is regex_findall with adds the capability to do a
regex findall on a fact or variable and return all occurances of a pattern.

debug: msg="{{ out.stdout[0] | regex_findall('vlan (\d+)' }}"

The filter supports two addtional keyword arguments, ignorecase=[true, false]
and multiline=[true, false]
2016-04-14 14:54:03 -04:00
Brian Coca
5940d3d45b fixes to vault/copy
rm _del_ as it might leak memory
renamed to tmp file cleanup
added exception handling when traversing file list, even if one fails try rest
added cleanup to finally to ensure removal in most cases
2016-04-14 14:12:48 -04:00
Cambell
cdf6e3e4bf feature/copy-vault-dataloader: Add method get_real_file(file_path) to dataloader
- get_real_file will decrypt vault encrypted files and return a path to
  a temporary file.

- cleanup_real_file will remove a temporary file created previously with
  get_real_file
2016-04-14 14:12:48 -04:00
Patrick Ogenstad
6c5ea685a2 Allow timeout to be configurable (#14973) 2016-04-14 09:35:07 -04:00
Toshio Kuratomi
78365e206f Merge pull request #15059 from willthames/remove_boto_ec2_requirement
Remove need for unnecessary boto.ec2 import
2016-04-13 19:37:56 -07:00
Toshio Kuratomi
2163a24a12 Fix when debug commands are run on the wrapper and the wrapper as a file in the current directory 2016-04-13 14:20:01 -07:00
Brian Coca
a5a6bcfbbf updated capabilities to new way of module ref 2016-04-13 14:54:34 -04:00
Brian Coca
b63238ff2c removed unused code for signal handling 2016-04-13 14:54:34 -04:00
Michael Scherer
74c83a91ed Add caps facts, fix #10360 (#15292) 2016-04-13 14:13:45 -04:00
Wolfgang Karall
7a9b8e43da get_mount_facts -- find bind mounts and add info to options field (#12036)
* get_mount_facts -- find bind mounts and add info to options field

* get_mount_facts -- only run findmnt if get_bin_path() finds the binary
2016-04-13 14:05:50 -04:00
Toshio Kuratomi
208ad36ce4 Merge pull request #15344 from abadger/ziploader
Ziploader "recursive imports" and caching
2016-04-13 10:27:01 -07:00
Jonathon Klobucar
7bee994e1c Fix for serial when percent amount is less than one host (#15396)
Ansible when there was a percentage that was calculated to be less than
1.0 would run all hosts as the value for a rolling update.

The error is due to the fact that Python will round a
float that is under 1.0 to 0, which will trigger the case of
0 hosts. The 0 host case tells ansible to run all hosts.

The fix will see if the percentage calculation after int
conversion is 0 and will else to 1 host.
2016-04-13 10:49:38 -04:00
Toshio Kuratomi
afc7ec431a Update submodule refs 2016-04-12 13:55:12 -07:00
Toshio Kuratomi
7d174910c3 Make the ziploader wrapper work with PY3 2016-04-12 11:39:22 -07:00
Toshio Kuratomi
0031e08f7d excommunicate fix 2016-04-12 09:12:58 -07:00
Toshio Kuratomi
55bb24fb7d Reenable unicode=>byte conversion for module parameters to fix integration tests 2016-04-12 08:01:07 -07:00
Toshio Kuratomi
75546678d9 Fix unittests 2016-04-12 08:01:07 -07:00
Toshio Kuratomi
452034564c python-2.4's -m is severely limited.
Extract the module and invoke it as a script to work around python-2.4's
lack of features.
2016-04-12 08:01:07 -07:00
Toshio Kuratomi
b571ecdfec Move module arg passing from the environment to stdin (from the wrapper to the module) 2016-04-12 08:01:07 -07:00
Toshio Kuratomi
dcc5dfdf81 Controller-side module caching.
This makes our recursive, ast.parse performance measures as fast as
pre-ziploader baseline.

Since this unittest isn't testing that the returned module data is
correct we don't need to worry about os.rename not having any module
data.  Should devise a separate test for the module and caching code
2016-04-12 08:01:07 -07:00
Toshio Kuratomi
b5717ef696 First whack at a recursive and ast based ziploader. I'm afraid this one may be too slow. 2016-04-12 08:01:07 -07:00
Toshio Kuratomi
b4b058794e Correct the worker.run documentation 2016-04-12 08:01:07 -07:00
Toshio Kuratomi
c929556226 Fix encoding string to show up in wrapper 2016-04-12 08:01:07 -07:00
Toshio Kuratomi
6bb0e35f85 Update submodule refs 2016-04-12 08:00:20 -07:00
Chris Houseknecht
432bfe5a4f Merge pull request #15364 from gregsidelinger/galaxy-ingore-certs-fix
Fix issue with ansible-galaxy and --ignore-certs
2016-04-12 10:32:02 -04:00
James Cammarata
8ef564176b Handle includes which may have been created in the flow of the playbook
Since 2.0 made all includes dynamic, it is now possible to create and
include a file in the course of executing a playbook. However, with the
introduction of implicit static includes this can cause problems if an
include is thought to be static but does not yet exist. For now, we're
handling missing implicit static includes as a potential dynamic include
but also adding a deprecation message to show includes like this will
need to be marked as `static: no` in the future.

Fixes #15342
2016-04-12 09:33:58 -04:00
Nathaniel Case
7290b6282d Update IOS, IOSXR, JUNOS, & OpenSwitch for environment vars. 2016-04-12 08:55:15 -04:00
Nathaniel Case
dbc49ad95b First implementation of 'fallback' parameter
Implemented & documented for EOS & NXOS
2016-04-12 08:55:15 -04:00
James Cammarata
2e55b3567b Also fix intermittent ssh error using pty's for paramiko
Related to #13876
2016-04-12 08:35:48 -04:00
Bjørnar Ness
d868cdc7b8 enable mysql connection via unix socket 2016-04-12 14:16:18 +02:00
Toshio Kuratomi
0ced20951f Use /var/tmp is user set remote_tmp below /var/tmp.
We want them to be able to influence this choice in case they want to
keep files out of /tmp (perhaps to conserve RAM if that is a tmpfs).
2016-04-11 21:03:13 -07:00
James Cammarata
44877b7c7e Don't use -tt for ssh connections when sudoable=False
Due to an apparent race condition while using pty's on a heavily loaded
system, rarely a request to create a temp directory returns an empty
string rather than the newly created path, causing an error. Disabling
forced pty's appears to resolve the issue, so this patch modifies the
mkdtemp remote call not use -tt as we're not escalating privileges and
thus no pty is required.

Fixes #13876
2016-04-11 23:22:13 -04:00
Toshio Kuratomi
6a97d6386f Always use system /tmp if system=True.
Otherwise unexpected errors can happen when the user sets remote_tmp.

Fixes #15372
2016-04-11 20:00:10 -07:00
Toshio Kuratomi
b27c424fa1 Fixes to the documentation build (#15356)
* Could only have one alias before.  Subsequent aliases overrode the
  previous ones.  Now multiple aliases work.
* Fix BLACKLISTED_MODULES.   Previously, modules were listed in the
  generated documentation despite being blacklisted
* Deprecated modules form extras were showing the (E) tag and not the
  (D) tag. Reversed that now (Probably not necessary to also show the
  E tag).
* Sort the deprecated modules alphabetically in the Category docs as
  well as the list of all modules
* Optimization: Previously rendered the modules to rst twice once in all
  group and once in individual categories.  Fixed to only render them
  once.
* Add fireball to blacklist and remove async_status (as people need to
  use that).
2016-04-11 17:11:55 -07:00
nitzmahone
336b1ae84b add win_reboot action
also includes WinRM connection plugin change to support connection reset
2016-04-11 14:48:39 -07:00
Jesper Geertsen Jonsson
bd0066d621 Adds support for converting a MAC address to an integer.
Example:
---
- hosts: local
  tasks:
    - set_fact: mac_str="52:54:00:00:00:00"
    - set_fact: base_mac="{{ mac_str | macaddr('int') }}"
    - debug: msg="{{ (base_mac|int + 257) | macaddr('linux') }}" # 52:54:00:00:01:01
2016-04-11 20:46:45 +02:00
Greg Sidelinger
11ffc0bfee Fix issue with ansible-galaxy and --ignore-certs
The --ingore-certs flag was not honored for https://server/role.tar.gz roles in the requirements file.
2016-04-11 01:17:15 -04:00
Toshio Kuratomi
54acdd7ead Remove workaround for fixed bug. (#15340)
* Remove workaround for fixed bug.

The bug where PluginLoader required objects to directly inherit from
base_classes has been fixed.  Remove workaround from this strategy
plugin   Also switched to using super so that we don't have to modify
all of hte code anytime something like that happens.

* These should be to_uniocde because they're being sent to display()
2016-04-10 09:24:54 -07:00
Brian Coca
005dc84aa7 moved last utils.debug to display.debug 2016-04-08 16:00:36 -04:00
Kishin Yagami
e4a6106ea5 Add debug strategy plugin (#15125)
* Add debug strategy plugin

* Fix Python 2-3 compatiblity issue

* Add document for debug strategy
2016-04-08 14:39:08 -04:00
Brian Coca
0eb2844cc6 moved display's debug lock to cli as global 2016-04-08 13:08:24 -04:00
Matt Martz
dd39f57ae7 Merge pull request #15289 from sivel/sni-urllib3-contrib-try2
Optional Use of urllib3 for SNI verification
2016-04-08 11:26:49 -05:00
Brian Coca
a7f2588920 updated submodule ref 2016-04-08 11:44:09 -04:00
peter.jang
65856f2231 added suport rsync protocol (#12197)
* added suport rsync protocol

* use startswith method for safety
2016-04-08 11:42:07 -04:00
Toshio Kuratomi
d29b833cb1 Update extras submodule ref 2016-04-08 08:11:43 -07:00
James Cammarata
e5c4f88b71 Fix free strategy, which was incorrectly using _wait_on_pending_results
Broken in 210cf06d
2016-04-08 06:49:16 -04:00
nitzmahone
eac4cf1177 fix options_vars iteration for py3 2016-04-07 19:16:15 -07:00
nitzmahone
83a17662cc update core submodule ref 2016-04-07 18:28:53 -07:00
Strahinja Kustudić
eed6cf5dad Adds 'ansible_check_mode' boolean magic variable
* Makes it possible to pass any options variable to VariableManager
  by changing `load_options_vars(options)` in `lib/ansible/utils/vars.py`
2016-04-08 00:26:02 +02:00
Brian Coca
1942cd33dc draft add group merge priority and yaml inventory
* now you can specify a yaml invenotry file

* ansible_group_priority will now set this property on groups

* added example yaml inventory

* TODO: make group var merging depend on priority

  groups, child/parent relationships should remain unchanged.
2016-04-07 16:22:36 -04:00
Toshio Kuratomi
03ec71e5af Updae submodule ref 2016-04-07 09:43:15 -07:00
Toshio Kuratomi
19737236ee Add "excommunicate" debug option
Some debuggers are easier to work with when we do everything in a single
process.  This debug option caters to that at the expense of being
different from what Ansible will actually do to invoke a module.

When we document this we should be clear that this shouldn't be used for
general purpose debugging and that some modules may show strange
"errors" when used with this.  Those won't be considered real bugs as
it's not how ansible really invokes the modules.
2016-04-07 08:12:25 -07:00
Matt Davis
957b336cc1 skip fixup_perms for Powershell
action plugins will now skip _fixup_perms for Powershell. We'll have to come up with another way to do this at some point, but it's not necessary yet since we don't support become on Windows. Also added NotImplementedError throws to chmod/chown/set_facl operations on Powershell (instead of returning '') in case anyone tries to use them in the future.



fixes #15312
2016-04-07 07:27:01 -07:00
Brian Coca
5225048df9 capture attribute errors for invalid class plugins
also switched to py3 safe to_str
2016-04-07 10:16:35 -04:00
Toshio Kuratomi
fd9838f1a0 Add BSD license information to the ZIPLOADER_TEMPLATE string since it
may be combined with module code.
2016-04-06 21:37:04 -07:00
Toshio Kuratomi
647123ee18 Ziploader subprocess.Popen
* Run the module as a script from the wrapper instead of executing in the same process.

Fixes cornercases where the module could potentially be executed twice
if we import and then run the main() function without calling sys.exit()
somewhere.

Also fixes problem with concurrent.futures() hanging.  Not sure
precisely how this is being triggered but it is related to invoking the
main() function outside of an if __name__ == '__main__' conditional.

* Fix for python-2.6
2016-04-06 21:25:18 -07:00
Toshio Kuratomi
8d46bcaa65 Update submodule refs for git fix 2016-04-06 14:09:50 -07:00
Toshio Kuratomi
a57a32adcc Revert "Make the 'path' param type also use abspath on the value"
This reverts commit 1ffadbcc80.

Some modules seem to have path listed for things that are "commands"  --
something that may be a path to a command or a bare command that should
be looked up in PATH.  With this change, if they were formerly looked up
inPATH they are now being made into an absolute path in the cwd.
Reverting this until we can think more about whether to do this and
change those modules to not use path for those parameters.
2016-04-06 14:07:48 -07:00
James Cammarata
1ffadbcc80 Make the 'path' param type also use abspath on the value 2016-04-06 15:58:49 -04:00
Nathaniel Case
77e3dc9e6a Fix network modules for ziploader changes 2016-04-06 11:54:47 -07:00
James Cammarata
040893a677 Adding a config option to allow disabling locale settings upon module exec
Fixes #15138
2016-04-06 12:19:22 -04:00
Matt Martz
398218b6ea More intelligent building of the SSLValidationError message based on capabilities 2016-04-06 11:04:04 -05:00
Matt Martz
bce79c67c3 Cascade ssh_*args configurations in synchronize instead of limiting to just ssh_args. See https://github.com/ansible/ansible-modules-core/issues/3370 2016-04-06 10:27:58 -05:00
Matt Martz
6e9c09d7f7 Utilize urllib3.contrib.pyopenssl functionality for SNI capability in python versions lacking SNI support
Also add SNI tests, move test_uri to destructive since we are messing with packages for SNI testing
2016-04-06 10:14:13 -05:00
Toshio Kuratomi
edab8d338d Expand tilde after expanding vars 2016-04-05 22:27:07 -07:00
Peter Sprygada
72ce1e8f14 bugfix eos shared module handling config replace
fixes an issue with doing a config replace using eapi where the configuration
wasn't being replaced.
2016-04-05 22:54:23 -04:00
Peter Sprygada
b97c8ce8e7 bugfix netcfg return config as str
fixes issue where netcfg would return out of order configuration
2016-04-05 22:53:44 -04:00
Toshio Kuratomi
4b0aa1214c Ziploader
* Ziploader proof of concept (jimi-c)

* Cleanups to proof of concept ziploader branch:

* python3 compatible base64 encoding
* zipfile compression (still need to enable toggling this off for
  systems without zlib support in python)
* Allow non-wildcard imports (still need to make this recusrsive so that
  we can have module_utils code that imports other module_utils code.)
* Better tracebacks: module filename is kept and module_utils directory
  is kept so that tracebacks show the real filenames that the errors
  appear in.

* Make sure we import modules that are used into the module_utils files that they are used in.

* Set ansible version in a more pythonic way for ziploader than we were doing in module replacer

* Make it possible to set the module compression as an inventory var

This may be necessary on systems where python has been compiled without
zlib compression.

* Refactoring of module_common code:

* module replacer only replaces values that make sense for that type of
  file (example: don't attempt to replace python imports if we're in
  a powershell module).
* Implement configurable shebang support for ziploader wrapper
* Implement client-side constants (for SELINUX_SPECIAL_FS and SYSLOG)
  via environment variable.
* Remove strip_comments param as we're never going to use it (ruins line
  numbering)

* Don't repeat ourselves about detecting REPLACER

* Add an easy way to debug

* Port test-module to the ziploader-aware modify_module()

* strip comments and blank lines from the wrapper so we send less over the wire.

* Comments cleanup

* Remember to output write the module line itself in powershell modules

* for line in lines strips the newlines so we have to add them back in
2016-04-05 11:06:17 -07:00
Matt Davis
6a3670b1f0 Merge pull request #15281 from jpic/fix_plugin_configuration
Regression fix: proper plugin configuration was reset
2016-04-05 10:00:40 -07:00
James Cammarata
0f2b1244d2 Make sure VariableManager has a view of HostVars
Fixes #15261
2016-04-05 11:32:28 -04:00
jpic
da175d0a57 Bugfix: proper plugin configuration was reset
Before this patch, if config was ['/some/path'] then it would enter the
else block and config would be set to [].

The regression this patch fixes was introduced by 700db154.
2016-04-05 14:41:49 +02:00
Peter Sprygada
cca084c89d enhancement to ios shared module connection
this enhancement will cause the module to connect to the remote ios device
the first time a command wants to run instead of building a connection
immediately
2016-04-04 21:53:05 -04:00
Peter Sprygada
c2fac6c808 enhancement to iosxr shared module to lazy connect to device
this update will only connect to the remote device when the first request
is made to run a command instead of building the connection immediately
2016-04-04 21:52:55 -04:00
Toshio Kuratomi
315cfe2f63 Update module refs 2016-04-04 13:23:29 -07:00
Peter Sprygada
39a576697d feature to localize prompt search login to iosxr shared module
this localizes the cli prompt search logic to the iosxr shared module
instead of using the common regexp list in shell.py
2016-04-04 16:07:45 -04:00
Peter Sprygada
73c3f35112 fixes ansible/ansible-modules-core#3304 2016-04-04 16:03:13 -04:00
Toshio Kuratomi
c75b5ba85f Use to_bytes and to_str instead of str as str is unsafe. 2016-04-04 12:57:32 -07:00
Dag Wieers
055aae55f7 Implement own CSVRecoder and CSVReader from documentation
As detailed in the python manual:
https://docs.python.org/2/library/csv.html
2016-04-04 20:32:08 +02:00
Dag Wieers
ac75069ee0 Support different encoding types in csvfile lookup plugin
This fixes #15266.
2016-04-04 14:11:44 -04:00
Peter Sprygada
17f4db19ea adds additional details in exception handling in shell shared module 2016-04-04 08:20:59 -04:00
Peter Sprygada
f5bcd38380 adds additional details in exception handling to ios shared module 2016-04-04 08:20:51 -04:00
Peter Sprygada
008395eda2 bugfix for nxos shared module to not immediately send \n
this fixes a bug in nxos shared module to not immediately send a \n when
the connection is made.  this commit also localizes the prompt handling
to the nxos module
2016-04-04 08:20:41 -04:00
Peter Sprygada
4e497b10b0 bugfix in netcfg to handle multilevel commands
this fixes a bug where netcfg would not properly find a statement that was
more than one level deep
2016-04-04 08:11:32 -04:00
James Cammarata
d358a22542 Modification to 347b282 to prevent running the lookup with empty terms
Fixes #15258
2016-04-03 11:31:18 -04:00
Chris Houseknecht
2dd687acdd Merge pull request #15256 from alikins/galaxy_roles_path_fix_15255
Fix galaxy roles_path cli usage. (#15255)
2016-04-03 02:55:19 -04:00
Peter Sprygada
c0230e6f12 refactors netcfg to pull common functions into shared library
The network config and template modules share a set of common functions that
have been pulled into the netcfg shared module.  This is backwards compatible
with the current implemention in the modules.
2016-04-02 21:48:03 -04:00
Peter Sprygada
437beb001b adds commands key to fail message in eos shared module
The commands the lists the set of commands it tried to configure when
using eapi as a transport
2016-04-02 21:47:08 -04:00
Adrian Likins
05b46091e4 Fix galaxy roles_path cli usage.
If we specify a roles_path from the cli, use a
optparse action callback to make sure the roles_path
is set to a path list.

Fixes #15255
2016-04-02 21:01:13 -04:00
Toshio Kuratomi
dbd17322bf Update extras submodule ref for lxc_container fix 2016-04-02 01:48:11 -07:00
nitzmahone
700db15452 fix unconfigured plugin path case
We tried to expand paths for None- ensure we're not passing [None] in that case, but [] instead.
2016-04-01 20:37:43 -07:00
Brian Coca
dbc5cc9d7a fix issue with plugin load path inconsistency
now assures it is always a list of paths and not just assumes it
this avoids issues of parsing a 'string path' and picking up '/' as
a valid path for plugin loader
2016-04-01 23:14:56 -04:00
Brian Coca
0bd6f3a5e8 correctly adds searchpath as list 2016-04-01 23:14:56 -04:00
Toshio Kuratomi
4ccea9905b Fix async for old style modules and don't send an args file for new-style modules 2016-04-01 20:04:25 -07:00
Toshio Kuratomi
d9ecff9d4f Update submodule refs 2016-04-01 20:03:02 -07:00
Brian Coca
4d4c364ba8 updated module subrefs 2016-04-01 17:56:40 -04:00
Brian Coca
1e06a9f48d verifies required is a boolean 2016-04-01 17:45:02 -04:00
Brian Coca
39bc3e624a show callback exception on debug 2016-04-01 15:04:30 -04:00
Brian Coca
3b667e48ff Merge pull request #15242 from dagwieers/silence-diff-output
On change in diff-mode we don't need to see file content in task output
2016-04-01 12:11:10 -04:00
Dag Wieers
d46af7cda3 On change in diff-mode we don't need to see file content in task output
I was surprised to see complete file content in the (JSON) task output when
in diff-mode. Since we see the diff anyhow, there's no need to send everything
on screen.
2016-04-01 18:03:51 +02:00
Dag Wieers
0d4f627654 Add the method_name to the catchall warning when using callback plugins
Without this you have no clue to where the exception is occuring.
2016-04-01 11:39:54 +02:00
Toshio Kuratomi
837f3dd24d Update submodule refs 2016-03-31 22:03:48 -07:00
Toshio Kuratomi
f29b8e461b Merge pull request #15151 from mattclay/accelerate-unicode
Add to_bytes to file paths for accelerate plugin.
2016-03-31 21:47:33 -07:00
Matt Davis
3f70d7a70d Merge pull request #15144 from mattclay/winrm-test
Add winrm tests and fix exposed unicode errors.
2016-03-31 16:30:45 -07:00
James Cammarata
0656d1466a Adds two variables to facts when a task fails and a rescue block starts
`ansible_failed_task`:
   Contains the task data, essentially a serialized view of the Task() object.
`ansible_failed_result`:
   Contains the result of the task failure, which is identical in function
   to registering the result. Doing so automatically like this saves the user
   from having to register every result in a block and then trying to figure
   out which result had the failure

Similar to the way try/except/finally work, these variables will not be
available in the `always` portion of a block unless there is a corresponding
`rescue` first.

Fixes #12341
2016-03-31 15:29:33 -04:00
James Cammarata
26a4761d0f Fix logic error in script action plug related to use of shell.exists 2016-03-31 15:21:45 -04:00
Toshio Kuratomi
e003ef93fc Update submodule refs 2016-03-31 08:45:19 -07:00
Matt Clay
262c341cda Add connection tests for winrm connection plugin.
These are the same tests used for the other connection plugins,
adapted to use winrm modules and Windows friendly paths.
2016-03-31 08:32:41 -07:00
Brian Coca
e1461ef792 Merge pull request #15200 from wimnat/feature/handle_lists_in_snake_dict_creation
Handle lists during dict recursion
2016-03-31 06:25:11 -07:00
René Moser
c0618794a2 Merge pull request #15213 from resmo/fix/cloudstack-api-secret-arg
cloudstack: fix bug, api_secret always None
2016-03-31 10:05:33 +02:00
Matt Clay
83e53cbb91 Add to_bytes to file paths for accelerate plugin. 2016-03-30 23:23:04 -07:00
James Cammarata
a8dbd3dee9 Pass the variable manager into load_list_of_blocks for include files
Fixes #15194
2016-03-31 00:44:41 -04:00
Brian Coca
4b3257c4fe Merge pull request #15208 from bcoca/constants_pathlist
centralize path list handling
2016-03-30 19:49:18 -07:00
Brian Coca
5dfc013e18 Merge pull request #14971 from bcoca/clear_facts
meta: clear_facts
2016-03-30 19:09:38 -07:00
Brian Coca
5022fe9adc Merge pull request #15209 from temal-/devel
Add '--skip-tags' to ansible-pull
2016-03-30 18:56:06 -07:00
Rene Moser
65e61e340a cloudstack: fix bug, api_secret always None
In case if api args are used, api_secret is None in every cloudstack module.
2016-03-31 00:04:42 +02:00
Nathaniel Case
e4e913b331 Override params from environment variables, if set.
Fix a typo while I'm in the area.

Handle having None set in module.params more intelligently
2016-03-30 17:28:30 -04:00
James Cammarata
eab4ce19f3 Making the return parsing in ActionBase generic for reuse
Now also correctly parses the return value for the _low_level_execute_command
2016-03-30 12:45:21 -04:00
James Cammarata
4fc0aadd84 Only combine vars in include_vars if both are mappings
Fixes #15184
2016-03-30 11:11:26 -04:00
Brian Coca
c09e085480 Merge pull request #14735 from jsok/open_url-netrc
Lookup netrc for credentials in open_url
2016-03-30 07:41:56 -07:00
Malte Krupa
3c954e6572 Add '--skip-tags' to ansible-pull 2016-03-30 16:36:16 +02:00
Brian Coca
92d154f4ef centralize path list handling
move it to constants and avoid duplicating code or misinforming
developers on the nature of the data
2016-03-30 07:16:09 -07:00
Brian Coca
3f6166d2bf always return rc 2016-03-30 07:15:51 -07:00
Rob White
a46de20772 Handle lists during dict recursion 2016-03-30 16:49:02 +11:00
Peter Sprygada
fa6464e807 feature to localize prompt search logic for ios shared module
Prompt search logic is now localized to the ios shared module instead
of using the common regexps in the shell module.  This resolves a number
of problems with ios modules functioning properly
2016-03-29 22:13:38 -04:00
James Cammarata
2be1726350 Don't remove _raw_params from static include args 2016-03-29 21:40:29 -04:00
nitzmahone
05af5c88ea fix Mac chown/chmod -R issue, add error checks
The changes to chown/chmod were broken on Mac (-R was being appended to the end of the command- OSX requires it before the file list).

A number of base action remote setup commands were also blindly proceeding without checking for success. Added error raises for unrecoverable failure cases.
2016-03-29 07:44:09 -07:00
James Cammarata
f2713f764c Take previous jinja2 blocks into account in splitter when we see quotes
Previously, split_args() was not taking print/block/comment depth into account
when splitting things, meaning that if there was a quote character inside an
un-quoted variable (ie. {{ foo | some_filter(' ') }}), it was incorrectly
splitting on the quotes instead of continuing to append to the previous param.

Fixes #13630
2016-03-28 15:43:43 -04:00
Brian Coca
04610106a3 Merge pull request #15173 from mattclay/issue6072
Support remote_user in jail connection plugin.
2016-03-28 09:22:00 -07:00
Brian Coca
e9a4526251 allow bypassing executable setting
if you set executable to an empty string this avoids passing one to the command constructor
fixes #14813
2016-03-28 08:02:27 -07:00
Rob White
a5b05922ed Some helper functions to work with boto3 2016-03-28 21:43:31 +11:00
Brian Coca
c303ed24b5 Merge pull request #15159 from sigio/filter-ip4-hex
Add ip4_hex filter to convert ip-address to hex notation
2016-03-27 14:14:25 -07:00
Brian Coca
b77bba8f9f Merge pull request #15175 from wimnat/feature/camel_case_fixing
Add function to convert CamelCased key names to snake_names
2016-03-27 14:12:23 -07:00
Brian Coca
363384f517 Merge pull request #15174 from mattclay/conn-msg-host
Fix inconsistent/missing host names in messages.
2016-03-27 14:07:13 -07:00
David Wittman
5036d1742c Fix boolean choices in module docs fragments
A few of the docs fragments have the available choices for some params
defined as "BOOLEANS". Because choices accepts a list, it treats
"BOOLEANS" as an iterable and then generates a list composed of each
letter.

Instead, define the available choices as a list of `['yes', 'no']`,
as is common in most other modules.
2016-03-27 15:30:27 -05:00
Toshio Kuratomi
0fffb6c60c Merge pull request #15163 from ansible/synchronize-connection-vs-play_context
Use _connection instead of _play_context for information about the connection
2016-03-27 10:24:46 -07:00
Brian Coca
c6c3fd79c2 Merge pull request #15168 from bcoca/script_exists_fix
Script exists fix
2016-03-26 22:08:13 -07:00
Rob White
ef8c1124d0 Add function to convert CamelCased key names to snake_names 2016-03-26 18:46:50 +11:00
James Cammarata
eff89d6290 Merge pull request #15140 from berlic/args-splitter-exception-context
Show error context in args splitter exception
2016-03-26 01:02:54 -04:00
Matt Clay
5fdc29e00f Fix inconsistent/missing host names in messages. 2016-03-25 21:11:53 -07:00
Matt Clay
b60062bdf9 Support remote_user in jail connection plugin.
Resolves #6072.
2016-03-25 20:15:52 -07:00
Brian Coca
28d20dbe53 moved 'path exists' function to shell
now it will work with powershell/winrm
2016-03-25 12:56:48 -07:00
Toshio Kuratomi
0cabd133ba have to always run dwim() on the path to get the full absolute path.
Fixes #14944
2016-03-25 12:09:30 -07:00
Toshio Kuratomi
e2f5762232 Use _connection instead of _play_context for information about the connection
If we're not delegating then we change _connection into a local
connection midway through the file but we don't change
_play_context.connection (no need to alter that).  When we later check
it in process_remote() we need to know the actual connection, not the
connection that we thought we were going to use at the start of run().
So we have to use _connection.transport in process_remote().  The rest
of the places could use either one (because we have not yet changed to
a local connection) but we go ahead and switch those to
_connection.transport as well to avoid confusion in the future.

Fixes https://github.com/ansible/ansible-modules-core/issues/3136
2016-03-25 09:25:19 -07:00
James Cammarata
f4eb9aac24 Fix --start-at-task which was broken by the setup task revamp
Fixes #15010
2016-03-25 11:32:19 -04:00
Toshio Kuratomi
2adf8f7ec9 Update submodule refs 2016-03-25 07:42:04 -07:00
Mark Janssen -- Sig-I/O Automatisering
b1015d897d Re-add accidentaly removed comment 2016-03-25 15:33:35 +01:00
Mark Janssen -- Sig-I/O Automatisering
73766e0816 Add ip4_hex filter to convert ip-address to hex notation 2016-03-25 15:24:48 +01:00
Matt Davis
afc82f6beb Merge pull request #14930 from mholiv/enable_dollar_as_first_char_in_folder_and_userName
Modified files to use single quotes rather than double for file path.…
2016-03-25 07:14:42 +00:00
Toshio Kuratomi
3221be4340 Reverse boilerplate order because from __future__ must be the first code in the file 2016-03-24 20:08:39 -07:00
Brian Coca
1c4cfee415 Merge pull request #15046 from bcoca/script_raw
removes python requirement to script
2016-03-24 19:52:06 -07:00
nitzmahone
4241106ad2 fix breakage from new recursive=True arg to chmod 2016-03-24 19:47:43 -07:00
Toshio Kuratomi
80e7fbff75 Add python3 compat boilerplate 2016-03-24 18:04:16 -07:00
Toshio Kuratomi
17e8500202 Don't process the same host multiple times
Fixes #14259
2016-03-24 16:43:43 -07:00
Brian Coca
1ebc2fda71 removes python requirement to script
mistakenly added when checksum was made to use stat module
fixed assertion in test
2016-03-24 16:17:58 -07:00
Brian Coca
6768f34b31 Merge pull request #15062 from gechr/gc-subset-superset-filters
Add `issubset` and `issuperset` tests
2016-03-24 16:17:13 -07:00
Thomas Steinbach
870160b8ed fixed some breaks after merging ansible/devel 2016-03-24 22:09:41 +01:00
Thomas Steinbach
cd2c140f69 forwarded docker_extra_args to latest upstream/origin/devel 2016-03-24 21:25:38 +01:00
Toshio Kuratomi
228ad3ca39 Should be errors=strict since we don't want to end up matching hosts like '???' 2016-03-24 09:25:37 -07:00
Toshio Kuratomi
13b295f1ee Fix using non-ascii for inventory hostname patterns with the CLI. 2016-03-24 09:22:35 -07:00
James Cammarata
2c20579a06 Add options to make includes 'static'
* Can be configured in the ansible.cfg for tasks/handlers individually
* If an included filename contains no vars or loops, it will be expanded
  in-place as if it were marked as static
2016-03-24 10:12:51 -04:00
Toshio Kuratomi
f323eb858e nv_por is needed later in the file
Fixes #14654
2016-03-24 06:58:56 -07:00
Toshio Kuratomi
c4a5cf174b Merge pull request #15009 from bcoca/py3_compat_fixes
Py3 compat fixes
2016-03-24 06:55:29 -07:00
James Cammarata
f427955640 Make default var lookup for tasks follow the dep chain
Related to #14296 (@jjshoe's follow-up example on that issue)
2016-03-24 09:51:36 -04:00
Konstantin Suvorov
1c922135a0 show error context in args splitter exception 2016-03-24 16:50:21 +03:00
Brian Coca
5b11494437 python3 compatiblity
remove use of basestring
deal with configparser
2016-03-24 06:39:21 -07:00
Toshio Kuratomi
52e9209491 Don't create world-readable module and tempfiles without explicit user permission 2016-03-23 09:52:19 -07:00
Brian Coca
fdb56e4bad avoid bad path entries 2016-03-23 09:30:48 -07:00
Toshio Kuratomi
728bb7d85e Update submodule refs 2016-03-23 08:32:42 -07:00
Toshio Kuratomi
917da92e2b Get rid of extra trailing space in log messages 2016-03-23 08:01:21 -07:00
Matthew Gamble
7b06ec79e3 Add documentation for squash_actions configuration setting 2016-03-23 20:38:12 +11:00
Matthew Gamble
197e590d7c Small comment improvement in AnsibleModule class 2016-03-23 19:22:18 +11:00
Abhijit Menon-Sen
1b242ffb89 Merge pull request #15111 from xiaket/devel
complete the docstring. Fixed #14794
2016-03-23 13:13:42 +05:30
夏恺(Xia Kai)
f9a9e5e1b9 complete the docstring. Fixed #14794
Signed-off-by: 夏恺(Xia Kai) <xiaket@gmail.com>
2016-03-23 07:24:43 +00:00
Peter Sprygada
5bb876b0e2 fixes issue with getting value with . (dot) in key in netcfg
This commit addresses a problem when attempting to retrieve a value from
the result that includes a dict key using . (dot).
2016-03-23 02:36:48 -04:00
Brian Coca
b4b44b2708 Merge pull request #15086 from robinro/patch-2
remove double read of "path" (/etc/SuSE-release) in facts.py
2016-03-22 16:14:51 -07:00
Brian Coca
43f70d66a5 Merge pull request #15088 from robinro/patch-3
break after parsing SuSE-release in facts.py
2016-03-22 12:12:29 -07:00
Joel
23a74eb125 Sort plugins by basename to support ordering callbacks 2016-03-22 12:12:51 -05:00
Toshio Kuratomi
06d77996da Update submodule refs 2016-03-22 09:21:49 -07:00
Robin Roth
2c28dcc5cb break after parsing SuSE-release in facts.py
All sections that lead to succesful parsing of the version break afterwards, for SuSE-release this break was missing, potentiall causing #14837
2016-03-22 08:12:17 +01:00
Robin Roth
fea5500605 remove double read of "path"
path is already read in line 444, don't reread the file here, but use the existing content
2016-03-22 07:50:04 +01:00
Toshio Kuratomi
3511abb9d9 Merge pull request #15055 from ansible/ansible_sudo_pass-should-override-cli
Fix ansible_sudo_pass inventory variable so that it overrides setting of sudo password from the command line
2016-03-21 13:31:35 -07:00
Toshio Kuratomi
f39a1da360 Merge pull request #15074 from ansible/pluginloader-cleanups
Cleanup some minor issues in PuginLoader:
2016-03-21 12:57:46 -07:00
George Christou
02ad029840 Add issubset and issuperset tests 2016-03-21 19:22:39 +00:00
Toshio Kuratomi
ed9e164b80 Fix ansible_sudo_pass inventory variable so that it overrides setting of sudo password from the command line 2016-03-21 10:20:40 -07:00
Toshio Kuratomi
7ce130212f Cleanup some minor issues in PluginLoader:
* class_only was a keyword arg of get() and all() that was mistakenly
  passed on to Plugins.  Be sure to strip it from the keyword args
  before instantiating Plugins.  (Reworked API probably should either
  not instantiate Plugins or take the args for the Plugin as a separate
  list and a dict.)
* Checking required base_classes was only done in get() and only if
  class_only was False (ie: that Plugin was instantiated).  This meant
  that different plugins could be found depending on whether the call
  was to .get() or to all() and whether it was for classes or instances.
  Fixed so that required base_classes are always checked.
2016-03-21 09:54:37 -07:00
Brian Coca
3ae9a272e0 Merge pull request #14977 from towolf/hide_ok_items_in_actionable
For `actionable` cb plugin also hide ok for itemized results
2016-03-21 08:04:52 -07:00
James Cammarata
ae21d98955 Properly use check_raw when using parse_kv in cli/ code
Fixes ansible-modules-core#3070
2016-03-21 11:00:44 -04:00
Toshio Kuratomi
407f8f934e Merge pull request #14976 from xiaket/devel
use __mro__ for plugin loading when we search for its base class.
2016-03-21 07:32:07 -07:00
Tobias Wolf
4938b98e4e For actionable cb plugin also hide ok for itemized results
The purpose of the `actionable` callback plugin is to hide uninteresting
results.

Also hide the ok results when the task was itemized.
2016-03-21 14:59:57 +01:00
夏恺(Xia Kai)
38092dcc27 import the base class and check whether this obj has the required base class.
Signed-off-by: 夏恺(Xia Kai) <xiaket@gmail.com>
2016-03-21 07:21:54 +00:00
Toshio Kuratomi
9053d0468e Merge pull request #15006 from ansible/local-pipelining
Add changes necessary for enabling pipelining for local connections
2016-03-20 22:12:07 -07:00
Will Thames
f438c074af Remove need for unnecessary boto.ec2 import
Modules shouldn't need to import boto.ec2.
The check was to test if profile_name was supported by boto.
Two years after the introduction of the support, we will now
assume that if people are passing `profile`, they are using
a version of boto that supports it (this requirement is
already documented in the aws documentation fragment)

Also remove even older version check for `validate_certs`

Fixes #1901
2016-03-21 11:00:09 +10:00
James Cammarata
9d2fe2fb2c Fixing role param precedence issues
* Make role param resolution follow the role dependency chain, rather
  than using all roles within the play
* Also move params to be merged in after role vars in general, to match
  our variable precedence rules
* Changes to the way var lookup is done in role helper methods for
  get_vars(), get_inherited_vars(), and get_role_params() to make the
  above possible without trampling on previously merged vars

Fixes #14472
Fixes #14475
2016-03-20 11:09:32 -04:00
Toshio Kuratomi
4a00999875 Update to latest git submodules 2016-03-20 08:03:58 -07:00
Toshio Kuratomi
b80c9b5032 Merge pull request #15049 from mattclay/paramiko-unicode
Add missing to_bytes for cmd.
2016-03-19 22:37:23 -07:00
Matt Clay
24c4384f0e Add missing to_bytes for cmd. 2016-03-19 11:13:38 -07:00
James Cammarata
e4a5bcae3c Merge pull request #14679 from dagwieers/merge_hash_v2
Avoid merging a dict and a AnsibleUnicode
2016-03-19 12:58:42 -04:00
Brian Coca
7a5ff16aee Merge pull request #15042 from RNanney/RNanney-validate_certs
Update nxos.py
2016-03-18 19:32:32 -07:00
Toshio Kuratomi
f5654dced9 Merge pull request #15043 from mattclay/docker-user
Use docker exec -u only when supported.
2016-03-18 18:46:46 -07:00
Matt Clay
ea1a6c56b9 Use docker exec -u when needed and if supported.
If remote_user is given and cannot be set in docker, a warning will
be displayed unless the default container user matches remote_user.
2016-03-18 18:19:41 -07:00
RNanney
8bceff5136 Update nxos.py 2016-03-18 15:55:41 -05:00
James Cammarata
13f3cbaf3b Renaming per-item and retry callbacks 2016-03-18 15:17:43 -04:00
Toshio Kuratomi
60c943997b More doc updates regarding ansible_shell_executable 2016-03-18 09:16:21 -07:00
Toshio Kuratomi
8bdf0d4746 And another doc fix 2016-03-18 09:09:31 -07:00
Toshio Kuratomi
08394df8d0 Update submodule links for docs fixes 2016-03-18 09:06:05 -07:00
Abhijit Menon-Sen
efdac490ff Merge pull request #14924 from mvgrimes/patch-1
Dynamically add ssl key to the mysql config hash iff needed
2016-03-18 20:38:33 +05:30
Brian Coca
d43fc631dd mount facts now include network mounts (nfs) 2016-03-18 07:28:53 -07:00
Brian Coca
b809d23863 fixed typo 2016-03-18 07:04:12 -07:00
Abhijit Menon-Sen
e5460d6a6e Merge pull request #15002 from camradal/devel
add find_host_portgroup_by_name function to vmware utils
2016-03-18 19:32:17 +05:30
Toshio Kuratomi
e25caebe7a Cleanups to docs and rename of inv var 2016-03-18 06:42:37 -07:00
Toshio Kuratomi
8fc1c26c37 Merge pull request #14936 from bcoca/ansible_executable
add ansible_executable inventory var
2016-03-18 06:41:24 -07:00
Toshio Kuratomi
2ba4428424 Catch ValueError as well because of El Capitan provoking a bug in python2's subprocess
Fixes #14895
2016-03-18 05:52:53 -07:00
Abhijit Menon-Sen
a61a3e28da Merge pull request #9776 from MiLk/fixes/git-repo-info-branch
ansible.utils._git_repo_info() now supports branch names with slashes
2016-03-18 18:08:02 +05:30
Brian Coca
db61e9be0c add ansible_executable inventory var
also handle the overrides appropriately
also new executable to set shell type
2016-03-17 18:54:37 -07:00
Thomas Steinbach
14dfad730e use just 'remote_user' as user for the docker connection 2016-03-17 14:39:44 -07:00
Thomas Steinbach
4ac49ed4a8 use remote_user or become_user in docker connection 2016-03-17 14:39:44 -07:00
Brian Coca
5d9b552317 Merge pull request #15024 from bcoca/delegation_vars_fix
ensure we use delegated vars on delegation
2016-03-17 14:33:36 -07:00
Toshio Kuratomi
ab693579a9 Clarify the document about the order of matryoshka shells
(nesting shells)
2016-03-17 14:29:49 -07:00
James Cammarata
1ee6d489ab Make sure tuples returned by _get_item() are handled correctly in formatting
Fixes #14800
2016-03-17 14:19:58 -04:00
Brian Coca
292be944c6 ensure we use delegated vars on delegation
this prevents falling back to connection vars from the inventory_hostname
when matching connection var is not in delegated host.
2016-03-17 11:03:40 -07:00
René Moser
0a457230ab Merge pull request #14982 from Linuturk/GalaxyInitWhitespaceFix
Remove trailing whitespace from the galaxy init Jinja2 template. Defa…
2016-03-17 17:48:08 +01:00
Toshio Kuratomi
2dd6bae9e1 Merge pull request #15003 from ansible/jail-enable-pipelining
Enable pipelining for jail connection plugin
2016-03-17 07:55:36 -07:00
Brian Coca
bc60f52db5 avoid exceptiosn when not being called by CLI 2016-03-17 07:19:35 -07:00
Toshio Kuratomi
e80cd8bcaf Merge pull request #14908 from mattclay/mysql-connect-timeout
Document mysql connect_timeout and update tests.
2016-03-17 07:18:01 -07:00
James Cammarata
0e68c6d6fe Cleaning up use of literal_eval in basic.py AnsibleModule.safe_eval 2016-03-17 02:02:15 -04:00
Matt Clay
6a1f97ad42 Add docs for mysql* modules connect_timeout. 2016-03-16 22:31:48 -07:00
Brian Coca
5ae9955aad Merge pull request #15011 from dagwieers/fix-unreachable-color
Fix the color when unreachable in default cb plugin
2016-03-16 17:02:05 -07:00
Brian Coca
0cb804f0c2 fix lsb fact gathering
was erroring out when rc !=0 also fixed redundant paths
fixes #14965
2016-03-16 17:00:17 -07:00
Brian Coca
d7d47bcd75 Merge pull request #14989 from nifoc/patch-fetch_url
Check return value of get_distribution()
2016-03-16 16:54:11 -07:00
Dag Wieers
ed457ad53b Fix the color when unreachable in default cb plugin
The dedicated color for unreachable errors was not being used in the default cb plugin.
This corrects the color.
2016-03-17 00:18:13 +01:00
qqo
a7f89cac63 fix TypeError: coercing to Unicode: need string or buffer, AnsibleParserError found 2016-03-17 00:56:47 +03:00
qqo
85e843baee Revert "fix TypeError: coercing to Unicode: need string or buffer, AnsibleParserError found"
This reverts commit d1e0719e4c.
2016-03-17 00:50:47 +03:00
qqo
d1e0719e4c fix TypeError: coercing to Unicode: need string or buffer, AnsibleParserError found 2016-03-16 23:47:16 +03:00
Brian Coca
61f05c2e8d strip keys recursively 2016-03-16 13:18:29 -07:00
Toshio Kuratomi
7346e3098a Update extras submodule ref 2016-03-16 13:09:45 -07:00
Toshio Kuratomi
1346c209b0 Add changes necessary for enabling pipelining for local connections 2016-03-16 12:47:52 -07:00
Toshio Kuratomi
a8acd7f93e Enable pipelining for jail connection plugin 2016-03-16 11:39:51 -07:00
Alexey Kalinin
9763e76f6f add find_host_portgroup_by_name function to vmware utils 2016-03-16 11:24:42 -07:00
Toshio Kuratomi
de306eb5da Small cleanup to use class attribute directly instead of property for transport names 2016-03-16 11:22:50 -07:00
Toshio Kuratomi
fee73100c4 Move BUFSIZE to __init__ since it's common to many connection plugins 2016-03-16 11:20:02 -07:00
Toshio Kuratomi
0ca4be6fb5 Update submodule refs for docs fixes 2016-03-16 11:00:56 -07:00
Toshio Kuratomi
ec419446b7 Update submodule refs 2016-03-16 10:19:57 -07:00
Daniel Kempkens
696b68f07a Check return value of get_distribution()
On none-Linux systems `get_distribution()` returns `None`, which fails in `fetch_url`, because the return value of `get_distribution()` is not checked before calling `lower()` on the result.
2016-03-16 10:49:21 +01:00
Toshio Kuratomi
fe278202f2 Fix saving of tracebacks on module failure 2016-03-15 20:31:40 -07:00
Justin Phelps
d604c8c3a6 Remove trailing whitespace from the galaxy init Jinja2 template. Default a description. 2016-03-15 16:27:33 -05:00
Toshio Kuratomi
86080fbaa9 Update submodule refs 2016-03-15 07:49:25 -07:00
Toshio Kuratomi
66328e5200 Merge pull request #14967 from ansible/facts-subset-and-cleanup
Facts subset and cleanup
2016-03-15 07:17:58 -07:00
夏恺(Xia Kai)
cd6d865e27 use __mro__ for plugin loading when we search for its base class.
This would relax the constraint a little bit, allowing subclassing existing plugins.

Signed-off-by: 夏恺(Xia Kai) <xiaket@gmail.com>
2016-03-15 10:01:31 +00:00