Commit graph

14281 commits

Author SHA1 Message Date
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