Commit graph

14438 commits

Author SHA1 Message Date
Adrian Likins
c771ab34c7 Add a encode() to AnsibleVaultEncryptedUnicode (#19840)
* Add a encode() to AnsibleVaultEncryptedUnicode

Without it, calling encode() on it results in a bytestring
of the encrypted !vault-encrypted string.

ssh connection plugin triggers this if ansible_password
is from a var using !vault-encrypted. That path ends up
calling .encode() instead of using the __str__.

Fixes #19795

* Fix str.encode() errors on py2.6

py2.6 str.encode() does not take keyword arguments.
2017-01-04 12:17:19 -05:00
James Cammarata
ac00c8a660 Fixing an iteration bug introduced by fed079e4 2017-01-04 10:34:06 -06:00
Ryan S. Brown
8772e4387b Update ec2_facts with new ap-south region 2017-01-04 10:27:48 -05:00
Kevin Houdebert
2ffb705049 Fix win_robocopy flags argument (#19603) 2017-01-04 14:27:24 +00:00
Matthew
45c57618b3 Have AnsibleModule raise a failure of git is missing in git_config module (#19676) 2017-01-04 14:23:21 +00:00
Rob
927218d99d Fix backward compat change - create custom required_together statement (#19642) 2017-01-04 14:11:56 +00:00
Kash
dceace6bb2 ecs_taskdefinition: Fix missing import camel_dict_to_snake_dict (#19560)
ecs_taskdefinition: Fix missing import camel_dict_to_snake_dict
2017-01-04 13:50:13 +00:00
Dag Wieers
fbec2ecaa8 vmware_guest: Do not match simply by folder (#19823)
This fixes #19077
2017-01-04 09:26:29 +00:00
Dag Wieers
0d9392a3bc vmware_guest: import iteritems (#19821)
Without this change you get this on Python 2.7.5:

    NameError: global name 'iteritems' is not defined
2017-01-04 09:12:29 +00:00
Toshio Kuratomi
0ca3800ae1 Fix traceback on Darwin with Python3
os.write() needs bytes objects on python3 while python2 can work with
either a byte or unicode string.  Mark the DUMMY_CA_CERT string as
a byte string so it will work.

Fixes #19265
Fixes #19266
2017-01-04 00:33:12 -08:00
Serhiy Martynenko
c7637992fe Fix #19189 django_manage bug with python3 filter() returning iterator insted of list 2017-01-03 22:41:43 -08:00
tedder
15e12d2cf2 git ssh wrapper: py3-compatability with strings
Wrap the fh.write(str) in b() to ensure the string is of the proper type in py2/py3. Otherwise, the following error occurs when using its ssh_wrapper:

    An exception occurred during task execution. The full traceback is:
    Traceback (most recent call last):
      File "/tmp/ansible_8r299r6t/ansible_module_git.py", line 1049, in <module>
        main()
      File "/tmp/ansible_8r299r6t/ansible_module_git.py", line 928, in main
        ssh_wrapper = write_ssh_wrapper()
      File "/tmp/ansible_8r299r6t/ansible_module_git.py", line 330, in write_ssh_wrapper
        fh.write(template)
    TypeError: 'str' does not support the buffer interface
2017-01-03 22:09:12 -08:00
Peter Sprygada
4937dd67e4 adds new feature to network_cli (#19848)
In some cases it is desirable to have a send only function that doesn't
wait for the response from the CLI (such as reloading a device).  This
adds a new key to the command json string sendonly that will
achieve this behavior.
2017-01-03 22:33:02 -05:00
Jacky Gao
08e2a5d4fb Contributing new module to manage HUAWEI data center CloudEngine switch. (#19793)
* HUAWEI data center CloudEngine switch module

* HUAWEI data center CloudEngine switch module

* HUAWEI data center CloudEngine switch module

* Update __init__.py

* Update __init__.py

* HUAWEI data center CloudEngine switch module

* HUAWEI data center CloudEngine switch module

* Update __init__.py

* Delete __init__.py

* HUAWEI data center CloudEngine switch module

* HUAWEI data center CloudEngine switch module

* modify init file

* Update cloudengine.py

* Update cloudengine.py
2017-01-03 22:30:59 -05:00
Ted
fd3ae0bf80 Add bigswitch big mon inline chain module (#18631)
* Add bigswitch util

* Add big switch big mon inline chain module

* Add required to access_token doc

* Add controller to doc

* Add validate_certs to doc

* Add author & metadata

* Add BSD license header
2017-01-03 22:26:34 -05:00
James Cammarata
fed079e4cb Fix role completion detection problem
When the same role is listed consecutively in a play, the previous role
completion detection failed to mark it as complete as it only checked to
see if the role changed.

This patch addresses that by also keeping track of which task in the role
we are on, so that even if the same role is encountered during later passes
the task number will be less than or equal to the last noted task position.

Related to #15409
2017-01-03 14:32:44 -06:00
Martin Bektchiev
1c13ddf7c8 Add @ to valid package name characters (#18862)
NodeJS formulae are now named node@<major_version>

E.g. https://github.com/Homebrew/homebrew-core/blob/master/Formula/node@6.rb
2017-01-03 21:05:37 +01:00
Arne Demmers
bd7466d56c Fix key lookup in gather facts flag. 2017-01-03 13:53:07 -05:00
Toshio Kuratomi
70e42f917d Add traceback information to fail_json in atomic move 2017-01-03 10:39:28 -08:00
Eric Lavarde
a601f2c6a3 Add warning to raw and script modules that there is no actual free_form parameter (like for command etc). 2017-01-03 11:46:50 -05:00
Marcos Diez
024e40d5f4 new lookup module: mongodb (#15057)
* new lookup module: mongodb lookup

* fix versionadded for MongoDB Lookup

* tests should run again

* removed use of basestring

* we don't use iteritems anymore

* run tests again

* run tests again2

* run tests again3

* run tests again4
2017-01-03 11:40:02 -05:00
Joseph Price
1ea86bc66a Clarify state=reloaded will start service 2017-01-03 11:34:07 -05:00
Dag Wieers
ffb80926ce Performance improvement using in-operator on dicts
Just a small cleanup for the existing occurances.

Using the in-operator for hash lookups is faster than using .keys()
http://stackoverflow.com/questions/29314269/why-do-key-in-dict-and-key-in-dict-keys-have-the-same-output
2017-01-03 11:31:38 -05:00
tmshn
6a6113e951 [timezone module] Return tzfile from _verify_timezone (fix #19745)
Modification picked from https://github.com/ansible/ansible-modules-extras/pull/3337
2017-01-03 11:20:38 -05:00
Tomáš Karásek
3ebbcbadcf 2 modules for Packet host: packet_device and packet_sshkey (#19005)
* Added 2 modules for Packet Host: packet_device and packet_sshkey

* Fixed comments from @mmlb

* Fixed comments from @gundalow

* Fix typos pointed by @gundalow

* Mention new Packet modules in the CHANGELOG.md
2017-01-03 16:10:17 +00:00
Alexander Gubin
fce9f4f679 shuffle filter: added optional 'seed' parameter 2017-01-03 11:08:36 -05:00
Ivan Bojer
f9385cb972 new module to change admin pwd through ssh (#19247)
* new module

* new ansible 2.3 requirements
2017-01-03 11:02:35 -05:00
Ivan Bojer
addb68f5ca panos_commit (#19244)
* new module

* added METADATA globe

* changed METADATA format from yaml to json
2017-01-03 11:01:31 -05:00
Ivan Bojer
660fab6bea panos_restart (#19245)
* new module

* support latest METADATA requirements
2017-01-03 11:00:15 -05:00
Leandro Lisboa Penz
0296f70f07 Don't use netconf's discard_changes when the device has no candidate cap (#19626)
The discard_changes netconf RPC requires the candidate capability.
We were getting an exception when configuring that kind of device.

Fixes #19529
2017-01-03 10:52:22 -05:00
Gabriele
c58278b1c2 Fixing nxos_ntp when no config exists (#19678) 2017-01-03 10:50:31 -05:00
mathieu bultel
962a592628 Add pacemaker cluster module for being managable with ansible (#19594)
* Add pacemaker cluster module for being managable with ansible

* fix yaml syntax in documentation

* Remove useless dependency

* Import AnsibleModule instead of import *
2017-01-03 15:50:00 +00:00
Ner'zhul
2c17f9becd vmware_guest: module rewrite to add many features & fixes (#19228)
* vmware_guest: various fixes, improvements & additions

* Add template_flag attribute to define if the destination machine is a
template
* Add helper class to create:
  * SCSI controller
  * Disks
  * Network devices
* New feature: create VM without using templates
* New feature: multiple NIC
* New feature: multiple disks
* New feature: custom SCSI controller types (default: paravirtual)
* New feature: NIC can now be E1000 or VMXNet3 (default)
* New feature: customize NIC mac address
* New feature: new disk option autoselect_datastore permit to select the less used datastore. If datastore field is provided, filter the datastore list before selection
* New feature: Implement disk resizing + addition when state=present and VM exists
* New feature: when state=present and vm exists, modify the current CPU, Memory and disk space
* New feature: add guest_id support permitting to customize & change current VM guest ID in VMWare
* New feature: resource pool support
* New feature: change VM configuration without recreating it (CPU, memory, disks, network, guest ID, resource pool)
* Add 'gatherfacts' state to gather facts on a VM instead of previous 'present' state ('present' ensure the VM configuration)
* Add PyVmomiCache class to cache read only object
* Various python code fixes
* Various documentation fixes
* esxi_hostname & cluster are now exclusive
* Drop ips attribute & set ip directly into networks
* Little performance fixes by removing some duplicate calls to VMWare API
* Python 3 portability fixes
* Create many functions to make the code maintainable
* Cleanup some useless attributes

* Add 'suspended' as desired state for VM

* Make guest_id, memory & CPU number optional in reconfiguration mode

* Note: guest_id is now mandatory to create a VM from scratch (not templating)

* Bux fixes + Do network IP optinal + Add network vlan option
2017-01-03 09:48:07 -05:00
Marius Gedminas
b0b7a636d8 authorized_key: support --diff (#19277)
* Refactoring: split readkeys() into readfile() and parsekeys()

* Refactoring: split writekeys() into writefile() and serialize()

* authorized_key: support --diff

* Refactoring: remove no-longer used readkeys()/writekeys()

* Integration test for authorized_key in check mode
2017-01-03 09:32:32 -05:00
Alexander Trost
5c36bd6714 Added set feature for OpenVSwitch bridges (#19692)
See old PR https://github.com/ansible/ansible-modules-extras/pull/2711
2017-01-03 10:01:09 +00:00
Brian Coca
425ab5598e fix wait_for example 2017-01-02 17:16:23 -05:00
Jasper Lievisse Adriaanse
0c0defb63d Recognize pkgin when installed in the global zone on SmartOS 2017-01-02 17:02:22 -05:00
Jonathan Juares Beber
0bf7a7321a fix mongodb_parameter
This is broken the module when using str parameters.

Value is already converted to int, if necessary at line 193
2017-01-02 07:46:21 -08:00
Ner'zhul
9f2d8c2409 Add omapi_host module (#19602)
This module managed DHCPd hosts using OMAPI protocol

Features:
* Add a host
* Remove a host
* Modify host IP (it's impossible to modify only mac or only hostname, this doesn't have any effect)
* Add custom DHCP attributes (at creation only)
2016-12-31 19:09:24 +00:00
Kash
8e0119b24c ecs_taskdefinition: more accurate description in doc (#19204) 2016-12-30 12:30:04 -05:00
Ondra Machacek
9a2b220005 ovirt: get default auth/connection params from environment vars (#19385)
* cloud: ovirt: add possibility specify auth params in env vars

* module_utils: ovirt: fix pep8 issues
2016-12-30 12:24:05 -05:00
Rob
36213e8b21 Fix to fail when task_definition or desired_count not defined and state=present, define that role is required with load_balancers parameter and a few pep8 fixes (#19490) 2016-12-30 10:50:09 -05:00
Ryan S. Brown
0228f741c3 Undo format changes 2016-12-30 10:42:33 -05:00
Rob White
62dfa2ad11 Add helper function so that IAM policies can be compared for equality and update s3_bucket to take advantage of helper function 2016-12-30 10:41:22 -05:00
Tom Paine
e66501b0b7 [docs] update ec2_ami_copy docs to clarify encrypted snapshots (#19641)
Docs formatting.
2016-12-30 10:37:25 -05:00
Tom Paine
7ba746dc1e Update ec2_ami.py (#19636)
- Consistent capitalisation in the descriptions
- Removed redundant 'optional' notes when this is covered by the Boolean `optional` column
- Clarified `instance_id` description
2016-12-30 10:36:29 -05:00
Ondra Machacek
ba9f6326f4 Documentation improvments of oVirt modules (#19668) 2016-12-30 10:35:26 -05:00
Lujeni
427cfd6162 Fix the certificates bodies compare into iam_cert module (#19684) 2016-12-30 10:34:18 -05:00
joernheissler
a5145a41a8 Add 3 new Amazon AWS regions (#19687) 2016-12-30 10:32:21 -05:00
Laurent Goujon
e2c50baf3f Fix broken ec2 volume creation breaks with older boto versions (#1773) (#19723)
Fix issue which prevents creating ec2 instance with extra volumes when
using a older version of boto not supporting volume encryption.

Fix issue #1173
2016-12-30 10:31:35 -05:00
Sean Summers
f8fa772a55 ec2_ami_find: set is_public to 'true' or 'false' (#19250)
* set is_public 'true' or 'false'

Despite being a boolean property, https://github.com/melta/boto/blob/master/boto/ec2/image.py:63 sets is_public = True only if the argument is passed in as the string 'true'. Likewise for False/'false'.

This is a workaround for that bug in boto2, to allow the documented parameter to work with valid yaml values.

fixes #5600

* only set is_public if true
2016-12-30 10:28:13 -05:00
Ivan Nikolov
fcb1a2b6cc Fixed ec2_eip.py when assigning a standard elastic IP. (#19238) 2016-12-30 10:27:04 -05:00
Chris Soyars
e0d4050612 ec2_facts: Add support for ca-central-1 (#19260) 2016-12-30 10:26:09 -05:00
René Moser
f101a9bd73 icinga2_feature: Set LANG since we rely on the output by using regex (#19742)
- remove common return
- add ANSIBLE_METADATA
2016-12-30 09:06:49 +01:00
kuboj
5e17eb3053 added os_aggregate module (#19374)
* added os_aggregate module

* various fixed to os_aggregate module

based on comments by @emonty (https://github.com/ansible/ansible-modules-extras/pull/2873)

* updated shade version requirement
2016-12-29 12:51:34 -05:00
Tom Melendez
7e88df7ebc Adding auth support for google-api-python-client and gcloud-python (#19090)
Support for the Google API and GCloud-Python Clients have been added.

The three libraries:
* GCloud-Python: A new function, get_google_cloud_credentials, should be used.  The credentials-object returned can be passed to any gcloud-python client.  Using this client library requires in the installation of gcloud-python.  This is preferred library for new modules.

* Google API: A new function, gcp_api_auth, should be used to take advantage of services requiring this client.  This client library should be used if the desired functionality is not available in GCloud-Python.  Using this library requires the installation of google-api-python-client.

* libcloud: Existing function, gcp_connect, should be used.  The interface and return values have not changed and existing modules (such as gce, gce_pd and gce_net) should work without modification.  Note that the credentials-fetching code has been refactored out of gcp_connect so that can be reused by all connection functions. To use this function, apache-libcloud must be installed.

Import guards have been added and will only be trigger if a user tries to use a function that is missing dependencies.

Credential-specifying mechanisms (i.e, ansible module params, env vars and libcloud secrets.py) have not changed.  They have been refactored and unit tests have been added to allow for changes going forward. We are deprecating (and removing in a subsequent release) the ability to specify credentials via the libcloud secrets file.  Also, we have deprecated (and also plan to remove in a subsequent release) the ability to use a p12 pem file for a key - the JSON format is strongly preferred.  Deprecation warnings have been added for both of these issues (see the Ansible docs on how to disable deprecation warnings).
2016-12-29 12:33:52 -05:00
Ner'zhul
65f0155d8a Add icinga2_feature module (#19732)
This module permits to tell icinga to enable or disable features
2016-12-29 14:05:22 +00:00
Gaël Lambert
647bf4eceb doc: fix indentation in amazon/rds.py example docs (#19734)
Actual doc give this error

```
fatal: [localhost]: FAILED! => {
    "changed": false,
    "failed": true,
    "invocation": {
        "module_args": {
            "command": "facts",
            "register": "new_database_facts"
        },
        "module_name": "rds"
    },
    "msg": "unsupported parameter for module: register"
}
```

Register should be at the module `rds` level and not at args level in this example :

```
 - rds:
     command: facts
     instance_name: new-database
-    register: new_database_facts
+  register: new_database_facts
```
2016-12-29 08:46:40 -05:00
Tom Melendez
d09ad82e71 Add regex support to gce_tag module, add unit tests and update integration test. (#19087)
The gce_tag module can support updating tags on multiple instances via an instance_pattern field.  Full Python regex is supported in the instance_pattern field.

'instance_pattern' and 'instance_name' are mutually exclusive and one must be specified.

The integration test for the gce_tag module has been updated to support the instance_pattern parameter.  Unit tests have been added to test the list-manipulation functionality.

Run the integration test with:

TEST_FLAGS='--tags "test_gce_tag"' make gce

Run the unit tests with:

python test/units/modules/cloud/google/test_gce_tag.py
2016-12-29 08:45:20 -05:00
George Brighton
a10209cbe9 iptables: Fixes invalid ip6tables option (#19657)
fixes #19656
2016-12-27 08:27:22 +01:00
Jun Guo
31526595c5 docker_image: docs: won't be pushed to private registry without push parameter. (#19691) 2016-12-27 08:15:12 +01:00
Jasper Lievisse Adriaanse
2eb8f4cc70 Add new 'clean' and 'quick' parameters, correspondig to -c and -q in pkg tools (#19680) 2016-12-26 20:57:37 +01:00
Monty Taylor
0bb7149e17 Merge pull request #19653 from Thingee/verify_openstack_images
Verify image exists when passed for open stack server creation
2016-12-26 13:15:20 -06:00
ABond
47c0c71002 Minor grammar change in Digital_Ocean Module doc (#19674) 2016-12-25 00:24:54 +01:00
Matt Davis
f96ac8bff0 fix multiple handler notifications (#19655)
Fixes #19647
Adds integration test to catch multiple handler notifications
2016-12-22 21:33:24 -08:00
James Cammarata
78d4f6bbc1 Removing print debug statements 2016-12-22 19:14:20 -06:00
Tom Booth
a37bc3788b runner_on_async_failed missing arg
missing and argument from CallbackModule
2016-12-22 16:55:46 -08:00
Michael Scherer
dc71f28642 Handle color on multiple line in a cleaner way
When using ansible deployment on git push, git insert "remote:"
at the start of ansible output. If you force the color on ansible,
the "remote:" also get colored if the string to display is on
more than 1 line.

This change make sure that each end of line reset the color, instead
of reseting only at the end of the string.
2016-12-22 16:01:29 -08:00
Timur Vasyunin
5365b81d14 Fix for import 'display' in lib/ansible/plugins/lookup/filetree.py 2016-12-22 15:51:39 -08:00
slohse
27cce305e6 iocage connector that wraps around jail connector. (#17986)
Added iocage connector that extends the jail connector. Uses iocage to translate iocage tags or UUIDs/partial UUIDs to the actual jail name and then uses the jail connector for actual functionality.
2016-12-22 15:34:47 -08:00
azenk
f2458140f6 Lastpass lookup plugin (#16285)
This plugin can be used with the lpass cli interface for lastpass.
[lastpass-cli](https://github.com/lastpass/lastpass-cli)

Example:
Add a lookup to your playbooks/variables somewhere:
```
some_variable: "{{ lookup('lastpass','Some Lastpass entry name or ID', field='username') }}"
```
Usage:
* start a lpass session prior to using ansible
* run ansible
* logout when finished

```
lpass login user@domain.com
ansible-playbook foo.yml
lpass logout
```
2016-12-22 14:47:33 -08:00
Mike Perez
6d32dba3c3 Verify image exists when passed for server creation
If the image doesn't exist, we should fail and raise the error clearly. Fixes #18921
2016-12-22 22:37:59 +00:00
Rob Cutmore
1da6a67c50 Add tests for Git remote URL changes (#16893)
* Update Git tests for set remote URL changes
* Git: report changed when needed in check mode
2016-12-22 13:46:47 -08:00
Sorin Sbarnea
4ebd763de0 py3 compatibility fix reported on #17038 (#19569)
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2016-12-22 11:56:46 -08:00
Nathaniel Case
f7cf96e1a6 fix junos typo (#19648)
closes #19646
2016-12-22 14:56:12 -05:00
Brian Coca
6f5ecb7efd warn when examined group_vars is not dir 2016-12-22 12:39:31 -05:00
Rob
69c14bd003 New module - iam_role (#19486)
* New module - iam_role

* Change policy type to json. Remove wildcard import
2016-12-22 13:58:38 +00:00
Hugh Ma
5b07bbfcfc Stacki host module (#19532)
* moving stacki module to remote_management

* updating docstring with force_install info
2016-12-22 13:53:05 +00:00
Gregory Shulov
6c3de3c299 Initial Commit for Infinidat Ansible Modules (#19429)
* Initial Commit for Infinidat Ansible Modules

Skip tests for python 2.4 as infinisdk doesn't support python 2.4

Move common code and arguments into module_utils/infinibox.py

Move common documentation to documentation_fragments. Cleanup Docs and Examples

Fix formating in modules description

Add check mode support for all modules

Import AnsibleModule only from ansible.module_utils.basic in all modules

Skip python 2.4 tests for module_utils/infinibox.py

Documentation and code cleanup

Rewrite examples in multiline format

Misc Changes

Test

* Add Infinibox modules to CHANGELOG.md

* Add ANSIBLE_METADATA to all modules
2016-12-22 13:18:19 +00:00
Gordon Gao
d9e1e374b2 let chdir support relative path in more modules (#16736) 2016-12-22 00:19:50 -08:00
James Cammarata
b688f11474 Correctly set loader path when using list tags/tasks
Fixes #19398
2016-12-21 21:01:02 -06:00
bart2
cdb35f4ce2 Fixes #16936 - Digest authentication not working in uri module (#18736) 2016-12-21 18:11:42 -08:00
James Cammarata
85bbce9d6b Wrap unhandled errors from lookups in an AnsibleError
This provides better error handling, and prevents errors like KeyError
from bubbliing up to code in odd places.

Fixes #17482
2016-12-21 11:48:18 -06:00
James Cammarata
d70d279c4e Also fix default callback to use ignore_errors param
Rather than the value in the task, which may not be templated.

Related to #18289
2016-12-21 11:37:06 -06:00
Matt Clay
446888ef41 Switch from iteritems to items for py3. 2016-12-21 09:22:54 -08:00
Ganesh Nalawade
0d06b77970 Add 'update' parameter in junos_config module (#19046)
* Add update parameter in junos_config module which supports
configuration action like merge, replace and overwrite.

* Add support for replace along with update
argument
2016-12-21 11:56:55 -05:00
James Cammarata
dd0257b995 Template "original_task" fields in _process_pending_results
Since we no longer use a post-validated task in _process_pending_results, we
need to be sure to template fields used in original_task as they are raw and
may contain variables.

This patch also moves the handler tracking to be per-uuid, not per-object.
Doing it per-object had implications for the above due to the fact that the
copy of the original task is now being used, so the only sure way is to track
based on the uuid instead.

Fixes #18289
2016-12-21 10:09:06 -06:00
Brian Coca
7faa041636 added file flag preservation to atomic_move
preserves existing flag info if possible
2016-12-21 10:56:40 -05:00
Brian Coca
3691c784d2 fix check mode for all options
also simplified code paths and changed import away from *
fixes #19476
2016-12-21 09:36:46 -05:00
Jiri Tyr
91094ec96c Adding ldap_entry module (#19285)
* Adding ldap_entry module

* Introducing explicit option for LDAP attributes

* Fixing requirements of attributes option
2016-12-21 07:37:28 +01:00
Nehal J Wani
e907622121 jenkins_plugin: doc: Specify version as string (#18858)
If the plugin version expected is, say '1.20', then specifying it
as...
    version: 1.20
... will make the YAML parser interpret it as a float, and the
value obtained by the module will be 1.2 instead of 1.20, which
will cause downloading of wrong version of the module.

This patch updates the docs so that users don't face this issue.
2016-12-21 07:32:23 +01:00
Brian Coca
8c5d321a23 simplified unsafe writes 2016-12-20 15:54:10 -05:00
Adrian Likins
727ca6f436 Fix error on 'help module' in ansible-console (#19390)
If 'help xattr' for example, ansible-console would
traceback because module_docs.get_docstring() now
returns 4 values (module metadata was added)
2016-12-20 15:50:29 -05:00
Brian Coca
ebf835045f unique error messages to avoid confusion 2016-12-20 15:25:59 -05:00
Adrian Likins
ab560df15f Fix 3 char indent on AnsibleModule._unsafe_writes (#19542) 2016-12-20 10:36:17 -05:00
Adrian Likins
388510f379 Fix missing imports from sysctl module
This module was missing an import of get_exception()
and had an unused import of 're'
2016-12-20 10:23:48 -05:00
Matthew Gamble
8292cadc7f Tell pacman not to display progress bars
Displaying progress bars is not recommended for any scripted usage of
pacman, such as the ansible pacman module.
2016-12-20 09:47:25 -05:00
Ganesh Nalawade
c3c4ae87dd Add 'update' parameter in junos_config module (#19038)
* Fix # #5839 Add 'update' parameter in junos_config module

Add update parameter in junos_config module which supports
configuration action like merge, replace and overwrite.

* Fix documentation issue

* Fix review comment to add replace argument

Make replace and update argument mutually
exclusive, to support replace for backward
compatibility.
2016-12-20 07:27:26 -05:00
Peter Sprygada
f831ef692c update signature in network plugin (#19545)
Fix call to _update_module_args() to include module_name in the args
2016-12-20 07:07:42 -05:00
Ken Evensen
bcace3cfc4 Gconf2 module (#19540)
* Pull #19267 broke sysctl module.  Minor corrections

* Correct description.  Functional updates
2016-12-20 11:53:49 +00:00
tmshn
112d950794 [timezone module] Check if timedatectl command is actually available 2016-12-19 21:18:12 -05:00
Michael Herold
a532dd915a Adds description for ini_file "section: null" 2016-12-19 21:10:30 -05:00
Matthew Gamble
f24ab68f04 Improve and optimise pacman package installation
Previously, packages were installed one at a time in a loop. This caused
a couple of problems.

First, it was a performance issue - pacman would have to perform all of
its checks once per package. This is unnecessarily costly, especially
when you're trying to install several related packages at the same time.

Second, if a package you're trying to install depends on a virtual
package that is provided by several different packages (such as the
"libgl" package on Arch) and you aren't also installing something that
provides that virtual package at the same time, pacman will produce an
interactive prompt to allow the user to select a relevant package. This
is obviously incompatible with how ansible operates. Yes, this problem
could be avoided by installing packages in a different order, but the
order of installation shouldn't matter, and there may be situations
where it is not possible to control the order of installation.

With this refactoring, all of the above problems are avoided. The code
will now work out all of the packages that need to be installed from any
configured repositories and any packages that need to be installed from
local files, and then install all the repository packages in one go and
then all of the local file packages in one go.
2016-12-19 21:09:25 -05:00
Dag Wieers
93cfe73a76 Report detailed error when internal remote functions fail
This is a redesign in how plugins call _remote_checksum().

- _remote_stat() has been modified to report the real error as
  AnsiblError
- Action plugin **unarchive** calls _remote_stat() directly instead of
   _remote_checksum()
- Action plugin **unarchive** also handles the exceptions directly
- Ensure get_exception() returns native text

Two other action plugins, **template** and **fetch**, also do a remote checksum.
In **template** we already call _remote_stat(), just like we now do for
unarchive, in **fetch** we do call _remote_checksum() and we make the
exact same mistake as the unarchive plugin. So that one could use a
redesign as well.

This fixes #19494

Before:
```
[dag@moria ansible.testing]$ ansible-playbook -v test137.yml
Using /home/dag/home-made/ansible.testing/ansible.cfg as config file

PLAY [localhost]
******************************************************************************************************

TASK [unarchive]
******************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg":
"python isn't present on the system.  Unable to compute checksum"}

PLAY RECAP
******************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0
failed=1
```

After:
```
[dag@moria ansible.testing]$ ansible-playbook -v test137.yml
Using /home/dag/home-made/ansible.testing/ansible.cfg as config file

PLAY [localhost]
*************************************************************************************************************

TASK [unarchive]
*************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg":
"Failed to get information on remote file (/tmp/): sudo: unknown user:
foobar\nsudo: unable to initialize policy plugin\n"}

PLAY RECAP
*******************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0
failed=1
```
2016-12-19 21:04:48 -05:00
Adrian Likins
2597c1236d Better error msg for basic.get_bin_path()
Include the searched paths in the error message.
2016-12-19 20:55:52 -05:00
Adrian Likins
35fef6fb84 Better error message for module unsupported params
Keep track of all the unsupported parameters, and include
all of them in the error message as well as a list of the
supported params.
2016-12-19 20:47:39 -05:00
Fabio Alessandro Locati
06abeea5ad Improve YAML examples - windows/win_package.py (#19407)
* Improve YAML examples - windows/win_package.py

* Fix quote

* Fix typo
2016-12-19 13:58:28 -08:00
Fabio Alessandro Locati
3c64ccd6e1 Make examples in YAML format - windows/win_acl.py (#18836)
* Make examples in YAML format - windows/win_acl.py

* Raw string
2016-12-19 13:57:21 -08:00
Peter Sprygada
c546c12b60 fixes incorrect module name for action plugin (#19535)
This fixes a bug introduced in the action plugin for setting the
module name value for logging
2016-12-19 16:54:31 -05:00
Rezart Qelibari
507b96ff30 user: make system=yes work on Darwin systems. (#19464)
* Update system/user.py module.

Add ability to add real system users with next free system uid (< 500) on macOS.

* Improve syntax in system/user.py module.

Remove complex if else line and replace by simple comparison which yields the same boolean value.

* Remove "True" comparison of user.py.

Remove comparison to true, as it is not pep8 conform.
2016-12-19 16:35:56 -05:00
Chris Houseknecht
71685b3258 Update module_args['rsync_opts'] when connection type is docker (#19531) 2016-12-19 16:08:31 -05:00
Brian Coca
9816addcdc removed too generic 'infrastructure' 2016-12-19 15:25:39 -05:00
Brian Coca
e542976bb7 removed redundant else/return 2016-12-19 15:11:29 -05:00
Toshio Kuratomi
226124956c Allow timeout decorator to handle @timeout as well as @timeout() 2016-12-19 15:09:50 -05:00
Brian Coca
b4bd6c80de fixes to facts timeout
also now handle timeout exception correctly everywhere
2016-12-19 15:09:50 -05:00
Brian Coca
f533f6603c show filename for module 2016-12-19 14:48:19 -05:00
Rob
cfa8ce767b Add new parameters to taskdefinition module - network_mode and task_r… (#19493)
* Add new parameters to taskdefinition module - network_mode and task_role_arn

* Add version_added field for doco

* Change version_added parameter to 2.3
2016-12-19 18:16:35 +00:00
Fabio Alessandro Locati
a080d44a47 Improve YAML examples - system/solaris_zone.py (#19410) 2016-12-19 16:49:47 +00:00
Peter Sprygada
7814546735 cast injected json string to bytes in local modules (#19519)
this change will cast the locally injected ansible args to bytes
from string
2016-12-19 11:34:18 -05:00
Peter Sprygada
2a5a2773c8 adds new module net_command for network devices (#19468)
* new module net_command for sending a command to a network device
* adds unit test cases for module
* only works with connection=network_cli
2016-12-19 11:21:37 -05:00
Rob
b77ab1a6c9 Add support to ec2_eip to associate with a secondary ip address (#19484) 2016-12-19 15:45:38 +00:00
Ken Evensen
58b067532f gconftool2 module (#19461)
* Pull #19267 broke sysctl module.  Minor corrections

* Commit of gconftool2 module
2016-12-19 14:57:31 +00:00
Alex Sergeyev
28a3a13656 Support MariaDB engine version 10.1 (#19483) 2016-12-19 14:28:29 +00:00
redbloodmage
0568adc272 Added some clarity on the token confusion. (#19473) 2016-12-19 13:42:31 +00:00
Peter Sprygada
8f97ddd98a removes network os guess static method (#19467)
For devices that do not support mutliplexing, we cannot automatically
determine the network os.  This removes the os guess static method
from the terminal plugin.  For this devices, the network_os
value must be configured
2016-12-19 07:47:29 -05:00
Matthew
c58461596a Support pacman packages using different types of compression (#19503)
It's possible to compress packages using several different compression
methods, or not compressed at all. Previously, the pacman module only
supported files compressed using xz. This update ensures that all
compression types currently supported by pacman are supported by the
ansible pacman module.

The list of supported compression methods at the time of writing can be
found here:
https://git.archlinux.org/pacman.git/tree/scripts/makepkg.sh.in#n747
2016-12-19 12:08:45 +00:00
Will Thames
87c0c33241 Fix include_role docs to be valid YAML (#19506)
Remove the colon from one of the documentation notes, which was
causing documentation schema validation to fail.
2016-12-19 10:45:01 +00:00
Brian Coca
48dee1b6d0 still needs static for task object 2016-12-16 23:52:11 -05:00
Dag Wieers
39c9c6b942 Ensure that command/shell errors are displayed
This fix ensures that if there are specific module errors (in our case
the python interpreter was not found) then command and shell returns a
proper error.

It also fixes a few other imperfections that we noticed during
troubleshooting:

- Return the real RC if it were available
- Improve a dictionary evaluation using .get()
- Return an RC of -1 if it is unknown (instead of returning 0)

This fixes #18846
2016-12-16 21:46:02 -05:00
Dag Wieers
41614fd8e6 Display proper error on group_vars syntax error
This fix ensures a proper error is shown when a group_vars files cannot
be parsed correctly. Without this patch you get:

```
[dag@moria ansible.testing]$ ansible-playbook test132.yml
ERROR! Unexpected Exception: dictionary update sequence element #0 has length 1; 2 is required
to see the full traceback, use -vvv
```

With this patch you get:
```
[dag@moria ansible.testing]$ ansible-playbook test132.yml
ERROR! Problem parsing file '/home/dag/home-made/ansible.testing/group_vars/test135': line 1, column 1
```

This fixes #18843
2016-12-16 21:13:41 -05:00
Brian Coca
5d82fe545f minor docs and option fixes 2016-12-16 16:17:52 -05:00
Brian Coca
884b529195 removed unused 'static' option
the task level directive is what actually controls this, this option was never used
2016-12-16 15:23:36 -05:00
Jake Morrison
00859a4ced Handle inability to read /proc for ansible_service_mgr. Fixes #18957 2016-12-16 12:28:13 -05:00
Adrian Likins
5cd7a08418 Check solaris 'smbios' is exists before running it
smbios could potentially be None here, possibly causing
the solaris 8/9 failures seen at #19282

Fixes #19282
2016-12-16 12:10:16 -05:00
Ryan S. Brown
5204024f35 s3_sync module: Add ANSIBLE_METADATA parameter 2016-12-16 09:28:45 -05:00
tedder
be7a568b33 New module s3_sync: boto3-powered s3 synchronization
Syncs groups of files faster than the `s3` module and support content
type detection/overriding and globbing.
2016-12-16 09:26:30 -05:00
Fabio Alessandro Locati
f1b5dde4cb Improve YAML examples - packaging/kibana_plugin.py (#19409) 2016-12-16 09:08:38 +00:00
Dag Wieers
2f90091f0a Add an important example for SSHd
Sudoers is a great example to show how you can prevent shutting yourself
out. But SSHd is at least as important to avoid syntax errors causing a
lot of grieve. So I think it deserves a spot in this list :-)
2016-12-15 20:42:51 -05:00
Fabio Alessandro Locati
fb0779f657 Improve YAML examples - windows/win_regedit.py (#19400) 2016-12-15 15:05:18 -08:00
Fabio Alessandro Locati
b6f2565d60 Improve YAML examples - windows/win_template.py (#19408) 2016-12-15 15:04:49 -08:00
Fabio Alessandro Locati
beb6ed08cd Improve YAML examples - windows/win_owner.py (#19406) 2016-12-15 15:00:28 -08:00
Fabio Alessandro Locati
12205598c3 Improve YAML examples - windows/win_acl_inheritance.py (#19405) 2016-12-15 15:00:03 -08:00
Fabio Alessandro Locati
5a87f26658 Improve YAML examples - windows/win_get_url.py (#19404) 2016-12-15 14:59:07 -08:00
Fabio Alessandro Locati
5f8f1fa782 Improve YAML examples - windows/win_iis_webapppool.py (#19403) 2016-12-15 14:57:26 -08:00
Fabio Alessandro Locati
83d0f621da Improve YAML examples - windows/win_iis_webapplication.py (#19402) 2016-12-15 14:56:29 -08:00
Fabio Alessandro Locati
f57418c2c1 Improve YAML examples - windows/win_user.py (#19401) 2016-12-15 14:56:04 -08:00
Fabio Alessandro Locati
9b3d9e1780 Improve YAML examples - windows/win_file_version.py (#19399) 2016-12-15 14:54:12 -08:00
Fabio Alessandro Locati
0aa16b36b7 Make the example in proper yaml format - windows/win_iis_virtualdirectory.py (#18829)
* Make the example in proper yaml format

* Add r
2016-12-15 14:53:30 -08:00
Fabio Alessandro Locati
75bcec0ef5 Fix conflict and typos (#18831) 2016-12-15 14:50:22 -08:00
Nathaniel Case
2405c0bbef Hopefully clear up some junos issues. (#17616) 2016-12-15 17:07:19 -05:00