Commit graph

20808 commits

Author SHA1 Message Date
Blair Rampling
7324f49829 fixes example address parameters (#37765) 2018-03-28 17:11:24 +01:00
Martin Krizek
447b342662
apt: use --auto-remove with dist-upgrade (#37594) 2018-03-28 12:18:36 +02:00
Olivier Bourdon
612d0d6634 Fix interfaces_file for proper file contents (#37818)
The generated file was completely unusable by the system
therefore the fix which ensures that diffing the file
prior to changes and after only shows diffs

Furthermore the code did not work for Python 3.6
>       f.writelines(to_bytes(lines, errors='surrogate_or_strict'))
E       TypeError: a bytes-like object is required, not 'int'

The other modifications (lambda variable renaming) is to
comply with default flake8 rules
2018-03-28 10:21:43 +01:00
Benoit Perroud
710db82930 flattened: doc: Typo in lookup example (#38006) 2018-03-28 08:25:40 +02:00
Jorge Andrade
29c8d9b923 Update xml.py (#38019)
Fix a trivial typo 

 label: docsite_pr
2018-03-28 07:47:28 +02:00
balonik
371317b553 don't create vmware vm on ESX in maintenance mode (#37124)
* don't create vmware vm on ESX in maint mode

update vmware_guest not to try to create VM on ESXi host in maintenance mode

* update as requested
2018-03-27 23:12:43 -04:00
Yuwei Zhou
454096ca59 Fixes #37700 Azure image can be created with tag (#37981)
* image can be create or add

* update tags

* can remove all tags

* Update azure_rm_common.py
2018-03-27 23:10:29 -04:00
Abhijeet Kasurde
d065cce021 VMware: Use RFC 952 compliant hostname while customization (#38005)
VMware throws error if hostname provided by user is not RFC 952
compliant. Added minor documentation fixes.

Fixes: #24225, #27096

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-27 22:49:22 -04:00
Sean Lok
0ee275ca64 Add Meaningful Cloudfront Identity during creation of cloudfront distribution (#37914) 2018-03-28 10:38:16 +10:00
Adam Miller
ab9b4479a1 Quote --rsh command options for rsync in syncrhonize module (#35976)
Currently the --rsh command arg being passed to rsync is not quoted,
but we're adding arguments to the ssh command and that causes rsync
to attempt to accept them as it's own, which is not the desired
outcome.

Fixes #35717

Signed-off-by: Adam Miller <admiller@redhat.com>
2018-03-27 20:26:00 -04:00
Matt Martz
897c8df8d0 Ensure the MAC address uses colons instead of hyphens for later comparison. Fixes #35463 (#35465) 2018-03-27 15:20:01 -04:00
Abhijeet Kasurde
8ce2ee0ebb VMware: Fix regression in get_all_host_objs (#36770)
If user does not specify esxi_hostname then module
fails to detect ESXi hostsystem from given configuration.
This fixes the regression in get_all_host_objs API by
getting first host managed object from list.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-27 14:57:17 -04:00
Abhijeet Kasurde
4edcbeb62d
VMware: Gather facts when powerstate is specified (#37908)
This fix adds additional facts after VM powerstate management.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-28 00:19:33 +05:30
Adrian Likins
6e737c8cb6
Fix 'New Vault password' on vault 'edit' (#35923)
* Fix 'New Vault password' on vault 'edit'

ffe0ddea96 introduce a
change on 'ansible-vault edit' that tried to check
for --encrypt-vault-id in that mode. But '--encrypt-vault-id'
is not intended for 'edit' since the 'edit' should always
reuse the vault secret that was used to decrypt the text.

Change cli to not check for --encrypt-vault-id on 'edit'.

VaultLib.decrypt_and_get_vault_id() was change to return
the vault secret used to decrypt (in addition to vault_id
and the plaintext).

VaultEditor.edit_file() will now use 'vault_secret_used'
as returned from decrypt_and_get_vault_id() so that
an edited file always gets reencrypted with the same
secret, regardless of any vault id configuration or
cli options.

Fixes #35834
2018-03-27 14:12:21 -04:00
Toshaan Bharvani
cbe2915ba5 continue fact gathering even without dmidecode (#34925)
* continue fact gathering even without dmidecode

If dmidecode is not available we still wan to continue with fact
gathering.
On certain platforms dmidecode just won't work
2018-03-27 13:56:49 -04:00
Renato
ed6c4b4058 Add spectrum_device module (#19739) 2018-03-27 11:58:01 -05:00
Afsal Rahim
1428db45bc updated example with correct parameters (#37679)
Updated EXAMPLES documentation which had following 2 incorrect parameters: 
'type' has been changed to 'ds_type'
'basic_auth' parameter has been removed.

 label: docsite_pr
2018-03-27 18:49:11 +02:00
Manuel Bonk
4aa1477470 fix typo (#37996)
fix typo
 label: docsite_pr
2018-03-27 18:47:48 +02:00
Will Thames
c1af147c1f warn about assign_public_ip immutability only if explicitly set (#37974)
Change assign_public_ip to default to None rather than False so
that we can detect whether the value is being explicitly set or
not, and only warn if it is explicitly set to False for something
with a public_dns_name

Fixes #37985
2018-03-27 08:20:57 -04:00
Ed Costello
d79b9f88bb Fix broken link to cloud utils from AWS guidelines. (#37166)
* Fix broken link to cloud utils from AWS guidelines.

* Replace absolute links within repo with relative links.
2018-03-27 18:55:25 +10:00
saichint
135d343254 fix nxos_udld_interface issue (#37527) 2018-03-27 02:57:14 -04:00
Renato
023f130a46 Add CDP support for the neighbors option (#37655) (#37667) 2018-03-27 12:06:17 +05:30
Jordan Borean
b1ac65d95a
win_copy: added fix for win_copy deleting local tmp folder (#37964) 2018-03-27 16:20:10 +10:00
Jordan Borean
68e44e082e
Ansible.ModuleUtils.FileUtil: catch DirectoryNotFoundException when testing a path (#37968) 2018-03-27 16:19:45 +10:00
Jordan Borean
c4e7b54630
win_reboot: fixed up warning message for dep args (#37898) 2018-03-27 13:03:07 +10:00
Toshio Kuratomi
e707e71ec5 Except in specific cases, we want to use text strings on the controller 2018-03-26 16:54:39 -07:00
Toshio Kuratomi
02f44176b9 Document the relationship between octal numbers and the leading zero
Fixes #37875
2018-03-26 16:25:06 -07:00
Toshio Kuratomi
a82fea65c1 We need to save the basename into an attribute for calling code 2018-03-26 16:15:05 -07:00
David Passante
abae7a49f7 Fixes #37824. cloudstack: do not rely on APIs list queries for names (#37910) 2018-03-26 15:53:28 -04:00
nathanwebsterdotme
ce6595b567 aws_ssm_parameter_store - Make the module idempotent (#36252)
* Make the module idempotent

* pep8 fixes.

* Made required changes for overwrite_value for idempotency.

* Fix missing error definition

* Add in missing documentation variable.
2018-03-26 15:46:37 -04:00
Matt Martz
6051ef4041
Revert accidental addition of Mapping in #37741 (#37939) 2018-03-26 13:57:56 -05:00
Matt Martz
ffbbb5a25b
Use arg_spec type for comparisons on default and choices (#37741)
* Use arg_spec type for comparisons on default and choices

* Further improve type casting

* Make sure to capture output in more places

* Individually report invalid choices

* Update ignore.txt after resolving merge conflicts
2018-03-26 12:15:32 -05:00
Toshio Kuratomi
9890ce47e8 Optimizations in mod_args parsing
* Make it less likely that we have to identify all the modules during
  a playbook run.  PluginLoader is optimized to look for modules one
  directory at a time.  If we find a module before we've examined all
  the directories we never have to touch the other directories.
  Reordering this conditional makes it so tasks which don't have
  a module file will not force us to examine all the module directories
  before moving on to other sources of task actions.
* Change several variables we consult to see if a task is in a certain
  category from lists/tuples to frozensets.  These are static lists
  which we only do containment tests on so frozensets should be faster
2018-03-26 10:08:38 -07:00
Matt Martz
1f824bd620 Don't overwrite builtin jinja2 filters with tests (#37881)
* Don't overwrite builtin jinja2 filters with tests. Fixes #37856

* Fix tests and other callers of _get_filters
2018-03-26 12:06:00 -05:00
Nathaniel Case
169209c32a
Put back $PATH checking in ansible-connection call (#37933) 2018-03-26 12:49:30 -04:00
saichint
0df5cfd41f fix nxos_static_route issues (#37614)
* fix nxos_static_route issues

* remove nxos_static_route from ignore
2018-03-26 11:13:32 -04:00
Matt Martz
0dcd8b598c
Don't assume that self._task.action is copy, explicitly set. Addresses #37238 (#37777) 2018-03-26 10:04:06 -05:00
Ganesh Nalawade
8eaa9cc938
Fix junos modules check_mode issue (#37311)
Fixes #37208

If check_mode is enabled instead of committing th config need to
discard all the chnages to cnadidate db
In case of cli to discard changes issue `rollback 0` command
and for netconf execute `discard-changes` rpc call
2018-03-26 07:27:30 -04:00
Adam Miller
7cd3d9cc1a Correct msg to detect idempotent yum groupinstall (#37858)
The message text used to check stderr for a warning about
groupinstall in order to determine if a change occurred is specific
to the version of yum that is in RHEL7 and newer. This change simply
removes a couple words off the end in order to only use text found
in the warning message in older versions of yum.

Fixes #35982

Signed-off-by: Adam Miller <admiller@redhat.com>
2018-03-26 10:46:24 +02:00
Abhijeet Kasurde
f0fd0f219d Hide apikey from log in uptimerobot (#37342)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-26 03:02:00 -04:00
Heusini
702b5a3e81 Added poweroff_guest vm and reboot_guest vm in vsphere_guest (#34348) 2018-03-26 02:35:58 -04:00
Abhijeet Kasurde
adbda67151 New module: digital_ocean_domain_facts (#37269)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-26 01:48:13 -04:00
Will Thames
681c69f8c1 Fix the aws_kms_facts module name in module docs (#37902)
Forgot to update the examples when the module name changed to
have the `aws_` prefix
2018-03-26 12:18:36 +10:00
Sloane Hertel
ba0ff415a0 [cloud] ec2_vpc_nacl: add documentation about ingress and egress rules (#37747)
Fixes #25152

Use suboptions
2018-03-26 11:44:44 +10:00
Nate
2c44061a04 append request headers instead of replacing (#37845) 2018-03-26 05:35:41 +10:00
Jordan Borean
b7ce2b1c5a
win_certificate_store: fix typo stopping key_storage from working (#37810) 2018-03-24 09:17:18 +10:00
Eric Brown
e95e9de235 Typos in the yaml inventory plugin
This patch fixes up some English typos in the yaml inventory
plugin documentation.

* s/specifically/specific
* s/as/as an

Signed-off-by: Eric Brown <browne@vmware.com>
2018-03-23 18:01:40 -04:00
Strahinja Kustudic
68ff986708 Fix 'repomd.xml signature could not be verified' (#35989)
If a repo with `repo_gpgcheck=1` is added and the repo GPG key was never
accepted, quering this repo would throw an error `repomd.xml signature
could not be verified` and the module would fail. If that happens now
`yum -y makecache` will be run which will fetch the new repo data and
accept the repo GPG key.
2018-03-23 16:13:49 -05:00
Alex Tsitsimpis
c3ab6cb9b1 template: Add option to lstrip_blocks' and fix settingtrim_blocks` inline (#37478)
* template: Add integration tests for `lstrip_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Fix passing `trim_blocks' inline

Fix passing `trim_blocks' option to the template module as inline
argument. Previously passing the `trim_blocks' option inline instead of
using the YAML dictionary format resulted in it always being set to
`True', even if `trim_blocks=False' was used.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add option to `lstrip_blocks'

Add option to set `lstrip_blocks' when using the template module to
render Jinja templates. The Jinja documentation suggests that
`trim_blocks' and `lstrip_blocks' is a great combination and the
template module already provides an option for `trim_blocks'.

Note that although `trim_blocks' in Ansible is enabled by default since
version 2.4, in order to avoid breaking things keep `lstrip_blocks'
disabled by default. Maybe in a future version it could be enabled by
default.

This seems to address issue #10725 in a more appropriate way than the
suggested.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add integration tests for `trim_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Check Jinja2 support for `lstrip_blocks'

Since the `lstrip_blocks' option was added in Jinja2 version 2.7, raise
an exception when `lstrip_blocks' is set but Jinja2 does not support it.
Check support for `lstrip_blocks' option by checking `jinja2.defaults'
for `LSTRIP_BLOCKS' and do not use `jinja2.__version__' because the
latter is set to `unknown' in some cases, perhaps due to bug in
`pkg_resources' in Python 2.6.6.

Also update option description to state that Jinja2 version >=2.7 is
required.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>
2018-03-23 12:05:21 -04:00
Martin Krizek
687f3bbef3
apt: fix mark when no packages (#37835) 2018-03-23 15:06:03 +01:00
David Passante
270e799cb6 cs_vpc_offering: listVPCOffering API returns any matching names (#37783)
* fix listVPCOffering API method returns any matching names

* fix build_ci no-underscore-variable

* clearer variable name

* making it simpler
2018-03-23 09:13:41 -04:00
Martin Krizek
00d9345158
apt: mark installed packages manual (#37751)
* apt: mark installed packages manual

* Add fallback for when manual is not a thing
2018-03-23 12:23:12 +01:00
Jordan Borean
ca225d6da0
Changed Azure SecurityRule to use kwargs instead of positional args (#37695) 2018-03-23 20:37:22 +10:00
Fredrik Holmberg
e06f3463fd Typo in ipaddr filter (#37592)
interger = integer
2018-03-23 11:06:53 +01:00
Colin Nolan
a4a2b4a381 consul_kv: decodes kv values from Consul to utf-8 (#35894)
* Decodes kv values from Consul to utf-8.

* Switches to using module utils to perform text decoding.

* Adds self to authors list to help community maintenance.
2018-03-22 14:56:38 -07:00
Tim Werner
a51a699314 make jira authentication Python3 compatible (#33862)
* make jira authentication Python3 compatible
2018-03-22 14:38:01 -07:00
Brian Coca
3bec76fc85 Avoid 2nd processing of facts for actions
include_vars and set_fact are already updating hostvars in strategy
no need to 're add again' with lower priority the same data.

fixes #37535, mostly by avoiding reprocessing and 'cleaning'
2018-03-22 17:27:38 -04:00
Toshio Kuratomi
0633f73faf Fix loader for filters (#37748)
* Fix loading of filter and test plugins

Filter and test plugins are different than other plugins in that they
can have many plugins in a single file.  Therefore they need to operate
a little differently.  They need to have all of the potential files
returned.  Then the caller takes care of passing those onto jinja2 in
order for jinja2 to make use of them.

This problem was (most recently) introduced with f921369445

This commit also restructures how we deduplicate plugins to take paths
into account.  If we want to start scoping which set of modules are
loaded (due to roles, for instance) we'll need to hang on to the path
information.

* add integration test for override

* Fix style checks for bcoca code

* Implement jinja2 plugin loader as a subclass

Having a subclass allows us to customize the overriding of jinja
plugins.  We can then move common parts of common code into the Loader.
2018-03-22 17:23:10 -04:00
chenl87
e501134755 [aws] Register scalable target prior to creating/deleting a scaling policy (#35632)
* Added missing scalable target creation

* Changed if statement

* Added support to results of all actions

* Fixed line lengths, whitespaces and blank lines between functions

* Fixed documentation formatting

* Work in progress, fixed returns from functions, still need to do exception handling

* Work in progress, still need to do exception handling

* Moved to AnsibleAWSModule, Added exception handling

* Added detailed return doc

* Fixed return doc alarms

* fixed return yaml

* Fixed function calls when creating/deleting

* fixed unnecessary blank line

* removed imports and unnecessary checks handled by AnsibleAWSModule

* removed whitespace
2018-03-22 16:45:55 -04:00
Ravi
340064bfb9 Fix python3 interpreter issue (#34811) (#35176)
* Fix python3 interpreter issue (#34811)

* Update ansible.module_utils._text (#34811)

* Convert to text later to account for multibyte characters
2018-03-22 12:59:46 -07:00
Sloane Hertel
da3f7a8db1 [cloud] ec2_vpc_route_table: ignore routes without DestinationCidrBlock - fixes #37003 (#37010)
* [cloud] ec2_vpc_route_table: ignore routes without DestinationCidrBlock

Add module warnings rather than silently skipping

* Permit warnings for routes tables containing vpc endpoints to be turned off

* Add tests to ensure a VPC endpoint associated with a route table does not result in a traceback
2018-03-22 15:15:36 -04:00
Sloane Hertel
3a5a0fed06 [cloud] ec2_ami_copy: undeprecate wait_timeout to allow modifiable timeouts again to allow a longer timeout than 600 seconds (#37680)
Fixes #37111
2018-03-22 13:34:47 -04:00
Tony Goetheyn
868811adbc Documentation update (#37782)
- Mention Perl requirement for customisations to work in Linux based OS.
- Fix typo
2018-03-22 13:30:03 -04:00
Lachlan Cooper
fcbee7e40b Check that output from list_vhosts can be split (#37630)
As with list_users, list_vhosts can sometimes return a value that
doesn't contain a '\t' character. This appears to be the case if the
server has no vhosts, for example.

The same fix was applied to the rabbitmq_users module here:
fafb89cde5
2018-03-22 13:03:20 -04:00
Alessandro Asoni
6ad784bbbb Fixed issue with accessing response in digital_ocean module (#37268) 2018-03-22 10:35:56 -04:00
Will Thames
9802088082 New generator inventory plugin (#37690)
* New generator inventory plugin

Allows construction of hosts and groups through cartesian
product of various group combinations

* Add generator plugin documentation
2018-03-22 09:32:15 -04:00
Dag Wieers
2c2f335893
win_psexec: Fix pslint issues (#37718) 2018-03-22 03:21:07 +01:00
Dag Wieers
de5fb66026
win_product_facts: Fix pslint issues (#37722) 2018-03-22 03:18:48 +01:00
Zim Kalinowski
fef5f01b11 adding possibility to specify resource group for referred virtual net… (#36768)
* adding possibility to specify resource group for referred virtual network

* fixed sanity issues

* removed trailing whitespace

* added test

* fixed documentation

* try to fix unstable test

* Tidied up the description of virtual_network_resource_group
2018-03-22 12:10:29 +10:00
Zim Kalinowski
9fb04d20e1 azure_rm_networkinterface: don't query subnet as it's not necessary (#36826)
* don't query subnet as it's not necessary

* fixed pep8?

* another attempt to fix pep8 indentation
2018-03-21 21:59:46 -04:00
Dag Wieers
bc4f8a6786
win_tempfile: Fix pslint issues (#37720) 2018-03-22 01:10:16 +01:00
Jordan Borean
04539ca448
Updated text for azure_rm_virtualmachine around images that can be used (#37686) 2018-03-22 09:34:09 +10:00
Zim Kalinowski
0b828ee830 azure_rm_virtualmachine: adding possibility of disabling public ip address (#36766)
* adding possibility of disabling public ip address

* fixed indent

* fixed whitespace

* fixed mistake

* try to create test with vm without public ip address

* try to fix test

* another attempt for test

* fixing test

* create vm with no ip with different name and delete it immediately

* a few additional fixes

* another attempt to pass test

* must be deleted

* simplified no ip test

* reorganised tests

* Wrapped choice in C()
2018-03-22 09:30:42 +10:00
Zim Kalinowski
89401f13f7 azure_rm_networkinterface: fixed issue when public ip address should not be created (#36824)
* fixed issue when public ip address should not be created

* adding test for public ip address

* fixed samples

* another fix to sample formatting

* fixed test

* fix test

* fixed test

* another attempt to fix test

* maybe it works now

* still wrong

* improved check per customer request

* removed stupid semicolon

* updated test to match main scenario

* changed ip configurations to list

* another attempt
2018-03-22 09:16:32 +10:00
Dag Wieers
fdc0e5c5fb
win_defrag: Fix pslint issues (#37719) 2018-03-22 00:06:42 +01:00
Dag Wieers
f78b415db0
win_wakeonlan: Fix pslint issues (#37717) 2018-03-21 23:45:17 +01:00
Yuwei Zhou
8c819dd9cb Support MSI for ansible on Azure resources (#36634)
* msi

* add env and param

* add msi in default

* add azure_rm

* add document

* subscription param

* if not enabled msi

* remove the msi in default mode since the infinite loop will block if not enabled msi

* lint

* lint

* Update azure_rm_common.py

* fix

* catch exc and make error message more friendly

* lint

* Minor docs changes to the msi source option
2018-03-22 06:01:44 +10:00
Matt Clay
aee01564a9 Clean up non-standard module shebangs. 2018-03-21 11:04:55 -07:00
Abhijeet Kasurde
0ae7a0e88c
VMware: Use environment variable for connection (#37726)
This fix adds environment variables for connection in vmware_*
modules.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-21 13:31:24 -04:00
Dmitry Ulyanov
1d6bc094cf Add http(s)_proxy support in yum module (#36800)
* added set_env_proxy function for setting proxy environment

Added set_env_proxy function, that set system http(s)_proxy
environment for fetching RPM if proxy settings set in yum.conf file
that fix Issue - #18979

* fix automatic field numbering specification

* changed if statement in setting http_proxy environment

* Change set_env_proxy function to function with decorator

That decorator set system proxy environment from yum.conf and revert
back to system configuration after fetching RPM

* Minor fix

- rename variable schem  to scheme
- change 'in' to 'startswith'

* change decorator set_env_proxy to decorating through contextmanager

- added import contextmanager from contextlib
- set_env_proxy now decorating through contextmanager
- fix http/https setting environment principle
2018-03-21 11:55:36 -05:00
Nathaniel Case
6aed74a97d Fix edgeos_config: {backup: yes} (#37619)
* Fix edgeos_config: {backup: yes}

* Add actual plugin copy
2018-03-21 12:48:09 -04:00
Alexander Bethke
eebe728ae8 Fix SteamOS ansible_distribution fact (Fixes #33628) (#37576)
Fixes #33628
2018-03-21 11:50:54 -04:00
Andreas Mosti
ca634486f1 added parameter for allowing prerelease packages in win_chocolatey for #33243 (#37205)
make sure we don't pass it to state absent

removed trailing whitespace

forcing CI
2018-03-21 15:46:40 +01:00
Abhijeet Kasurde
aadbb6c0b4 VMware: Handle exception gracefully (#36619)
This fix adds logic to handle exception raised from conversion of
user parameter 'memory_mb'.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-21 10:29:46 -04:00
Murali krishnaswamy
7a4c3e5cad ovrit_cluster: fix for CPU arch entity #37425 (#37436)
* ovrit_cluster: fix for CPU arch entity #37425

* Corrected Indentation

* Condition to check if `architecture` is defined
2018-03-21 09:57:00 -04:00
Julien Vey
ec2e027980 cloudfront_distribution: fix the order of headers to avoid updates again and again (#37340)
* Fix python2/3 compatibilities issues

* Sort cloudfront_distribution headers to avoid useless updates
2018-03-21 22:16:42 +10:00
Alexander Braverman Masis
062a5551e0 ManageIQ module - provider refresh (#37573) 2018-03-21 05:34:24 -04:00
Chaitanya Deshpande
5bdc32ff8d Updated modules for Avi version 17.2.8 (#37344) 2018-03-21 02:47:09 -04:00
Charles V Bock
0214a85382 Correct module name in vcenter_license.py (#37672)
Module name should be vcenter_license not vmware_license.
2018-03-21 00:30:46 +01:00
Julien Vey
850ab534d7 iam_role_facts: Add information about instance profiles associated with the iam roles (#37641) 2018-03-21 09:29:18 +10:00
Ludek Finstrle
81cfbbbeb9 constructed inventory does not use group variables from previous inventory #37397
* Add support for loading invenotry group variables in constructed plugin
2018-03-20 18:26:27 -04:00
alu
b7aa41b9b9 Fix crash in py3: 'TypeError: a bytes-like object is required, not 'str' (#37504)
* Fix crash in py3: 'TypeError: a bytes-like object is required, not 'str'

Fixes #37387

* Review applied https://github.com/ansible/ansible/pull/37504#pullrequestreview-104799823
2018-03-20 14:33:14 -07:00
Toshio Kuratomi
09325b619e
Fix csvfile traceback on Python3 (#37625)
* Fix csvfile traceback on Python3

The csvfile lookup uses some custom iterators.  These needed to be
ported to handle the python3 iterator protocol.  In addition, the
csvfile module takes an iterator of byte strings in Python2 and an
iterator of text strings in Python3

Fixes #36808
2018-03-20 12:58:51 -07:00
Izuke
e02c72d856 Fixes #32146 Fixes reconcile inventory to correctly remove hosts from ungrouped 2018-03-20 15:37:39 -04:00
Toshio Kuratomi
b98ad3a12b Compare byte strings to byte strings
* Fix a traceback in ansible-pull on python3 comparing output from
  subprocess with a text string.
* Rename variables that hold byte strings so we are clear that those are
  not text strings.
* Use to_text() to transform variable that's being displayed as it's
  less fragile than str().

Fixes #36962
2018-03-20 12:04:05 -07:00
Toshio Kuratomi
0d55081ba8 Fix use of user_data field with spot_price in ec2 module (#37628)
The user_data field is base64 encoded inside of the boto library.  In
Python3, base64 must be used with byte strings.  So we make sure to
encode the user_data into a byte string before passing it on to the boto
library.

Fixes #34978
2018-03-20 15:01:24 -04:00
Matt Clay
775539a8b8 Fix api_profile choices in Azure docs fragment. 2018-03-20 11:07:34 -07:00
Phil Nelson
54e70fc783 Fix name parameter templating in include_role module (#36372)
An IncludedFile() object built using the original_task will have
its _task bound to the original_task. The iterative reassignment of
original_task._role_name during with_item loops leaves all returned
included_files with the same ._task._role_name (the final name from
the with_items list). This commit builds IncludedFile() objects
from an original_task.copy() to avoid the problematic binding.
2018-03-20 14:01:48 -04:00
Matt Martz
6c3e565ba3
Fix py3 issue in wait_for_connection (#37646) 2018-03-20 11:21:19 -05:00
Matt Martz
b95b077993 Restore skipped/failed in JSON callback, add custom facts (#37204)
* Restore skipped/failed keys. Fixes #37050

* Display custom stats. Fixes #37184

* Add version_added

* Drop fallback, use self.get_option

* Remove unused import
2018-03-20 10:32:33 -04:00
Aleksander Kovtunenko
f51a6ea832 implemented installroot option (#33613)
* fix

* move version to 2.6
2018-03-20 10:41:50 +00:00
Chaitanya Deshpande
334b291720 Added module for L4 Policy Set (#37346)
* Added module for L4 Policy Set

* Fixed review comments
2018-03-20 10:30:23 +00:00
Chaitanya Deshpande
b0a8d823d2 Added module for User Account (#37347) 2018-03-20 10:13:10 +00:00
Samer Deeb
a89bafce2e issue:37306 Fix issue with vlan support for onyx version 3.6.6000 (#37310)
* issue:37306 Fix issue with vlan support for onyx version 3.6.6000

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-03-20 10:08:35 +00:00
Claes Nästén
6308047dc9 nso_verify handle leaf-list in 4.5 and identityref (#37393)
NSO verify did not handle leaf-list value verification in 4.5 and
later due to changes made for configuration writing made.

map prefix for identityref types in verification.
2018-03-20 10:01:36 +00:00
Trishna Guha
00abe6dbe7
fix UnboundLocalError nxos_bgp_af module (#37610)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-20 01:53:08 +05:30
Fabian von Feilitzsch
716e170821 Auth method for the k8s lookup plugin now matches other modules (#37533) 2018-03-19 15:00:05 -04:00
Alessandro Arnone
ffd1200948 [cloud] ec2_asg: wait for the lifecycle hooks - Fixes #37281 (#37282)
Wait for the lifecycle hooks by matching states `Terminating:Wait` and `Terminating:Proceed` in addition to `Terminating`.
2018-03-19 14:59:07 -04:00
JP Mens
357beeb7ae Address some language in EXAMPLES (#37555) 2018-03-19 13:51:23 -04:00
Andrew Gaffney
0d0bdbec62 Load plugin config defs on first load only (fixes #37553) (#37584) 2018-03-19 13:34:15 -04:00
René Moser
3e44186137
cs_instance: add new template filter all (#37571) 2018-03-19 17:27:16 +01:00
Claes Nästén
9c668fb167 nso_action use json result format if available in NSO (#37395)
Use JSON result format when it is available and make the result format
returned look like it when JSON result format is not available in NSO.
2018-03-19 15:17:12 +00:00
Claes Nästén
458a07d5a4 add timeout parameter and increase default timeout for nso modules (#37391)
NSO operations can take much longer than 10 seconds as they operate on
real network equipment, set default timeout to 5 minutes and allow for
user override.
2018-03-19 15:12:58 +00:00
Adrian Likins
e166946a0a Fix redundant yaml error blurbs on ModArgs parse errors (#36923)
* Fix redundant yaml error blurbs on ModArgs parse errors

Some of the AnsibleParserErrors from parsing.mod_args
are created with the obj=some_yaml_ds options but
some are not.

If they were, we don't want to add another yaml_ds to
it, because that will result in double yaml error blurbs.
And since we dont need to add info, we can just re raise it.

But if there is no ._obj, add it here so we get the extra
detail in the error message (see issue #14790) and raise
a new AnsibleParserError instance.

Fixes #36848

* cleanup existing test_tasks pep8/sanity issues
2018-03-19 10:55:29 -04:00
Julien Vey
6281441e4d cloudformation: add create_timeout attribute (#36445)
* cloudformation: add create_timeout attribute
* No default value
* Only applies on stack creation
* In minutes
2018-03-19 10:38:17 -04:00
Claes Nästén
f8d20f970f Update Cisco NSO module required versions. (#36736)
NSO modules will now work with older versions of NSO, update version
requirements.
2018-03-19 14:18:44 +00:00
Julien Vey
26d9de6f3e apt_repository: check attribute repo for None value (#36944) 2018-03-19 10:16:43 -04:00
Martin Krizek
5be9315603 apt: use to_native instead of str for exc (#37595) 2018-03-19 19:00:58 +05:30
Felix Fontein
60fee5154b letsencrypt: don't mask values specified in data (#37556)
* Don't mask values specified in data.

This heavily improves readability of error messages such as
'Authorization for ******** returned in********:  CHALLENGE: ********-01 DETAILS: Incorrect TXT record "********" (and 1 more) found at ********.********;'
(verbatim quote).

* Added documentation.
2018-03-18 16:51:50 -04:00
Toshio Kuratomi
e356e13d66 Fix the initial value of a variable
This should be a dict, not a string.

Fixes #37455
2018-03-18 09:45:29 -07:00
Diogo Baeder de Paula Pinto
5d9090fbd7 Adding metadata from existing app to the JSON results, so that, for example, the app port can be referenced later 2018-03-18 09:43:41 -07:00
Diogo Baeder de Paula Pinto
a97d8dff5a Fix argspec for webfaction modules
* Fixing webfaction_domain "subdomains" argument parsing - must coerce to list, not string
* Fixing webfaction_db and webfaction_app "machine" argument default
2018-03-18 09:43:41 -07:00
cclauss
d30554bc90 Network F5: Adjust for Python 3 scoping rules (#37554)
This PR makes and adjustment for Python 3 scoping rules which differ from Python 2.  In Python 3, the variable __ex__ goes out of scope at the exit of the __try-except__ block.  This means that when __ex__ is referred to on the lines that follow, it would be an _undefined name_ causing a __NameError__ to be raised instead of the expected __ConnectionError__.

flake8 testing of https://github.com/ansible/ansible on Python 3.6.3
The command "echo ; echo -n "flake8 testing of ${URL} on " ; python -V" exited with 0.
130.72s$ time flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
./lib/ansible/module_utils/api.py:114:21: F823 local variable 'retry_count' (defined in enclosing scope on line 107) referenced before assignment
                    retry_count += 1  # pylint: disable=undefined-variable
                    ^
./lib/ansible/module_utils/six/__init__.py:54:20: F821 undefined name 'basestring'
    string_types = basestring,
                   ^
./lib/ansible/module_utils/six/__init__.py:55:27: F821 undefined name 'long'
    integer_types = (int, long)
                          ^
./lib/ansible/module_utils/six/__init__.py:57:17: F821 undefined name 'unicode'
    text_type = unicode
                ^
./lib/ansible/module_utils/six/__init__.py:658:16: F821 undefined name 'unicode'
        return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape")
               ^
./lib/ansible/module_utils/six/__init__.py:754:37: F821 undefined name 'basestring'
            if not isinstance(data, basestring):
                                    ^
./lib/ansible/module_utils/six/__init__.py:757:32: F821 undefined name 'file'
            if (isinstance(fp, file) and
                               ^
./lib/ansible/module_utils/six/__init__.py:758:38: F821 undefined name 'unicode'
                    isinstance(data, unicode) and
                                     ^
./lib/ansible/module_utils/six/__init__.py:768:32: F821 undefined name 'unicode'
            if isinstance(sep, unicode):
                               ^
./lib/ansible/module_utils/six/__init__.py:774:32: F821 undefined name 'unicode'
            if isinstance(end, unicode):
                               ^
./lib/ansible/module_utils/six/__init__.py:782:36: F821 undefined name 'unicode'
                if isinstance(arg, unicode):
                                   ^
./lib/ansible/module_utils/six/__init__.py:786:23: F821 undefined name 'unicode'
            newline = unicode("\n")
                      ^
./lib/ansible/module_utils/six/__init__.py:787:21: F821 undefined name 'unicode'
            space = unicode(" ")
                    ^
./lib/ansible/modules/cloud/misc/rhevm.py:594:24: F821 undefined name 'e'
            setMsg(str(e))
                       ^
./lib/ansible/modules/cloud/openstack/os_user.py:202:38: F821 undefined name 'shade'
    if description and StrictVersion(shade.__version__) < StrictVersion('1.13.0'):
                                     ^
./lib/ansible/modules/cloud/openstack/os_volume.py:153:27: F821 undefined name 'shade'
            StrictVersion(shade.__version__) < StrictVersion('1.22')):
                          ^
./lib/ansible/modules/files/archive.py:391:92: F821 undefined name 'e'
                module.fail_json(dest=dest, msg='Error deleting some source files: ' + str(e), files=errors)
                                                                                           ^
./lib/ansible/modules/network/dellos9/dellos9_facts.py:379:24: F821 undefined name 'key'
                parsed[key] += '\n%s' % line
                       ^
./lib/ansible/modules/network/dellos9/dellos9_facts.py:399:24: F821 undefined name 'key'
                parsed[key] += '\n%s' % line
                       ^
./lib/ansible/modules/network/dellos9/dellos9_facts.py:403:24: F821 undefined name 'key'
                parsed[key] += '\n%s' % line
                       ^
./lib/ansible/modules/network/dellos9/dellos9_facts.py:418:24: F821 undefined name 'key'
                parsed[key] += '\n%s' % line
                       ^
./lib/ansible/modules/network/f5/bigip_device_httpd.py:461:40: F821 undefined name 'ex'
        if 'Connection aborted' in str(ex) and 'redirectHttpToHttps' in params:
                                       ^
./lib/ansible/modules/network/f5/bigip_device_httpd.py:465:33: F821 undefined name 'ex'
        raise F5ModuleError(str(ex))
                                ^
./lib/ansible/modules/network/ironware/ironware_facts.py:274:24: F821 undefined name 'key'
                parsed[key] += '\n%s' % line
                       ^
./lib/ansible/modules/network/ironware/ironware_facts.py:514:24: F821 undefined name 'key'
                parsed[key] += '\n%s' % line
                       ^
24    F821 undefined name 'basestring'
1     F823 local variable 'retry_count' (defined in enclosing scope on line 107) referenced before assignment
25
2018-03-17 19:19:43 -07:00
Felix Fontein
190755ff65 Fixing domain to authorization matching for ACME v2. (#37558) 2018-03-17 19:03:16 -04:00
Dag Wieers
51662acc6c
Clean up Grafana docs a bit (#37516)
* Clean up Grafana docs a bit

But more is needed, default values, missing choices, proper
descriptions, actual sentences :-)

* Remove validate-modules entries
2018-03-17 02:53:26 +01:00
Luca Lorenzetto
e541bed186 Added parameters to na_cdot_volume (#37202)
* Added parameters to na_cdot_volume

Before this commit there were no parameter for creating a volume
and exporting it as NFS volume. The added parameters are:
- *junction-path* for specifying where to mount the volume in the namespace
- *export-policy* for specifying which export policy to apply to the given namespace
- *snapshot-policy* if required, applying a snapshot policy for scheduling data protection tasks

* Sanity fixes

* Sanity fixes (2)
2018-03-16 15:14:06 -04:00
Ryan Petrello
872a7b4a7a add some Tower module integration tests (and fix a bug or two) (#37421)
* add additional test coverage for tower modules

* add test coverage for the tower_credential module

* add test coverage for the tower_user module

* fix a bug in py3 for tower_credential when ssh_key_data is specified

* add test coverage for tower_host, tower_label, and tower_project

* add test coverage for tower_inventory and tower_job_template

* add more test coverage for tower modules

- tower_job_launch
- tower_job_list
- tower_job_wait
- tower_job_cancel

* add a check mode/version assertion for tower module integration tests

* add test coverage for the tower_role module

* add test coverage for the tower_group module

* add more integration test edge cases for various tower modules

* give the job_wait module more time before failing

* randomize passwords in the tower_user and tower_group tests
2018-03-16 13:28:19 -04:00
Nathaniel Case
594840c1d6
Close & remove paramiko connection where appropriate (#37528)
* Close & remove paramiko connection where appropriate

* Update unit test
2018-03-16 13:28:04 -04:00
Jack
93d2761551 Fix typo in timezone.py (#37442) 2018-03-16 11:18:03 +05:30
Sloane Hertel
16f8a993a0 Increase delay and tries for ec2_vpc_net backoff - fixes #36063, fixes #37323, fixes #36078 (#37354)
* Increase delay and tries for ec2_vpc_net backoff

Wait for DHCP option to be created in ec2_vpc_dhcp_option

Wait for all modifications to the VPC

* Use the vpc_available waiter because is uses Filters

* Missed one

* Optimize retries to only occur if the functionality is available

* Increase max wait time

* Add comments to explain what the waiters are doing
2018-03-16 08:07:54 +10:00
Dag Wieers
cdd21e2170
Clean up module documentation (#36909)
* Clean up module documentation

This PR includes:
- Removal of `default: None` (and variations)
- Removal of `required: false`
- Fixing booleans and `type: bool` where required

* Fix remaining (new) validation issues
2018-03-15 22:15:24 +01:00
Ondra Machacek
a6617e4357 ovirt: Fix documentation for interface parameter (#37459) 2018-03-15 13:31:22 -04:00
Nathaniel Case
85cc5ea129
Raise error when trying to use older iosxr modules with netconf (#37423) 2018-03-15 12:49:35 -04:00
Martin Krizek
a6d31b6fb1
apt: better error msg when update_cache fails (#37410) 2018-03-15 17:32:25 +01:00
Mans Matulewicz
6292fe1116 small typo fix
small typo fix
2018-03-15 11:01:32 -04:00
S. Veyrié
d3df0249af maven_artifact: add verify_checksum option - fixes #31799 (#33370)
* maven_artifact: add verify_checksum option - fixes #31799

* maven_artifact: some cleaning

* Remove blank lines to please the format checker

* Now targeting 2.6...
2018-03-15 06:43:08 -04:00
saichint
05b266cc66 fix nxos_udld issues (#37418) 2018-03-15 15:37:46 +05:30
Martin Krizek
995f6c7689
apt: clarify allow_unauthenticated docs (#37453)
* apt: clarify allow_unauthenticated docs

* Fix sanity check
2018-03-15 10:07:18 +01:00
Toshio Kuratomi
5bdc8fe9f6 Clarify the apt module force documentation (#37353)
The force parameter is inherently insecure.  Be clearer in the
documentation that this is the case.

Fixes #25242
2018-03-15 01:24:32 -07:00
Shinichi TAMURA
73512eeb78 timezone module: allow suse linux as target (#36719)
* timezone module: allow suse linux as target

* use with statement for file handling
2018-03-15 04:00:28 -04:00
Trishna Guha
dd37857884
fix ios_l2_interface (#37389)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-15 11:33:59 +05:30
Pilou
c718c42df4 ansible_tower modules doc: fix typos, use formatting functions (#37414)
* fix typos

* use formatting functions

* use 'job template' instead of 'job_template'

* acronyms: user uppercase

* become_enabled param is about privilege escalation
2018-03-15 13:58:50 +10:00
Simon Legner
4bba66e664 doc: Update pscx examples (#37245)
* win_chocolatey: replace pscx example

PSCX is no longer distributed via Chocolatey: https://chocolatey.org/packages/pscx#comment-3762408157

* win_unzip example: install psxc via win_psmodule
2018-03-15 09:10:58 +10:00
jjshoe
ff15a9e7e2 Document that this module was renamed recently (#37420) 2018-03-14 11:36:42 -07:00
Ricardo Carrillo Cruz
dd0140dfed
Add a note to iosxr_(command|config|facts) stating netconf is not supported (#37394) 2018-03-14 13:24:31 +01:00
Simon Dodsley
841cb0e6a4 Add fact to obtain iSCSI initiator IQN 2018-03-13 17:39:53 -07:00
Pilou
4378542ac7 Connection error messages are unsafe: wrap them (#37329)
* Check that connection error msg are not unsafe

* Connection error messages are unsafe: wrap them

For example, in case of error, docker connection plugin returns exception
message containing Go template. These messages weren't tagged as unsafe
and were consequently rendered:

The conditional check 'result is failed' failed. The error was:
{
  'msg': u'Docker version check ([\'/usr/bin/docker\', \'version\', \'--format\', "\'{{.Server.Version}}\'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied\n',
  'failed': True
}:
template error while templating string: unexpected '.'.
String: Docker version check (['/usr/bin/docker', 'version', '--format', "'{{.Server.Version}}'"]) failed: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/version: dial unix /var/run/docker.sock: connect: permission denied
2018-03-13 16:20:24 -07:00
Felix Fontein
042ad70da0 Production ACME v2 endpoint is available. (#37369) 2018-03-13 16:59:50 -04:00
Ryan Brown
93946ba627 Use NormalizedOperationMethod to catch ClientErrors so the waiter can handle them properly (#37356) 2018-03-13 16:02:39 -04:00
Adrian Joian
123694397a [openstack][docs] Fixing spelling error (#37351) 2018-03-13 14:21:23 -04:00
Toshio Kuratomi
31878ee0ea Fix ansible_lo being used inside of ansible_facts
The logic was keeping ansible_facts['ansible_lo'] instead of fixing it
to be ansible_facts['lo']
2018-03-13 12:05:14 -04:00
Sam Doran
aeb56e4bbe
Accept list or string for ports is seport module (#36661)
* Accept list or string for ports is seport module

Fixes #36466

* Update docs
2018-03-13 12:04:27 -04:00
Deepak Agrawal
a1026dbce5
Eos :do not push config to device if check_mode is enabled (#37287)
* eos can not check config without config session support

* add testcase for check_mode without config session

* fix eos eapi to read use_session env var
2018-03-13 17:13:23 +05:30
saichint
dc61f4c6b1 Fix nxos_vrf issues (#37092)
* fix nxos_vrf issues

* fix doc
2018-03-13 17:08:37 +05:30
Trishna Guha
ba5e562c76
Fix nxos_l2_interface and test typo (#37336)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-13 13:36:38 +05:30
Mike Wiebe
ff57fd0bb4 Fix nxos_switchport (#37328) 2018-03-13 12:03:05 +05:30
Samer Deeb
9031533c0c issue:36955 remove creating temp file for debug
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-03-12 23:06:08 -04:00
Dag Wieers
80ba7b7402 Various module doc fixes (#37256)
This PR includes:
- A fix for multiple-choice defaults
- A fix for messed up dictionary samples
- Cleaner defaults when they don't appear part of choices
2018-03-12 13:50:52 -07:00
Toshio Kuratomi
b945846814 Remove dead code
I wrote this code because we had a traceback at some point with pyyaml
not able to handle our AnsibleUnicode type (the C library was doing an
exact match to python's unicode type rather than testing with the object
inheritance hierarchy.) Neither jimi think that AnsibleUnicode gets
passed into this function anymore, though, so we think it is safe to remove.
2018-03-12 12:13:19 -07:00
Julien Vey
099d8f0b56 route53_zone: enable check mode (#37201) 2018-03-12 14:43:43 -04:00
jeffreykoetsier
d54675b44b Add support for Cloudformation's parameter attribute UsePreviousValue (#31775)
* Add support for Cloudformation's parameter attribute UsePreviousValue
2018-03-12 13:46:36 -04:00
Felix Fontein
3ce325e35e Improving EC account key parsing (see #37275). (#37293) 2018-03-12 06:54:06 -04:00
William L Thomson Jr
d1332b83ee Add support for --quiet-build and --quiet-fail to portage module
PR #36452
2018-03-12 11:19:07 +01:00
Sebastian Gumprich
16c564c4b4 fix spelling mistakes in several modules (#36296)
* fix more spelling mistakes

* fix spelling mistakes
2018-03-12 11:00:19 +01:00
Abhijeet Kasurde
a50db37c6c New module : digital_ocean_image_facts (#35887)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-11 11:43:23 -04:00
Mikhail Naletov
3bf6c50fa9 terraform: fixed typo, name error sdtout -> stdout (#37253) 2018-03-10 23:44:37 +01:00
Ondra Machacek
c5c78ab045 ovirt_vms: Pass correct VM entity to create method (#37249) 2018-03-10 04:41:23 -05:00
Ed Costello
1ceaf84108 Document compare_policies utility in AWS guidelines. (#37174) 2018-03-09 16:19:55 -05:00
Victor da Costa
cb53b717a4 Ansible Galaxy: skel for network role #37241 (#37251)
* Skel for network role (#37241)

Skel and boilerplate for network role.

* Add network option as valid type
2018-03-09 13:31:27 -05:00
mikedlr
c2a063a5c0 aws ssm parameter lookup - testing and documentation around negative and failure cases (#36550) 2018-03-09 12:30:33 -05:00
Dennis Glindhart
5506229e79 Remove restriction of SRV protocols (#36709) 2018-03-09 09:22:01 -05:00
Ganesh Nalawade
b440544e73
eos_config module exit session gracefully (#37244)
Fixes #36979
If `abort` is not issued in the top level session prompt
the existing session goes to pending state.
The fix is to come out of config mode by issuing `end` command
and again to same config session and execute `abort` which
`abort` is issued at the top level session prompt.
2018-03-09 19:24:23 +05:30
Trishna Guha
2501834c42
add nxos_snapshot test for missing required param (#37248)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-09 17:47:14 +05:30
Dylan Murray
90943a3362 Add APB role_type to ansible-galaxy init (#36789)
* Add APB role_type to ansible-galaxy init

* Add handlers scaffolding

* Fix shippable errors by setting default

* Add unit tests and fix shippable

* Updates init description
2018-03-09 06:50:17 -05:00
Trishna Guha
a10df8b0b5
fix required args for nxos_snapshot and docs improvement (#37232)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-09 14:08:01 +05:30
Markos Chandras
5234b78b5f modules: zypper: Optimize the 'search' subcommand (#37191)
When looking for installed packages we do not need to query
repositories since we only care about the rpmdb. As such, we can
disable all the repositories operations in order to improve the
performance of that step

Before this patch, when using 'state: present' in the zypper module,
the operation was taking about 12 seconds to complete:

time ansible-playbook foo.yml 1>/dev/null

real	0m12.614s
user	0m10.880s
sys	0m0.683s

After this patch:

time ansible-playbook foo.yml 1>/dev/null

real	0m4.193s
user	0m2.560s
sys	0m0.575s

see:
https://bugzilla.opensuse.org/show_bug.cgi?id=1084525
2018-03-09 03:28:36 -05:00
saichint
74e79d9f5e fix nxos_vrf_af issues (#37211) 2018-03-09 12:20:27 +05:30
Abhijeet Kasurde
c25a42bef6 VMware: New module : vmware_datastore_cluster (#36365)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-08 23:44:15 -05:00
Abhijeet Kasurde
1ec3d1f768 VMware: refactor vmware_datacenter (#36214)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-08 23:36:27 -05:00
Tim Smith
e479e55f59 Fix the docs link to Ohai in the Ohai module (#33788) 2018-03-08 17:00:17 -08:00
Jordan Borean
708869edd6
win: handle non string as an environment value (#37215)
* win: handle non string as an environment value

* Changed powershell environment handler to use .net function instead for special chars
2018-03-09 08:02:54 +10:00
Ivan Mikheykin
58261a42e9 Auto install of python-apt without recommends.
debian:9

`apt-get install python-apt` - this will install python2.7 and python3
After this operation, *88.4 MB* of additional disk space will be used.

`apt-get install --no-install-recommends python-apt` - only python2.7
After this operation, *35.0 MB* of additional disk space will be used.

(cherry picked from commit c542e62)
2018-03-08 16:21:30 -05:00
Sam Doran
3134ba6bee
Do not try to add an entry if none exist (#37152)
When commit revisions are disabled, there will be no revision items returned.
Add note about setting ANSIBLE_PERSISTENT_COMMAND_TIMEOUT to a higer value to avoid timeouts.
2018-03-08 14:36:32 -05:00
René Moser
0130490faa
cs_instance: fix py3 user_data base64 (#37135)
* cs_instance: tests: reproduce py3 user_data base64 issue

* cs_instance: fix base64 encoding with py3
2018-03-08 17:05:57 +01:00
René Moser
4b6b2d4206
vultr: fix py3 compat (#37171)
* vr_server: fix base64 encoding with py3

* vultr: fix AttributeError with py3
2018-03-08 16:46:06 +01:00
Felix Fontein
155adb1631 Using correct content type (as per version 10 of ACME draft). (#37165)
* Using correct content type (as per version 10 of ACME draft).

* Another incompatibility with ACME v2: body must be {} and not contain v1 data (Pebble fails otherwise).

* Fixing bug: self.args in a subclass of Exception is apparently always a tuple.
2018-03-08 09:11:20 -05:00
Trishna Guha
02999b77a4
fix nxos_switchport/l2_interface trunk_vlans state absent (#37180)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-08 18:10:04 +05:30
Ondra Machacek
d45ceb3a4f ovirt_hosts: Add option to choose to reboot the host (#35956) 2018-03-08 06:07:03 -05:00
Rene Moser
190d3fbbed cs_instance: fix error when state destroyed but querying user_data 2018-03-08 10:32:01 +01:00
John R Barker
6c8d40f653
yum is Python 2 only. If Python 3 use dnf (#37140)
* PY3 = dnf

Red Hat are unlikely to provide a Python 2 version of the yum bindings
as they are moving to `dnf`.

If Ansible can't find the yum Python library give the user a hint about
dnf and Python 3
2018-03-08 08:10:07 +00:00
Aren
2a0971435f examples fix: mode selection (#37128)
Mode selection in the examples didn't match (or work) for system: true.
It should be 
`mode: <mode here>`
2018-03-07 23:28:06 -05:00
Toshio Kuratomi
cca0ccaf97
Fix unarchive with strip-components in extra_opts (#37048)
* Fix unarchive with strip-components in extra_opts

When unarchive is given extra_opts to strip all leading directories, it
could end up trying to change the permissions on the root directory.
Tar archives shouldn't contain absolute paths anyways so make sure that
all paths are relative as we handle them.

Fixes #21397
2018-03-07 17:14:51 -08:00
Jordan Borean
c1f5e11cdf
win_uri: return response info on non 200 responses, convert DateTime values to ISO 8601 (#37104) 2018-03-08 09:43:42 +10:00
Abhijeet Kasurde
8f3f7f104f DigitalOcean: typecast map function for Python3 (#37126)
In Python2, `map` returns list whereas Python3, `map` function
 returns iterator. This fix typecast map function for Python3.

Fixes: #37114

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-07 11:31:23 -05:00
Julien Vey
51d491f8f0 route53_zone: move to boto3, and enable comment update (#36641) 2018-03-07 11:16:04 -05:00
TJ Tang
11f9286ab6 Fixes #37042
* correctly check that the no_device attribute is specified
 * ignore volume_size requirement if no_device is specified
2018-03-07 10:28:54 -05:00
Ondra Machacek
99ce712259 ovirt_host_networks: Fix idempotency (#37075) 2018-03-07 10:25:32 -05:00
bdowling
0fee332643 Added missing store regex pattern for prompt found after error (#35820) 2018-03-07 09:35:35 -05:00
Pilou
bc6b96d42e webfaction modules: fix broken import (#35024)
* webfaction_app: fix broken import
* doc: use formatting functions
* webaction_db: fix broken import
* webfaction_domain: fix broken import
* webfaction_mailbox: fix broken import
* webaction_site: fix broken import
* webfaction modules: fix doc
2018-03-07 06:22:06 -08:00
René Moser
e1297af18a cs_router: fix missing doc (#37107)
* cs_router: fix missing doc

* update ignore.txt
2018-03-07 13:34:39 +00:00
René Moser
67d8c8f5c6 cs_ip_address.py: fix missing doc (#37109)
* cs_ip_address.py: fix missing doc

* update ignore.txt
2018-03-07 13:15:39 +00:00
René Moser
2559e832df
cloudstack: fix common E324 in docs (#37082)
Notes about precedence of common args.
Partly fixes E324.
2018-03-07 11:09:08 +01:00
radixdlt
c6a6ea5d98 Add reference to VNET resource group (#34576)
Ported #26052
2018-03-07 04:01:33 -05:00
Nathaniel Case
efb8b539c1
Don't fail on configure in command (#37011)
* Don't fail on configure in command

* Change test to check mode
2018-03-06 18:10:09 -05:00
Jordan Borean
67ffde4ac1
win_wait_for: use loopback IP instead of hostname if 127.0.0.1 is used (#36762)
* win_wait_for: use loopback IP instead of hostname if 127.0.0.1 is used

* removed reverse dns lookup in port check
2018-03-07 08:40:57 +10:00
René Moser
4705edd1a7
letsencrypt: add new param force (#37077)
* letsencrypt: add new param force to ignore remaining days

* letsencrypt: fix E325
2018-03-06 20:51:24 +01:00
Nathaniel Case
f0dc0b28d4
Fix side-effect of flags being passed to ios get_config again (#37084) 2018-03-06 13:55:36 -05:00
Anil Kumar Muraleedharan
23f15e6ff6 Lenovo license update (#36840)
* Editing the License text after Review of Lenovo Legal team.
2018-03-06 18:02:46 +00:00
Alvaro Aleman
c9cb0016a0 Fix consul module service deregistration (#34847)
* Fix consul module service deregistration

Upstream pr in the python-consul library:
https://github.com/cablehead/python-consul/pull/174

This is based on work from https://github.com/bobh

Fixes ansible/ansible#34628

* Pass ACL token when deregistering consul service
2018-03-06 11:57:04 -05:00
skylerbunny
d984afa5ba Add compatibility for docker-py version 3 (#36973) 2018-03-06 07:14:31 -05:00
John R Barker
ebc71bcb16
Network modules to link to network guide (#37033)
* Network modules to link to network guide

* Make it clear what's deprecated
* enable -> become
* Detail when provider is still needed (eAPI/NX-API)
* Link to specific sections
* rx_rate & tx_rate to link to conditional docs
2018-03-06 12:01:07 +00:00
Trishna Guha
5f3feac7fa
remove unused tx_rate and rx_rate from vyos_interface (#37062)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-06 16:38:48 +05:30
saichint
4ed0e5072d fix nxos_vrrp issues (#36930) 2018-03-06 13:36:50 +05:30
Mike Wiebe
51e8eab9db Fix n3k separate to combined image upgrade (#37017)
* Fix n3k separate to combined image upgrade

* Address review comments
2018-03-06 10:05:08 +05:30
Ganesh Nalawade
ba3201cd2f
Fix eos integration test failures (#37020)
Fixes #36919

Fix other eos modules integration test failure in dci
2018-03-06 10:04:40 +05:30
Dag Wieers
cb79957b5f
Make use of named links in documentation notes (#37027)
* Make use of named links in documentation notes

Now that it is possible to name external links, we are making use of
this to make the documentation better.

* Add improvements to ACI documentation

* Disable QA for long line

* Add :menuselection: and :guilabel:

* Improve links on some modules
2018-03-06 00:05:13 +01:00
Ryan Brown
c8ef07e015 Route custom waiter (#36922)
This creates a way for us to use boto3's data-driven waiter support to use custom waiters where Boto3 hasn't implemented them yet.

The only waiter implemented so far is for VPC Route Tables to check that they exist, and this replaces some custom retry code.
2018-03-06 08:22:16 +10:00
Mikhail Naletov
51558f12f4 Added variables to destroy command (#37028) 2018-03-05 16:09:03 -05:00
Toshio Kuratomi
1bc860fafd
Python3 issues in maven_artifact (#37035)
Fixes #33761
2018-03-05 12:11:27 -08:00
Grigory Starinkin
2d98a2de68 fix python3 compatibility for znode module
kazoo client requires bytes and not string
2018-03-05 12:00:46 -08:00
David Newswanger
905b3e2f65
fix NIOS DNS lookup example (#36737) 2018-03-05 13:52:02 -05:00
msven
a2b3120e85 ec2_asg: fix #28087 and #35993 (#36679)
Fixes #35993 - Changes to update_size in commit eb4cc31 made it so
the group dict passed into update_size was not modified. As a result,
the 'replace' call does not see an updated min_size like it previously
did and doesn't pause to wait for any new instances to spin up. Instead,
it moves straight into terminating old instances. Fix is to add batch_size
to min_size when calling wait_for_new_inst.

Fixes #28087 - Make replace_all_instances and replace_instances behave
exactly the same by setting replace_instances = current list of instances
when replace_all_instances used. Root cause of issue was that without lc_check
terminate_batch will terminate all instances passed to it and after updating
the asg size we were querying the asg again for the list of instances - so terminate batch
saw the list including new ones just spun up.

When creating new asg with replace_all_instances: yes and lc_check: false
the instances that are initially created are then subsequently replaced.
This change makes it so replace only occurs if the asg already existed.

Add integration tests for #28087 and #35993.
2018-03-05 11:47:31 -05:00
Mike Klebolt
ce416f247f Fixes commit a28eb94, which broke validate_certs = False for python < 2.7.9 (#34887) 2018-03-05 11:34:03 -05:00
Guillaume Coré
daeec920b0 ini_file: add allow_no_value param (#24442) 2018-03-05 17:05:41 +01:00
Mikhail Naletov
7d0e1f92f4 [terraform] Support initializing modules and providers at runtime (#36996)
* Fixes #36994

Added function for force initializing modules and providers

Added type for force_init parameter
2018-03-05 11:01:53 -05:00
Nathaniel Case
7016b3b9ca
ios_static_route idempotence fix (#35912)
* Remove default admin_distance and fix the idempotence thereof

Fixes #33290

* Fix tests and use yaml anchors to shorten tests

* Add test for undefined admin_distance

* Read config from `show run` if `show ip static route` fails

* Restore flags to ios.get_config &  use get_config where appropriate
2018-03-05 09:28:37 -05:00
Nathaniel Case
0feea66988
Move _start_connection() to module_utils/connection and fix Popen() call (#36249)
* Fix Popen() call to use ansible python

* Remove PATH searching, reuse location of ansible instead
2018-03-05 09:12:01 -05:00
Peter Sprygada
6cbc69447b adds fix for terminal plugins 2018-03-05 08:54:40 -05:00
Peter Sprygada
18d605a132 ugh q 2018-03-05 08:54:40 -05:00
Peter Sprygada
d1ff03e84c fixes cliconf and netconf plugin loaders
This change updates the configuration and plugin loader objects for
cliconf and netconf to pull be able to configure where to find the
plugins.
2018-03-05 08:54:40 -05:00
abirami-n
4021194532 Fix_regex (#36569) 2018-03-05 06:30:37 -05:00
René Moser
6578403288
cs_zone_facts: implement return facts as ansible returns (#36993) 2018-03-05 11:42:38 +01:00
Abhijeet Kasurde
d1eb4fe58c
VMware: Refactor vmware_target_canonical_facts (#36964)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-04 10:20:47 +05:30
Abhijeet Kasurde
e0945900df
New module: digital_ocean_snapshot_facts (#35897)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-04 10:19:58 +05:30
John Smith
8824a8fe23 Assume firewall is offline on DBUS_ERROR during init (#36486)
During init, the FirewallClient tries to connect to the DBUS socket.  If it
fails to connect it should be safe to assume firewalld is offline.
2018-03-03 21:59:10 -06:00
Patrick Marques
83aaa8137a Fix Base64 decode TypeError (#36968)
```
TypeError: expected bytes-like object, not str
```
2018-03-03 16:33:07 -05:00
Abhijeet Kasurde
b973fff276
New module: digital_ocean_load_balancer_facts (#36966)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-03 21:55:54 +05:30
Abhijeet Kasurde
3ead89e3c5
New module: digital_ocean_tag_facts (#36965)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-03 21:55:21 +05:30
Will Thames
aa1e491244 [cloud aws_s3] Enforce required parameters for the various aws_s3 modes (#36767)
[cloud aws_s3] Most modes require `object` parameter, and this is easy to
get wrong (e.g. through confusion with the `dest` parameter). As
it's as easy to enforce, let's do that.
2018-03-02 16:33:04 -05:00
Will Thames
836d7a42a4 Remove old boto documentation and promote AnsibleAWSModule (#36763)
There should no longer be a need for boto documentation - it
just adds significant extra clutter to the guidelines.

AnsibleAWSModule greatly improves the codebase to such an extent
that we should mandate it for new code unless there is a
documented good reason.
2018-03-02 14:03:12 -05:00
Abhijeet Kasurde
3a161fa157
VMware: new module : vmware_datastore_maintenancemode (#36436)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-02 23:35:53 +05:30
Ryan Brown
2f72d082c0 Use Tower v2 API when available, falling back to v1 where necessary (#36663)
* Use Tower v2 API when available, falling back to v1 where necessary
2018-03-02 11:31:53 -05:00
Kevin Breit
a3390b63fe Reversed orser of icmp_type and icmp_code per bug 36378 (#36380) 2018-03-02 16:09:32 +01:00
Trishna Guha
ef7f3fcab6
eos_static_route fix (#36903)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-03-02 08:50:27 +05:30
Ed Costello
07bc98f019 Additions to AWS Module Guidlines from Pull Request Feedback (#36834)
* Update doc of AnsibleAWSModule to remove incorrect connect example.

Current example uses aws_connect method which no longer exists. Replace
this with the client and resource methods that do exist.

Also remove try/except block in connect example as guidelines imply that
there aren't connection errors thrown on connection, just when later
sing the connection.

* Update AWS module guidelines to include the AnsibleAWSModule connection methods.

* Add information on integration testing to the AWS module guidelines.

* Add information on common documentation fragments to AWS module
Guidelines.

* Changes as requested on PR.

* Restructure connection section to start with current best practice
* Explain the use of the CI build groups
* Use YAML Anchors for aws credentials example

* Replace guidance on use of test groups with link to aliases file.

This achieves the goal of explaining why this file is necessary without
introducing overhead of keeping documentation up to date when test
groups change.
2018-03-02 11:40:01 +10:00
Dag Wieers
858d10a91a
Clean up VMware BOTMETA and author/license info (#36873)
* Clean up vmware BOTMETA

This removes everything that's already part of the module docs. So
basically the BOTMETA file only extends the information from the module.

* Updated author information and copyright statement
2018-03-02 01:07:17 +01:00
Sloane Hertel
9deef5626f Only create tags if tags are provided (#36921) 2018-03-01 15:30:08 -05:00
Ryan Petrello
0e7106b106 properly pass /api/v1/ credential fields for older Towers (#36917) 2018-03-01 15:22:29 -05:00
Mikhail Naletov
7ade607525 Add variables and variable_file in terraform module (#36879)
* Fixes #36837

Added terraform variables for validate command

* Fixes #36837

Changed method from append to extend.
2018-03-01 12:50:49 -05:00
Ganesh Nalawade
b12e90311f
map network_os to ncclient device_params (#36819)
* map network_os to ncclient device_params

Fixes #36786

* update device map

* Add default netconf fallback plugin
2018-03-01 22:23:14 +05:30