Commit graph

14764 commits

Author SHA1 Message Date
Ricardo Carrillo Cruz
0e78aab533 Fix copyright and author lines for iosxr lib and iosxr_template 2017-01-18 14:15:28 +01:00
roumano
b8c1321635 Update documentation about ldap_attr (#20351)
Fixing the documentation issue #2035
https://github.com/ansible/ansible/issues/20350
2017-01-18 13:04:50 +00:00
Vladimir Rutsky
18c86bc814 pip: fix example with egg specification (#20371)
pip: fix example with egg specification
2017-01-18 12:40:51 +00:00
Dag Wieers
74ecbebf7a win_unzip: Fix for working 'creates' (#20352)
Also fix an incorrect Exit-Json call.
2017-01-18 11:51:02 +00:00
aperigault
e9704b389b vmware_guest: Fix windows joindomain customization (#20303) 2017-01-18 10:52:51 +00:00
Matt Davis
b2a16379c8 new module: win_path (#20073) 2017-01-17 20:21:04 -08:00
Rene Moser
97491672e4 doc: changelog: add new module cloudscale_server 2017-01-17 23:21:37 +01:00
gaudenz
08e08ac775 new module cloudscale_server (#20175) 2017-01-17 23:15:20 +01:00
Ricardo Carrillo Cruz
825456f279 Merge pull request #20363 from rcarrillocruz/iosxr_template_network_cli
Refactor iosxr_template to network_cli plugin
2017-01-17 20:57:30 +01:00
David M. Lee
fde551fa2a Adding support for Amazon ECR (#19306)
* Adding support for Amazon ECR

This patch adds a new module named ecr, which can create, update or
destroy Amazon EC2 Container Registries. It also handles the management
of ECR policies.

* ecs_ecr: addressed review feeback

 * Renaming ecr to ecs_ecr
 * Fixed docs
   * Removed bad doc about empty string handling
   * Added example of `delete_policy`
 * Removed `policy_text` option; switched policy to `json` type so
   it can accept string or dict
 * Added support for specifying registry_id
 * Added explicit else after returned if clauses
 * Added `force_set_policy` option
 * Improved `set_repository_policy` error handling
 * Fixed policy comparisons when AWS doesn't keep the ordering stable
 * Moved `boto_exception` into the module
2017-01-17 14:45:43 -05:00
Rene Moser
3fbbdcd466 doc: cloudstack: cs_host: fix return docs 2017-01-17 20:39:33 +01:00
Ricardo Carrillo Cruz
ae630fff56 Refactor iosxr_template to network_cli plugin 2017-01-17 20:01:56 +01:00
Brian Coca
ba97a34bb3 minor doc fix 2017-01-17 10:16:32 -05:00
peay
222e1c97be Fixes #19883: Handle INI files without ending newline (#20016) 2017-01-17 10:16:25 -05:00
Brian Coca
d1ebd8f411 created subcat for openvswitch 2017-01-17 10:07:14 -05:00
Steve Pletcher
1a33fa0dd2 Don't escape angle brackets in the Slack module (#19980)
* (Fixes #19579) Don't escape angle brackets in the Slack module

* Remove ampersands from escaped characters, update docs

* typo
2017-01-17 09:51:38 -05:00
Will Thames
5ee5593cbf Improve ansible-galaxy handling of role versions (#12904)
* Improve ansible-galaxy handling of role versions

Ensure that role versions are considered when deciding
whether or not to (re-)install a role.

Issue a warning when the version of a dependency conflicts
with the version of an already installed role

Display what version of a role is being installed
Show the versions when upgrading/downgrading a role.

Implements #11266

* Improve force logic for galaxy version changes

Ensure that force is required to change role versions
2017-01-17 09:49:16 -05:00
Tim Rupp
8d5ee33e0f Adds fallback_persistence_profile and all_policies to BIG-IP virtual servers (#20261)
This patch adds the ability for users to specify a fallback persistence
profile for their virtual servers and a list of policies for the VS.
2017-01-17 07:47:39 +00:00
Rene Moser
b9a1400df5 doc: changelog: new module dimensiondata_network 2017-01-17 08:20:35 +01:00
David M. Lee
b8dd4dd52b amazon: added boto3_conn to GUIDELINES.md (#20305)
* amazon: added boto3_conn to GUIDELINES.md

* Update GUIDELINES.md

Light edits. Good to go.
2017-01-16 21:00:45 -08:00
sirkubax
12628ed7e5 fix https://github.com/ansible/ansible/issues/20183 (#20217)
* fix https://github.com/ansible/ansible/issues/20183

* make it nicer
2017-01-16 21:05:54 -05:00
Matt Davis
883f7ed197 ensure win_reboot warnings value is a list 2017-01-16 14:28:18 -08:00
Matt Davis
c8970fc4e6 Merge branch 'win_reboot-fix' of git://github.com/dagwieers/ansible into HEAD 2017-01-16 14:11:27 -08:00
Adam Friedman
4b6201ce0d New dimensiondata network (#19325)
* Add dimensiondata_network module

* Remove shebang

* Use Python-2.4-compatible exception handling.

* Ok, add shebang back in.

* Add 'mcp_user' and 'mcp_password' parameters'.

As suggested by @abadger, these values will now be used for CloudControl credentials, but will fall back to existing behaviour (environment variables and dotfile).

* Minor fixes based on feedback for ansible/ansible#19325.
2017-01-16 13:49:10 -08:00
Maarten Bezemer
1f1379ea61 Support forced SSL-verified connection with given CA certificate 2017-01-16 12:17:10 -08:00
Toshio Kuratomi
09ceaafd42 Removal wildcard import and unnecessary exception retrieval 2017-01-16 12:12:00 -08:00
Brian Coca
06e30485ea moved univention into cloud 2017-01-16 14:43:17 -05:00
Dag Wieers
7be39ca553 Windows modules: Add -type "path" to path parameters (#20282)
This PR is based on #20164 functionality to specify the parameter type
(e.g. as done for python modules).

In this case only -type "path" has a specific meaning, as it will expand
environment variables for paths. Which is typically done on Windows.

So you can do:

  - win_copy:
      src: files/some.doc
      dest: '%UserProfile%\My Documents'
2017-01-16 11:39:58 -08:00
Matt Davis
b773ae4291 Preserve exit code in winrm exec (#20166)
Raw winrm exec discards the exit code from external processes- this change preserves the exit code if present.
2017-01-16 11:21:48 -08:00
James Cammarata
af96cba7e1 Fix for bug in Conditional for older jinja2 versions
Fixes #20309
2017-01-16 13:06:09 -06:00
Dag Wieers
b369ea570a win_shortcut: Create, manage, remove Windows shortcuts (#20164)
* win_shortcut: Create, manage, remove Windows shortcuts

This modules manages Windows shortcuts and all its properties.

The module is idempotent and supports check-mode.

This relates to #19694

* Changes required after @nitzmahone review

* Added -type "path" to parameter definitions

* Small fixes

- Add conversion from window style name to window style id
- Fix error message output (Why didn't the original work ?)
2017-01-16 10:51:56 -08:00
Brian Coca
32b7f85f6c clarified docs on timezone module 2017-01-16 11:05:36 -05:00
Jasper Lievisse Adriaanse
b0e23049a0 Timezone: Support for FreeBSD/NetBSD and improve SmartOS handling (#20268)
* Tweaks for SmartOS:

- prevent attempting from changing timezone in the global zone (read-only)
- provide meaningful error message in the unlikely case smtools isn't present

* Add support for FreeBSD and NetBSD to timezone module
2017-01-16 10:54:39 -05:00
nerzhul
90d94bd6db vmware_guest: doc fix 2017-01-16 10:09:52 -05:00
Dag Wieers
439ef46898 vmware_guest: networks definition as a list (#19857)
* vmware_guest: networks definition as a list

Currently the networks definition is a dict, with the network range as
key. This is problematic if the network information is coming from other
sources.

This patch turns the networks definition into a list.

This fixes #19222.

* Remove the option to provide either netmask or network

It is more concise if there's only one way to configure it.
So provide both `ip` and `network`.

(I also re-indented a section due to a useless check)

* Fix bugs reported by @dav1x

Thanks !
2017-01-16 09:30:37 -05:00
Dag Wieers
20df62ab31 vmware_guest: Various fixes and changes
Changes missing from a poor merge probably, but also a few new things.
- Reordered the examples from important (often used) to less important
  (fewer used)
- Remove the new_name: option and replace it with the uuid/name
  combination for renaming + added example
- Added an example using the VM uuid instead of the VM name
- Also check whether the password is non-empty (rogue merge)
- Wait for all tasks to finish (to be sure the new facts reflect the
  state)
- Ensure that on failure we still set the change-bit
- Moved a set of functions that are unused (related to transfering
  files to guest, or running commands) to module_utils
2017-01-16 09:26:17 -05:00
Peter Sprygada
efda0323be fixes the timeout source in network_cli (#20302)
Timeout should be taken from the play context not the constants.  this change
updates network_cli to source timeout from the correct place
2017-01-16 09:15:46 -05:00
Dag Wieers
bd793b85bf Fix typo in my example (#20293)
I noticed I was missing the -f flag to make this work correctly.
2017-01-16 14:12:34 +00:00
jayme-github
f813a8474b Allow the use of paths like ~/.project.json (#16064)
* Allow the use of paths like ~/.project.json

This makes it easy to manage credentials files outside of the repo
(and/or user specific credentials).

* Fix format string to log credentials_file.
2017-01-16 09:10:16 -05:00
Peter Sprygada
2c197343f3 adds timeout check when network_cli run without persistence (#20299)
* checks if signal hander is set and sets it if not (will be set if coming
  from ansible-connection)
* will now timeout long running commands based on DEFAULT_TIMEOUT setting
2017-01-16 08:32:45 -05:00
Mohammed Naser
ca9387dc0b Pop password from os_user params
The password param conflicts with os-client-config's password grabbing.
The rest of the params really probably should also be popped - but
keeping this just to password for now. Will follow up with a change that
does an audit of all the os_ modules

This patch was previously contributed by @emonty to the former
ansible-modules-core repo however since the merge, it was closed
and not completed.  This patch includes the necessary changes cleaned
up to work with the latest release of Ansible.  This has been
tested to work internally
2017-01-14 08:32:27 -05:00
James Cammarata
b7cdc21aee Additional security fixes for CVE-2016-9587 2017-01-13 16:22:53 -06:00
Tobias Wolf
f1ae2eb4f1 systemd: Add boolean option to enable --no-block
In our environment we have custom services that need to be stopped and
restarted very gracefully to not interrupt active sessions.

A stop job, depending on the state, can take up to 20 minutes until the
process exits. It simply reacts to SIGTERM with a graceful shutdown.

By default, systemctl blocks until the job has completed, which leads to
Ansible hanging on this task for up to 20 minutes.

Thankfully systemctl supports the `--no-block` flag which lets the job
continue in the background.

This PR adds support for that flag as the `no_block` boolean option.

From the man page:

   --no-block
       Do not synchronously wait for the requested operation to
       finish. If this is not specified, the job will be
       verified, enqueued and systemctl will wait until the
       unit's start-up is completed. By passing this argument,
       it is only verified and enqueued. This option may not be
       combined with --wait.
2017-01-13 16:26:06 -05:00
Dag Wieers
1ad55ec9de Consistent path attribute for file-related modules
Not all file-related modules consistently use "path" as the attribute to specify a single filename, some use "dest", others use "name". Most do have aliases for either "name" or "destfile".

This change makes "path" the default attribute for (single) file-related modules, but also adds "dest" and "name" as aliases, so that people can use a consistent way of attributing paths, but also to ensure backward compatibility with existing playbooks.

NOTE: The reason for changing this, is that it makes Ansible needlessly harder to use if you have to remember that e.g. the xattr module requires the name attribute, the lineinfile module requires a dest attribute, and the stat module requires a path attribute.
2017-01-13 15:49:42 -05:00
Brian Coca
08ef0aee25 removed bad iteration from execute meta (#19958)
* removed bad iteration from execute meta

most of the tasks should not be iterated over, others needed to include unreachable hosts
fixes #19673

* corrected host var
2017-01-13 14:51:39 -05:00
Jasper Lievisse Adriaanse
e9038d8dc1 Add support for OpenBSD and SmartOS to timezone module 2017-01-13 14:45:54 -05:00
Jasper Lievisse Adriaanse
64692e7a89 Annotate boto3 dependency in the standard location. 2017-01-13 14:36:17 -05:00
Matt Martz
8928adf62e Updates uri to use six for isinstance comparison for py3 compatibility (#20239) 2017-01-13 13:16:21 -06:00
Matt Martz
d25a70846f Only add Content-Type if not specified in headers. Fixes #20046 (#20234)
* Only add Content-Type if not specified in headers. Fixes #20046

* Update documentation to indicate body_format will not override Content-Type if specified in headers
2017-01-13 13:19:38 -05:00
Jasper Lievisse Adriaanse
0988de8c4c Remove outdated requirements and add a note trying to reflect reality. 2017-01-13 12:16:23 -05:00
Brian Coca
1880027da1 better cleaning of module return, also warn
disallow any internal _ansible_ vars and also warn when those or any on the restricted list are attempted
harden and parameterize key cleaning
2017-01-13 12:12:56 -05:00
Mark Maglana
b598575213 module_utils/dimensiondata (#17604)
* Add dimensiondata.py in module_utils

This is required by the Dimension Data modules under
lib/ansible/modules/extras/cloud/dimensiondata

* Implement change requests from PR #17604

Requests are listed in:
 https://github.com/ansible/ansible/pull/17604#pullrequestreview-819380

* Changes requested for Ansible PR #16704.

As noted by @abadger:

- Use Py3-compatible import syntax for ConfigParser.
- Use comprehensions instead of filter function.
- Fix buggy comparison of False to 'False'.
- Change b_dict to block_dict.
- Fix invalid syntax for except block that handles multiple exception types.

* Additional changes requested for Ansible PR #16704.

As noted by @abadger:

- Missed a couple of places where we still had invalid exception-handling syntax.

* Remove shebang from dimensiondata.py (Ansible PR #16704).

* Switch to MCP_USER / MCP_PASSWORD.

This is consistent with other Dimension Data Tooling.

* Implement get_configured_credentials.

* Fix typo (missing comma).

* Unify get_credentials implementation (ansible/ansible#17604).

get_credentials will now look in environment, dotfile, and module configuration for credentials (in that order).

* Resolve user Id and password from module configuration before trying environment or dotfile (ansible/ansible#17604).
2017-01-12 20:50:43 -08:00
Ivan Bojer
c7638be525 new module to manipulate DAG table (#19885)
* new module to manipulate DAG table

* changes based on the review comments; remove unecessary if statements; change returned value docstring
2017-01-12 22:27:09 -05:00
Ivan Bojer
8b674cd903 Panos check module to test FW readiness to accept new configuration(s) (#19882)
* new module to check FW readines

* added missing parameter

* changes based on the review comments; remove unecessary if statements; change returned value docstring
2017-01-12 22:26:19 -05:00
Ivan Bojer
05adfd6d8c new panos module that allows for NAT policy creation (#20161)
* - panos module that allows NAT policy creation

* remove terciart operator

* minor doc changes
2017-01-12 22:24:29 -05:00
Peter Sprygada
6ef9a0af4b fixes up doc strings in ios modules (#20210) 2017-01-12 21:48:58 -05:00
Will Thames
4bfed06514 Make ModuleArgsParser more understandable (#13974)
* Make ModuleArgsParser more understandable

Both comments and method names for handling new/old
style parameters are switched around

Made comments and method names reflect actual code paths
taken.

* Further improve mod_args.py comments

Ensure output formats are correctly documented,
remove some of the 'opinion' about which formats are
valid, and try and clarify the situations under which
certain code paths are hit.

Stop talking about the YAML command-type form as 'extra
gross' when it's the documented example form for command
etc.!
2017-01-12 18:22:54 -08:00
defunct
92b26a28b8 Update ec2_ami_copy to boto3, fix encrypted support (#20009)
* Update ec2_ami_copy to boto3, fix encrypted support

* docs, backwards compat options, more verbose exception handling

* minor option changes, fix documentation

* update documentation
2017-01-12 19:39:32 -05:00
Peter Sprygada
fec773a2b4 better error handling and log messages in network_cli (#20204) 2017-01-12 19:31:35 -05:00
Matthew Dawson
0ffacedb3e Fixes #3539 "win_robocopy does not return changed properly" (#20158)
* Fixes #3539 "win_robocopy does not return changed properly"

Remove .win_robocopy from $result so that ansible can see the values properly. This also matches up with the existing documentation.

* Update documentation to match new return values
2017-01-12 15:04:14 -08:00
Jasper Lievisse Adriaanse
232cb764da Add RETURN section, fix identation and apply flake8 recommendations (#20148) 2017-01-12 14:58:07 -08:00
Tareq Alayan
e40ad1ac17 cloud: ovirt: add ability to override luns (#20144)
Add the ability to wipe used luns when adding new iscsi storage
2017-01-12 14:13:50 -05:00
Brian Coca
8c6b5621f8 deal with remote_src and tmp dirs properly
fixes #20128
2017-01-12 14:10:11 -05:00
Boris Manojlovic
02b548dba2 add AIX mounts information (#10431)
* add support for AIX mount facts

* add nfs mount support for AIX mount facts

* make nfs parsing a bit more resilient and correctly parse options if provided

* self.module.xxx call instead of wrong module.xxx
2017-01-12 13:15:08 -05:00
Brian Coca
74421f42e1 ansible doc does not need plugin deprecation error 2017-01-12 13:09:15 -05:00
Jasper Lievisse Adriaanse
2ea5bb8dbb Fix required_one_of in timezone module (#20185) 2017-01-12 16:35:14 +00:00
Alvaro Aleman
1b2ad94496 Configurable fact path (#18147)
* Make fact_path configurable

* Add docs for fact_path

* Add tests for localfacts

* Default fact gathering settings in PlayContext
2017-01-12 10:49:04 -05:00
Brian Coca
f078946ed3 no calls plz 2017-01-12 10:35:26 -05:00
Brian Coca
e35a757ee7 fixed typo 2017-01-11 21:11:12 -05:00
William Shallum
1e2bd3d483 maven_artifact: Make default repository_url work again (#19194) 2017-01-11 18:59:00 -05:00
Michael Kwardakov
0183a148c5 Update cronvar.py (#19227) 2017-01-11 18:56:34 -05:00
Michael Scherer
6221327b13 Add DHCP leases to the facts return by the module (#19700)
On RHEL 6, where the feature is not present, this will
be ignored and return nothing.
2017-01-11 18:38:38 -05:00
Toshio Kuratomi
eeebd51f21 Rename the type filter to type_debug
Because we add the names of all filters to the callable whitelist used
by safe_eval, adding a filter named type makes it so code calling "type()"
gets eval'd.  We can't think of a way to exploit this but it's
sufficiently sketchy that we're renaming it in case someone smarter than
us can think of a problem.
2017-01-11 14:48:21 -08:00
Peter Sprygada
4cdb266dac adds iosxr_system declarative module (#20134)
* adds new module iosxr_system
* adds unit test cases for module
2017-01-11 17:17:37 -05:00
Jamie Lennox
27d218f85d Don't use rsync-path in synchronize with docker
When you become: with synchronize and docker it sets the rsync-path to
"sudo rsync" to launch rsync on the server as root. Unfortunately due to
docker exec doing stricter argument parsing than ssh this fails to
launch rsync on the server and the sync fails.

For docker though we don't need to launch rsync with sudo we can simply
docker exec -u <user> and rsync as normal to get around the problem.

Closes #20117
2017-01-11 14:01:11 -08:00
James Cammarata
a94a48f85f Partial revert of 76f7ce55 2017-01-11 15:53:04 -06:00
James Cammarata
d316068831 Additional fixes for security related to CVE-2016-9587 2017-01-11 15:53:04 -06:00
Computest
bcceada5d9 Fixing another corner case for security related to CVE-2016-9587 2017-01-11 15:52:58 -06:00
Toshio Kuratomi
80357e07de Add some comments about how we're cleaning callables 2017-01-11 13:16:08 -08:00
rmarsa
1d80a8dbfb Added the ability to set the size of the boot volume. (#19703)
* Added the ability to set the size of the boot volume.

* Made disk_size parameter of type int with 10 default.
2017-01-11 16:08:31 -05:00
Matt Clay
cd3fdca540 Switch tests to pytest and ansible-test.
- Replace nose usage with pytest.
- Remove legacy Shippable integration.sh.
- Update Makefile to use pytest and ansible-test.
- Convert most yield unit tests to pytest parametrize.
2017-01-11 12:34:59 -08:00
Toshio Kuratomi
027b126b42 Remove _clean_data_struct() advice as that was a 1.x design
data now goes through this extra cleaning in the template rather than
being an explicit other step.
2017-01-11 11:43:56 -08:00
ansibot
36c79709a4 Merge pull request #20136 from tareqalayan/fix-documentation-ovirt-cloud
cloud/ovirt: minor fix on documentation
2017-01-11 14:42:17 -05:00
Robin Roth
4976429e42 Zypper: Fix update_cache in checkmode (#20143)
Fixes #20139

Refresh does not support dry-run, so don't run it in check mode.
Also add a test for this case.
2017-01-11 18:47:16 +00:00
Robin Roth
e4bfc2b84c Add ZYPP_LOCK_TIMEOUT environment example (#20130)
Retries to require lock for zypper operation.
2017-01-11 18:30:18 +00:00
BRAMILLE Sébastien
110753502e Update rds_subnet_group.py 2017-01-11 12:37:31 -05:00
Tareq Alayan
ebf3c41275 cloud: ovirt: 'glusterfs' as default for vfs_type
When storage type is glusterfs, the vfs_type will be glusterfs as well,
there is no need to specify it since there is no other valid value.
2017-01-11 19:26:40 +02:00
ansibot
e8718f34ee Merge pull request #20001 from pwae/devel
fixes for handling of different return codes from robocopy in win_robocopy module
2017-01-11 12:21:59 -05:00
Ondra Machacek
11b2662f60 cloud: ovirt: add support for OVN network (#20122)
This PR add support to add OVN external network in
external providers module.
2017-01-11 10:39:37 -05:00
Jasper Lievisse Adriaanse
b384a0f795 timezone: Tidy up docs and arg parsing (#20133)
* Small tweaks for timezone module:

- small textual fixes
- ensure the generated docs list either hwclock or name as required
  by using a non-generated value for required_one_of

* Update docs with the DOCUMENTATION block about either name/hwclock being required
2017-01-11 15:22:27 +00:00
Peter Sprygada
7c6916f8d1 refactors iosxr shared module to use network_cli (#20132)
This refactors the iosxr shared module to make use of the network_cli
connection plugin and removes the dependency on the shared shell
module.  This change will break current modules until the modules
are updated.
2017-01-11 09:46:38 -05:00
Peter Sprygada
a3cc24efb2 adds get_block_config() method to NetworkConfig
new method that will return the config block string for the
specified config path
2017-01-11 07:51:00 -05:00
Andrew Spiers
0a0013e1eb spelling of Extraneous (#20116) 2017-01-11 12:18:06 +00:00
Michał Masłowski
5a1395a486 sns_topic: Do not attempt to unsubscribed deleted subscriptions (#20086) 2017-01-11 06:57:24 -05:00
John R Barker
8fe09d4ea9 net_command: formatting (#20121)
* net_command: formatting

* Update net_command.py
2017-01-11 08:22:19 +00:00
TaoBeier
6ec0369c26 fix indent (#20071) 2017-01-10 18:47:03 -08:00
Toshio Kuratomi
1786c81a65 Previous fix to this failed to account for open_url returning a filehandle (#20097)
* Previous fix to this failed to account for open_url returning a filehandle

Fixes the bugs introduced by c6fb355

* read() from HTTPError for python-3.6+

HTTPError is funny.  It contains a filehandle to read the response from
and also makes it available via a read() method.  On earlier versions of
python (2 and 3) the read() method was enough to make it work with
json.load().  The newer version of json.load() needs a more complete
file interface than this and has stopped working.  Read the bytes,
transform to str and pass it in manually to fix it.
2017-01-10 18:14:20 -08:00
Dag Wieers
239e2ae7e9 win_reboot: survive an already scheduled shutdown
These changes ensure win_reboot can survive an already scheduled
shutdown by pre-empting it.

This fixes #19982
2017-01-11 00:07:30 +01:00
Dag Wieers
b7594070b3 win_reboot: display message before rebooting (#19986)
Show a message to users when rebooting the system.

TODO: Look if this message is logged in the EventLog properly, if not,
fix that :-)
2017-01-10 13:59:39 -08:00
Brian Coca
f9f99ddfbc updated docs to suggest quote filter for shells
Also changed comments into -name in examples where appropriate.
2017-01-10 16:19:22 -05:00
Gaëtan Duchaussois
f5c61650a7 Add information about lookup file constraint. 2017-01-10 13:20:00 -05:00
Romain Richard
e341135431 Duplicated line in the documentation of the apt_repository module
Removing that extra line.
2017-01-10 12:28:37 -05:00
Toshio Kuratomi
c6fb355b58 Convert all results from open_url() into text before deserializing the json. (#20069)
Fixes #20012
2017-01-10 08:35:08 -08:00
Willem van Ketwich
1ee69c07cc New module (cloud): cloudfront_facts (#19727)
* initial commit of cloudfront_facts.py

* modification as per review from @georgepsarakis

* fixed shippable build error

* fixed shippable build error

* removed wildcard imports and replaced with specific imports from ansible.module_utils.ec2 as advised by @georgepsarakis

* renamed all instances of cloud_front_origin_access_identity to origin_access_identity as advised by @georgepsarakis

* added input option requirements where missing. fixed a typo in an error message, added '.' to the end of sentences.

* fixed typo in documentation

* simplified paginated_response method as advised by @georgepsarakis

* set default option to list_defaults when no option specified as advised by @ryansb

* bumped version to 2.3 as advised by @ryansb

* removed double-nesting of ansible_facts as advised by @ryansb

* show facts based on alias and distribution id for easy referencing as advised by @ryansb. have done for both distribution and distribution_config

* made comments clearer

* fixed incorrect logic for default list_distributions, fixed list_distributions_by_web_acl - wasn't passing web_acl_id, fixed list_invalidations keyword args missing DistributionId

* neatened up logic for list_distributions default

* facts now return Etag as well as specific facts. modified paginated_response to handle this. also all requests that use distribution id also list the facts under the corresponding alias now.

* fixed last fact added clobbering all previous facts for an alias or an id

* removed list_ prefix from list keys

* removed unnecessary boto fields. made list_distributions and list_streaming_distributions dictionaries with id/alias as key. fixed list_invalidations.

* fixed incorrectly named list_distributions_by_web_acl to ..web_acl_id. added id/alias dict for list_distributions_by_web_acl_id

* minor doc changes

* removed merge tag

* fixed more of merge
2017-01-10 11:27:54 -05:00
Jamie Lennox
0533b3d639 Add additional information to the get_url SSL failure message. (#20025)
When get_url or other functions receive an SSL failure it prints a
standard message regardless of the failure. Include the actual OpenSSL
message in the error message so alternative failures can be debugged.

Closes: #20024
2017-01-10 08:22:43 -08:00
Toshio Kuratomi
8ae29a5a80 Remove the redundant get_exception import 2017-01-10 08:19:54 -08:00
Dag Wieers
560831752e Defined get_exception() (#20087)
This fixes #20080
2017-01-10 08:18:51 -08:00
Ner'zhul
16a1585ffc vmware_guest: Fix customvalues when VM doesn't exists (#20094) 2017-01-10 11:07:42 -05:00
Brian Coca
3ceff2f9b3 added missing import 2017-01-10 10:37:55 -05:00
Ner'zhul
7603ae33b5 vmware_guest improvements: annotations & customvalues (#20052)
* Idempotency fix on annotations permitting to change them on reconfiguration
* Permit to set VMware customvalues attributes on VM
* Gather annotation & customvalues and report it into module facts
2017-01-10 09:10:48 -05:00
Dag Wieers
aca60f1776 vmware_guest: various customizations changes and fixes (#19975)
* vmware_guest: various changes and fixes

Most of my queued changes were already implemented by @aperigault !

This was still open
- Typos
- Various fixes to dict.get() without quotes
- Defaults to fullname and orgname (so they are no longer mandatory)
- Add missing timezone implementation
- Remove the customize flag from the options
- Rename 'customizations' to 'customization' (cfr VMware docs and fora)

* Important fixes for idempotency and customization

- A password is mandatory for customization to work on Windows !
- An important fix for idempotency related to guestId
- Support all types of Windows guestId entries

* Suggestion by @aperigault

* Small documentation fixes
2017-01-10 08:34:38 -05:00
René Moser
bcf9cd1e2a cloudstack: cs_iso: fix async poll for state=absent (#20050) 2017-01-10 12:06:13 +01:00
John R Barker
3c4623d68b dellos9__config -> dellos9_config 2017-01-10 10:47:13 +00:00
Ivan Bojer
8d29406d74 new panos module that adds arbitrary service to the FW (#19896)
* new module that adds arbitrary service to the FW

* change exception handling

* minor code changes based on the review comments
2017-01-09 23:50:38 -05:00
Ivan Bojer
f8f388bdaf Panos mgtconfig (#19897)
* new module to manipulate mgmt interface

* new module for mgmt interface management

* minor code changes based on the review comments
2017-01-09 23:50:03 -05:00
Ivan Bojer
178e11473a new panos module to load configuration file (#19902)
* new module to load configuration file

* minor code changes based on the review comments
2017-01-09 23:48:59 -05:00
Ivan Bojer
23349ed638 new panos module for profile groups (#19904)
* new module for profile groups

* minor code changes based on the review comments
2017-01-09 23:48:40 -05:00
Adrian Likins
cf7b1108ff Fix 'No module named network' net_template error (#20060) 2017-01-09 23:45:52 -05:00
Brian Coca
afbe3bd63f corrected service condition 2017-01-09 15:44:53 -05:00
James Cooke
fafe5bba59 Fix authorized_key crash in Python3 with remote key file (#20037)
* Decode downloaded keys bytes if Python3
* Fixes #20007
* Thanks @georgepsarakis
2017-01-09 12:21:51 -08:00
Adam Števko
ebd7e03425 Add ipadm_addr module (#19411)
* Add ipadm_addr module

* Add ANSIBLE_METADATA
Document return values
Make imports explicit
Use native YAML syntax in EXAMPLES

* Fix version to 2.3
2017-01-09 14:32:05 -05:00
Evan Kaufman
ad9c25a54f Apply SELinux context only if cron_file param exists
Use selinux calls in module_utils/basic instead of native selinux bindings

Fixes #18768
2017-01-09 14:02:05 -05:00
Adam Števko
07a517aebd Add dladm_vlan module (#19412)
* Add dladm_vlan module

* Add ANSIBLE_METADATA
Document return values
Make imports explicit
Use native YAML syntax in EXAMPLES
2017-01-09 12:32:23 -05:00
Adam Števko
a677f40457 Add dladm_linkprop module (#19413)
* Add dladm_linkprop module

* Add ANSIBLE_METADATA
Document return values
Make imports explicit
Use native YAML syntax in EXAMPLES
2017-01-09 12:31:42 -05:00
Adam Števko
05bf7488cc Add dladm_iptun module (#19414)
* Add dladm_iptun module

* Add ANSIBLE_METADATA
Document return values
Make imports explicit
Use native YAML syntax in EXAMPLES
2017-01-09 12:30:42 -05:00
Valentín Gutiérrez
6c448d3673 Fix pamd module (#20048)
* Fix string_types usage

* Fix adding arguments for argument=value arguments

* Remove unnecesary check on module_args

* Fix argument requirements

* Proper handling of parameter=value arguments
2017-01-09 09:30:32 -08:00
Adam Števko
457e94d21e Add ipadm_addrprop module (#19415)
* Add ipadm_addrprop module

* Add ANSIBLE_METADATA
Document return values
Make imports explicit

* Use native YAML syntax in EXAMPLES

* Add temporary
2017-01-09 12:29:56 -05:00
Adam Števko
7b71e9a0de Add ipadm_ifprop module (#19416)
* Add ipadm_ifprop module

* Add ANSIBLE_METADATA
Document return values
Make imports explicit
2017-01-09 12:29:24 -05:00
Ryan Brown
a2b4ad9da0 (docs) Remove/update mentions of git submodule in docs and error me… (#19941)
* (docs) Remove/update mentions of `git submodule` in docs and error messages.

* Remove parenthetical per @dharmabumstead
2017-01-09 12:11:39 -05:00
Marius Gedminas
0a7f2c202b Improve --diff output when files lack trailing newlines
The behavior now matches GNU diff.

Fixes #14094.

Example of output before this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null+curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

after this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null
    \ No newline at end of file
    +curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

The added unit tests contain more examples.

This commit also takes care to avoid "no newline at EOF" warnings when
no_log is in effect, and also when modules return dicts rather than
strings.  (It also removes trailing whitespace from using json
serialization when diffing dicts, because I hate trailing whitespace in
Python source files, even if they're test files.)
2017-01-09 11:49:03 -05:00
James Cammarata
a6fff93967 Fixing security bugs for CVE-2016-9587 2017-01-09 10:43:03 -06:00
Peter Sprygada
258c6ada52 refactors ios_config to use network_cli plugin (#20042)
* updates the ios_config module to use the network_cli plugin
* updates the local action plugin to derive from network
* add unit test cases for ios_config
2017-01-09 11:19:25 -05:00
Brian Coca
0ef60aeacb improved negative service status handling
This is still far from optimal but the nature of the initscripts does not really allow for much better.
fixes #20028
2017-01-09 11:09:11 -05:00
Michael Scherer
0847a137d3 Add a fact about apparmor, to see if that's loaded or not 2017-01-09 10:12:13 -05:00
Peter Sprygada
5bbab91452 fixes add() method in netcfg (#20041)
The add() method was not properly setting childen and parents objects
on instances of ConfigLine.  This only applied to the add method.  This
change fixes the problem by adding child and parent to the right
attribute.
2017-01-09 10:01:13 -05:00
Jiri Tyr
28050c1356 Update option desc of yum_repository module 2017-01-09 09:55:47 -05:00
Ner'zhul
c1f5432cc0 Better user report when OMAPI error occurs or key is invalid (#20035)
* Move imports after header
2017-01-09 12:40:53 +00:00
Ner'zhul
e87d6d8a70 Unbreak vmware_guest module which was break by 818ef493ad (#20036) 2017-01-09 11:29:18 +00:00
aperigault
8241675095 vmware_guest: Rename existing VM, or mark as template (#20018)
* vmware_guest: Add rename feature

* vmware_guest: Add feature to mark an existing VM as template
2017-01-09 09:37:36 +00:00
Adam Števko
d9ced3f4d1 Modules for gathering facts about ZFS datasets and pools (#19181)
* Add modules for gathering facts about ZFS datasets and pools

* Move zfs module to storage/zfs subcategory

* Replace dict.iteritems() with iteritems(dict)

* Add ANSIBLE_METADATA
Document return values
Make imports explicit
Use native YAML syntax in EXAMPLES

* Add zfs_facts and zpool_facts modules to CHANGELOG.md

* Add facts to return values
2017-01-09 07:53:42 +00:00
Adam Števko
3744764fae Add module for managing boot environments on FreeBSD/Solaris/illumos … (#19180)
* Add module for managing boot environments on FreeBSD/Solaris/illumos systems

* Add ANSIBLE_METADATA
Document return values
Make imports explicit
Use native YAML syntax in EXAMPLES

* Add beadm module to CHANGELOG.md

* Update version to 2.3
2017-01-09 07:52:06 +00:00
Adam Števko
69559c184d Gather uptime and device facts from Solarish systems (#18733)
* Gather device information on Solarish systems

* Gather uptime information on Solarish systems

* Fix typo in variable name

* Add comments and example output from kstat command
Use frozenset instead of set
Make parsing of line a little bit safer
2017-01-08 13:26:52 -08:00
Michael
583136980d Adding os_quota support to the OpenStack modules (#19590)
* Adding os_quota support to the OpenStack modules

* Updated descriptions in doc string

* Updated version_added to 2.2 based on CI test feedback

* ready_for_review

* Changed exit_json to remove updating host var facts

* Updated version_added and docs

* Added support for state:absent paramater

This includes:
- Updated the doc string with the paramater information
- Updated the example section showing how to reset a project quota
- Added code support to handle state:absent
- Encountered a bug in delete_network_quota where it returns
an error instead of the current quota. Added support code to
workaround that issue until a proper fix can be added.

* Updated security groups kwarg to reflect Neutron kwargs

* Updated iteritems to be items based on CI feedback

* Updated descriptions and import statements based on code review feedback

* Updated CHANGELOG.md to include os_quota under new mods.
2017-01-08 18:55:12 +00:00
Toshio Kuratomi
08d6990e67 Fix code-blocks to use correct syntax highlighting 2017-01-08 09:18:45 -08:00
John R Barker
01849004e9 Correctly link to modules (#20019) 2017-01-08 17:06:07 +00:00
Baptiste Mille-Mathias
d1bd526426 Document git module return values (#19485)
* Document git module return values

* Document git module return values

* Remove duplicate and added more variables
2017-01-08 15:33:51 +00:00
Fabio Alessandro Locati
2790999ee9 Add output (#19212) 2017-01-08 15:33:05 +00:00
Fabio Alessandro Locati
474c0dc87c Remove quotes - Cloud/azure/azure.py (#19206)
* Remove unused quotes

* Explicit is better than inplicit
2017-01-08 15:28:48 +00:00
Fabio Alessandro Locati
85f7d2b97a authorized_key: doc: Improve example description (#19209) 2017-01-08 12:28:29 +01:00
Scott Sinclair
de5d08a786 a copy of the pull request from ansible/ansible-modules-extras#3515 by @twistyWater
This fixes #19959 - exception throw when robocopy return_code is not 1 2 or 4.
2017-01-07 18:21:57 +11:00
Peter Sprygada
cba66dfedc update the _ios_template module to use the network_cli plugin (#19933)
* updates the deprecated ios_template module to use network_cli
* adds unit test cases for ios_template
* adds check for provider argument and displays warning message
2017-01-06 20:22:17 -05:00
Brian Coca
b7ad86acd0 only warn if non whitespace junk 2017-01-06 17:07:42 -05:00
Peter Sprygada
7d3366acc0 updates ios_command to use network_cli plugin (#19992)
* refactors ios_command to use network_cli
* adds unit test cases for ios_command
2017-01-06 17:06:40 -05:00
Gabriele
c980b52d33 Fixing issue when multiple vni exist (#19928) 2017-01-06 16:36:13 -05:00
Gabriele
f2baa6d61a fix nxos_facts to support multiple neighbors and modules (#19946) 2017-01-06 16:34:59 -05:00
Brian Coca
4672058b1f updated unarchive docs for url handling 2017-01-06 16:21:55 -05:00
Dag Wieers
c8d3dd9a15 Small fixes 2017-01-06 16:11:56 -05:00
Tom Melendez
89f232ad8a [GCE] gc_storage: add type parameter to expiration in argument_spec. (#19979)
Fixes ansible/ansible#19568
2017-01-06 13:27:47 -05:00
THEBAULT Julien
d1b38cb718 Fix tags documentation into rabbitmq_policy module 2017-01-06 12:51:44 -05:00
howinator
90002e06ae Add subnet associations to route tables dict
The main purpose of this PR is to add the subnet associations to the
dict returned by ec2_vpc_route_table_facts. This commit also
re-formats code to make it PEP8 compliant.
2017-01-06 12:30:54 -05:00
Will Thames
4bf7bf0b94 Add postgres-9.6 to rds_param_group module
Support postgres-9.6 as an engine choice for rds_param_group
2017-01-06 12:29:37 -05:00
Rene Moser
40c6191da6 win_template: fix key errors when --diff is used 2017-01-06 11:55:54 -05:00
John R Barker
40ecc3188f Use M() to link to the replacement module. (#19976) 2017-01-06 16:21:39 +00:00
aperigault
818ef493ad vmware_guest: Add windows customization support (#19866)
* vmware_guest: Add windows customization support

* vmware_guest: Move customizations inside separate function
2017-01-06 10:27:48 -05:00
James Hogarth
513466d309 add jenkins_script module for running arbitrary jenkins console scripts against a jenkins instance (#19640) 2017-01-06 15:12:24 +00:00
Olivier Boukili
b139a67c71 module_utils/vmware: added find_datastore_by_name helper function (#17538)
module_utils/vmware: exception catch for vcenter self-signed certificates
2017-01-06 09:11:25 -05:00
Ryan S. Brown
7a074b69a0 gce_net module: fail when no libcloud is found 2017-01-06 09:05:52 -05:00
Dag Wieers
00031e454e Sanitize folder path from the very start (#19929)
- If an absolute path is provided, ensure it starts with /vm
- Also ensure there are no trailing slashes

This gets rid of a few locations where the same was being done.
It also fixes the cases of multiple trailing slashes, or ending up with
/vm/ instead of /vm.
2017-01-06 09:05:10 -05:00
Toshio Kuratomi
ad1e066540 Transform exception with to_native instead of str 2017-01-05 18:16:32 -08:00
Andrew Grigorev
3fe8f70b08 Fix misleading SSL error message
The `except` block with exception matching throught
`if 'connection refused' in str(e).lower():` is funny,
but is not user-friendly.

Probably related issues:

- #15679
- #12161
- #9966
- #8221
- #7218

... and more
2017-01-05 18:13:44 -08:00
Toshio Kuratomi
0ee9972903 Fix constants to use environment variables in preference to config files 2017-01-05 17:11:51 -08:00
Angus Williams
f7d000fe74 Stops New-PSDrive commandlet producing output which was causing warnings (#19873) 2017-01-05 17:09:04 -08:00
Toshio Kuratomi
03510ec4ce Allow OSError to skip scriptdir removal
On Ubuntu the scriptdir gets placed into sys.path.  This makes some
modules (copy) fail because the ansible module gets loaded instead of
the stdlib copy module.  So we remove scriptdir there.  Unfortunately,
the scriptdir code uses abspath().  When pipelining, abspath() has to
find the cwd.  On OSX, finding the cwd when that directory is not
executable by the user raises an OSError.  Since OSX does not suffer
from the scriptdir problem we're able to just skip scriptdir handling if
we get that exception.

Fixes #19729
2017-01-05 15:50:56 -08:00
Ken Evensen
99e19ad617 Minor rework of pamd module. Fixed some documentation. (#19758)
* Minor rework.  Fixed some documentation.

* Requested changes in the case the arg is unicode
2017-01-05 15:48:24 -08:00
Toshio Kuratomi
5536ffe978 Fix OSX defaults for lists
In modern ansible, parameters default to string type.  This causes
issues for polymorphic parameters like this module's value param.  note
that this fix restores ansible-2.0 and previous behaviour but it is not
perfect.  If a parameter is specified via key=value or given on the
commandline then it will be a string before it reaches the module code.
There's nothing we can do about that.

Fixes #19585
2017-01-05 15:45:26 -08:00
Daniel
7cf9ee30a5 Removed 'no vn-segment' when state == 'absent' (#19952) 2017-01-05 22:03:46 +00:00
Brian Coca
08e0f6ada5 allow modules to set custom stats (#18946)
can be per run or per host, also aggregate or not
set_stats action plugin as reference implementation
added doc stub
display stats in calblack
made custom stats showing configurable
2017-01-05 16:38:36 -05:00
Emlyn Stokes
1154aca746 Paginate ASG results (#19944) 2017-01-05 16:12:30 -05:00
Jasper Lievisse Adriaanse
7793424b1b Add new module to manage SmartOS images through imgadm(1M) (#19696)
* Add new module to manage SmartOS images through imgadm(1M)

* Explain why check_mode is not supported

* Add imgadm module

* Incorporate feedback from abadger
2017-01-05 12:30:31 -08:00
Simon Wydooghe
6d9ca6c9d7 Simple typo fix (#19949)
Was reading the docs and spotted a typo.
2017-01-05 21:27:11 +01:00
Søren Kröger
3a2875739f Added active_connection_states parameter (#19775) 2017-01-05 10:57:22 -08:00
Toshio Kuratomi
95df8977b6 Fix yum install root (#19925)
* Reenable yum install root tests

No need for sos to test installroot.  Something with less deps works
just as well.

* Fix yum installroot.

Fix module import to use fail_json when the modules aren't installed.

Remove wildcard imports

* Lsat task is supposed to remove sos so make that happen
2017-01-05 10:42:43 -08:00
Toshio Kuratomi
22c9428776 eval() should be avoided when at all possible
eval can have security consequences.  It doesn't look bad here but it
does introduce unnecessary complexity and would make it harder if we
ever want to use static analysis to detect and prohibit eval.  So we
should get rid of it.

Note: this could be even more efficient if we combined the checks into
a single condition instead of looping but that does change the error
messages a bit.  For instance:
-        for arg in ('name', 'linode_id'):
-            if not eval(arg):
+        if not (name and linode_id):
+            module.fail_json(msg='name and linode_id are required for active state')
2017-01-05 10:41:49 -08:00
Samuel Boucher
ed624876d1 Update atomic_image.py (#19756)
Doc update typo
2017-01-05 10:33:05 -08:00
Dag Wieers
e1fe403075 Inform user that the yum metadata cache remains (#19753)
This PR improves the documentation so that it is clear that this module does
not clean the repository metadata cache on removal, and add an example
notification handler to the removal example as an extra reminder.

This fixes #19730
2017-01-05 10:30:37 -08:00
Dag Wieers
9ddcf16b4b vmware_guest: add support for more virtual NICs (#19932)
This patch adds support for all other virtual NICs, including:

 - pcnet32
 - vmxnet2
 - e1000e
 - sriov

Without this change, VMs with one of these NICs will fail with a
fault.NicSettingMismatch.summary error as it will only add interfaces,
not edit these.

This fixes #19860
2017-01-05 18:16:21 +01:00
Tyrone Tudehope
38d42e8b36 module is a property of the global object client (#19744)
Fixes #5466
2017-01-05 08:59:30 -08:00
René Moser
cb8cc51fdf cloudstack: new module cs_host (#19331) 2017-01-05 16:28:42 +01:00
Ted Timmons
12495e4b42 New module: aws_kms for managing access grants on AWS KMS keys (#19309)
New module by @tedder for handling granting/revoking access to KMS secrets. 

For example:

```
- name: grant user-style access to production secrets
  kms:
  args:
    mode: grant
    key_alias: "alias/my_production_secrets"
    role_name: "prod-appServerRole-1R5AQG2BSEL6L"
    grant_types: "role,role grant"
```
2017-01-05 09:42:59 -05:00
Peter Sprygada
5a14f1d705 adds new module ios_system (#19916)
adds new module ios_system
2017-01-05 09:02:29 -05:00
Toshio Kuratomi
cd2516bf8d Revert "Revert "Add --installroot to YUM and DNF modules, issue #11310""
This reverts commit b73ddd5212.
2017-01-05 00:24:20 -08:00
Matt Clay
b73ddd5212 Revert "Add --installroot to YUM and DNF modules, issue #11310" 2017-01-05 00:14:33 -08:00
Peter Sprygada
1c16c1db2b adds new module ios_vrf (#19915)
adds new module ios_vrf
2017-01-04 23:34:51 -05:00
Peter Sprygada
d182b271db updates netcfg and refactors Config class (#19920)
* refactors Config into network module
* fixes minor bugs with netcfg
2017-01-04 23:23:08 -05:00
Peter Sprygada
f842bc0b91 adds network_common shared module (#19919)
* support for ComplexList and ComplexDict
2017-01-04 23:17:41 -05:00
Peter Sprygada
6b7742fd75 Revert "cleans up the netcfg implementation" (#19917) 2017-01-04 22:55:16 -05:00
berenddeschouwer
1fdcda0996 Add --installroot to YUM and DNF modules, issue #11310 (#19861)
* Add --installroot to YUM and DNF modules, issue #11310

This continues ansible-modules-core#1558, and
ansible-modules-core#1669

Allow specifying installroot for the yum and dnf modules
to install and remove packages in a location other than /.

* Remove empty aliases

* Simpler installroot set default logic
2017-01-04 19:20:00 -08:00
Peter Sprygada
d424a0468a refactors ios shared module (#19850)
This allows the ios_* modules to take advantage of the new network_cli
connection plugin by refactoring the ios shared module.  Individual modules
need to be udpated as well
2017-01-04 21:52:56 -05:00
Peter Sprygada
630d10a27a updates action plugins for network_cli connection (#19849)
* net_config now subclasses action plugin network
* net_template now subclasses action plugin network

This will break existing modules until those modules have been refactored.
2017-01-04 21:52:46 -05:00
Peter Sprygada
fdb24bb5d7 cleans up the netcfg implementation (#19847)
* moves parse() into the instance
* removes old Config instance and supporting code
* adds net_common shared module
* minor tweaks to NetworkConfig class for parsing config files
2017-01-04 21:52:25 -05:00
Patrik Lundin
ee5364f983 openbsd_pkg: make "name" take a list.
This commit also adds the module to DEFAULT_SQUASH_ACTIONS which is
possible with this change.

The module still calls the pkg_* tools once per name internally, so the only
difference is less invocations of the module itself when using with_items.
2017-01-04 18:45:31 -08:00
Jiri Tyr
579b6a0f9d Changing author's e-mail for ldap_* modules (#19900) 2017-01-04 21:30:43 -05:00
Toshio Kuratomi
a33e34894b Move some modules into proper categories 2017-01-04 18:09:45 -08:00
Toshio Kuratomi
8469ea93d9 Remove unnecessary use of iteritems so that this compiles under python3 2017-01-04 17:39:34 -08:00
THEBAULT Julien
ee1dee08b6 Check the command result status in easy_install plugin (#16519) 2017-01-04 17:17:30 -08:00
Joe Adams
337ea4d65c Add pulp_repo module for interacting with repositories on a pulp server. 2017-01-04 17:12:49 -08:00
Ondra Machacek
8a3e80eb09 cloud: ovirt: add kernel boot parameters to vms module 2017-01-04 17:11:07 -08:00
Fabrizio Colonna
b6f9b0be1f Added arbiter support to gluster_volume module. 2017-01-04 17:09:24 -08:00
Andy Freeland
778a189a59 Fix letsencrypt remaining_days docs 2017-01-04 16:53:23 -08:00
Enis Ozgen
d4d9a48205 Fix typo in ec2_vpc_peer.py documentation 2017-01-04 16:51:26 -08:00
Paulo Matias
d51064a05e os_user: fix typo (self is not defined) 2017-01-04 16:47:43 -08:00
Sergio Millan
08b671990d Fixing Issue#18995 2017-01-04 15:24:32 -08:00
Toshio Kuratomi
f129977e2b Fix 4d355f8bf2
default values can contain nonstrings and those should not be converted
via to_text.
2017-01-04 14:35:05 -08:00
Toshio Kuratomi
91242b8cc3 Leave a comment that .format() can lead to security risks
Couldn't find any code that does this now but left a comment so that we
don't change something in the future without seeing that it could be
a problem.
2017-01-04 14:33:15 -08:00
Dag Wieers
ecaa0202b9 vmware_guest: assorted fixes and improvements (#19842)
A small collection of fixes and improvements:
- Simplify should_deploy_from_template()
- Bugfix for x.config that can be None
- Bugfix for mandatory guest_id (not when using templates)
- Simplify key testing and defaults
- Fix an incorrect reference to the last network
- Duplicate alias 'folder' removed
2017-01-04 17:25:09 -05:00
Toshio Kuratomi
02e3f4b526 Fix for atomic_move on RHEL5
When becoming an unprivileged user using non-sudo on a platform where
getlogin() failed in our situation we were not able to detect that the
user had switched.  This meant that all of our logic to use move vs copy
if the user had switched was attempting the wrong thing.  This change
tries the to do the right thing but then falls back to an acceptable
second choice if it doesn't work.

The bug wasn't easily detected because:
* sudo was not affected because sudo records that the user's have been
  switched so we were able to detect that.
* getlogin() works on most platforms.  RHEL5 with python-2.4 seems to be
  the only platform we still care about where getlogin() fails for this
  case.
* It had to be becoming an unprivileged user.  When becoming
  a privileged user, the user would be able to successfully perform the
  best case tasks.
2017-01-04 14:08:19 -08:00
Toshio Kuratomi
4d355f8bf2 Transform config values to text immediately when they enter ansible
Convert configuration values from ENV VARS, config files, and defaults
in constants.py.
2017-01-04 14:06:18 -08:00
Corwin Brown
9b7c9931db Issue #19575: Adding Dest Param to win_uri (#19577)
* Issue #19575: Adding Dest Param to win_uri

Added `dest` param to win_uri. Outputs the response body to a specified
file.

Addresses Issue #19575

* Was setting the wrong attribute
2017-01-04 13:33:47 -08:00
James Cammarata
a0b4d37dea Removing unused files in playbook/ directory 2017-01-04 15:17:15 -06:00
Brian Coca
92e8c53879 fixed id queries, should rely on effective 2017-01-04 14:23:26 -05:00
Jiri Tyr
1ff9b74e3d Adding ldap_attr module (#19286) 2017-01-04 14:11:02 -05:00
Toshio Kuratomi
e98c0a3009 Fix locale_gen to compare native strings rather than mixing byte and text strings
Fixes #19426
2017-01-04 10:11:33 -08:00
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