Commit graph

19263 commits

Author SHA1 Message Date
Toshio Kuratomi
370a7ace4b
Split basic units (#33510)
Split the one monolithic test for basic.py into several files

* Split test_basic.py along categories.
  This is preliminary to get a handle on things.  Eventually we may want
  to further split it so each file is only testing a single function.
* Cleanup unused imports from splitting test_basic.py
* Port atomic_move test to pytest.
  Working on getting rid of need to maintain procenv
* Split a test of symbolic_mode_to_octal to follow unittest best practices
  Each test should only invoke the function under test once
* Port test_argument_spec to pytest.
* Fix suboptions failure
2017-12-18 10:17:13 -08:00
Prasad Katti
ba32827f3b Cleanup route53_zone examples (#34000) 2017-12-18 12:43:15 -05:00
Prasad Katti
2cdbde524b route53_zone: fix the private zone creation example (#33995)
Creating a private hosted zone requires both `vpc_id` as well as `vpc_region`
2017-12-18 12:02:53 -05:00
Prasad Katti
423b5e475e update ec2_vpc_net return values in docs (#33902) 2017-12-18 09:29:29 -05:00
Ondra Machacek
4e85cdc712 ovirt: Set no_log for storage connections (#33987) 2017-12-18 06:07:23 -05:00
Yanis Guenane
a724b8e722 openssl_certificate: Return self.cert.get_VALUES() (#33970)
Currently when we make up the return value, we take values based of the
parameters rather than the generated openssl_certificate itself.

This commits returns the actual certificate values making it all time
accurate.
2017-12-18 14:34:34 +05:30
Baptiste Fontaine
571f878817 file: Mention that src supports state=hard (#31697) 2017-12-15 17:17:34 -06:00
nathaniel gentile
441dc369ba py3 compatibility: convert bytes to str (#33206)
Fixes #31723
In python3, ansible's fetch_url utility function wraps urllib.request.urlopen.
For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse object slightly modified.
Calling .read() on an HTTPResponse object returns bytes (note the docstring fix).

Here, to_native is used to convert the bytestrings returned by fetch_url into unicode strings.
This is necessary because:
  1. Pre python3.6, json.loads requires passing a string, not a bytestring, as its argument
  2. In python3 generally, testing if a string is a substring of a bytestring
     using the 'in' operator will raise a TypeError

see:
- https://docs.python.org/3/library/urllib.request.html#urllib.request.urlopen
- https://docs.python.org/3/library/http.client.html#http.client.HTTPResponse.read
- https://docs.python.org/3/library/json.html#json.loads
2017-12-15 16:17:15 -06:00
André Nähring
b9bc64c7f9 Adding param "rule_num" for insert action to iptables module (#33708)
* Added rule_num parameter for insert action in iptables module
2017-12-15 16:08:40 -06:00
Pilou
85871da03d consul_acl: fix broken import (#33729) 2017-12-15 16:06:11 -06:00
Brian Coca
87c75b19dd
dont warn on not matching 'all' (#32806)
* dont warn on not matching 'all'

the implicit localhost warning shoudl be enough

* centralized no hosts handling

also extended info on implicit only
2017-12-15 15:43:51 -05:00
Brian Coca
2b7799f817
added flatten filter (#33102)
* added flatten filter
2017-12-15 14:40:02 -05:00
Maxime de Roucy
c2ac9d0831 fix file attributes changed detection
https://docs.python.org/2/library/stdtypes.html#str.split
str.split([sep[, maxsplit]])
If sep is given, consecutive delimiters are not grouped together and are deemed
to delimit empty strings.

>>> "85563      ----------------C-- /var/lib/libvirt/images".split(' ')[0:2]
['85563', '']
>>> "85563      ----------------C-- /var/lib/libvirt/images".split()[0:2]
['85563', '----------------C--']
2017-12-15 09:48:18 -08:00
Matthew Staebler
82cd5ffa1d [aws modules] use ec2_url in a few places it was missing (#33954) 2017-12-15 12:06:24 -05:00
bdowling
d59bba4652 Fixes prompt doubling issue that impacted missing ios enable password prompts. (#33794)
* Fixes a prompt doubling issue that impacted missing ios enable password prompts.

Due to get_prompt sending a '\n' the prompts became doubled and out-of-sync with what
was expected.  This caused the enable command prompts to be missed.
Also added verification that on_become succeeded to reach enable prompt.

* Moved prompt doubling comment per shippable
2017-12-15 11:31:28 -05:00
Konstantin Shalygin
3c0a84349b [module] find: Add ability to exclude results by pattern. (#18949) 2017-12-15 09:27:34 -07:00
Nathaniel Case
f71bbdfed5
Fix vyos sending 'None' to device (#33889)
* Fix vyos sending `'None'` to device

* Move bytes handling into common cliconf code
2017-12-15 11:20:53 -05:00
Claes Nästén
5fdb39c4d1 nso_verify for Cisco NSO (#33945)
Module for verifying that configuration is as expected in Cisco NSO.
2017-12-15 13:43:07 +00:00
Abhijeet Kasurde
b5318e2c34
VMware: Add NIC configuration option (#33851)
This fix adds following configurable parameters to virtual network card
of virtual machine.
* WakeOnLanEnabled
* StartConnected
* AllowGuestControl

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-12-15 17:54:52 +05:30
Claes Nästén
b2bc98c161 nso_action for Cisco NSO (#32781)
nso_action module for execution actions/RPCs in NSO.
2017-12-15 11:29:04 +00:00
Abhijeet Kasurde
29d3505cb4
VMware: check for ESXi server while creating user (#33061)
This fix check for ESXi server instance before proceeding
with managing local user. Also, adds integration tests for
this change.

Fixes: #32465

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-12-15 16:26:19 +05:30
Abhijeet Kasurde
31510259f6 VMware: Refactor vmware_portgroup (#33703)
Fix adds following:
* Documentation update
* Idempotency
* Remove Portgroup functionality

Fixes: #33666

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-12-15 05:14:05 -05:00
Ganesh Nalawade
2f932d8767
Add parent pid to persistent connection socket path hash (#33518)
* Add parent pid to persistent connection socket path hash

Fixes #33192

*  Add parent pid in persistent connection socket path hash
   to avoid using same socket path for multiple simultaneous
   connection to same remote host.

* Ensure unique persistent socket path for each ansible-playbook run

* Fix CI failures
2017-12-15 10:21:56 +05:30
Abhijeet Kasurde
08a2338277
Add idempotency in snapshot creation (#28466)
Fix adds idempotent behavior while creating snapshot

Fixes: #24511

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-12-15 08:34:39 +05:30
Jordan Borean
0ca828ebab
win_iis_webapppool: stop any passwords from being returned (#33931) 2017-12-15 09:50:44 +10:00
Sloane Hertel
cae14e16ac Port ec2_vpc_net to boto3 and add support to expand existing VPCs - fixes #31216 (#33105)
* Port ec2_vpc_net to boto3 and add support to expand existing VPCs

* Add s-hertel as an author for ec2_vpc_net

* Update ec2_vpc_net test for new error triggered by lack of credentials

Fix backwards compatibility

Document new return value

* Fix pep8 and return documentation
2017-12-15 09:41:03 +10:00
Brian Coca
465ace4c14 else was wrong 2017-12-14 17:38:39 -05:00
Haridas N
0eb426bb9e HipChat API v2 support for ansible callback plugin (#33882)
* hipchat API v2 support for callback plugin.

* hipchat API v2 support for callback plugin.

* Migrated to new way of handling plugin config.
2017-12-14 17:30:31 -05:00
Tim Rupp
22059cbe67
Adds bigip_device_httpd module (#33924)
this module can be used to adjust the details of the server that
hosts the BIG-IP web ui.
2017-12-14 14:16:28 -08:00
Matt Martz
0b9f1f7982
Handle vault filenames with nonascii chars when displaying messages. Fixes #33879 (#33926) 2017-12-14 16:02:25 -06:00
Ted Timmons
ff4eb94a04 accept variants of returned json mime type (#33894) 2017-12-14 15:54:59 -06:00
Will Thames
ddc3465408 [cloud] Remove repeated error handling and region checking, both now in boto3_conn (#32774)
* Remove boto usage from boto3 modules

* Remove region checking

boto3_conn now takes care of region checking and handles NoRegionError
exceptions with a standard message

boto3_conn also takes care of other connection exceptions too.

* Document boto3 as a requirement for ec2_eni_facts
2017-12-14 16:16:59 -05:00
Mamad Purbo
c52964a6f4 [cloud] support encryption on create S3 folder (#33854) 2017-12-14 16:10:42 -05:00
Brian Coca
54e8e122bf
fix doc fragments (#33892)
* fix doc fragments

fixes #33864

* pop it
2017-12-14 16:06:47 -05:00
Stefan Horning
c421878523 [cloud] Return id of ENI in addition to network_interface_id for ec2_eni_facts (#33814)
* Return id of ENI in addition to network_interface_id. To be compatible to ec2_eni.

* Added documentation for the return values of the ec2_eni_facts module

* Fix typo in docs for ec2_eni_facts
2017-12-14 15:02:06 -05:00
Gaël Lambert
82949f6e6f lookup hashi_vault: Add Vault App role in auth_method (#22403)
Provide Vault App role method to the lookup.

https://www.vaultproject.io/docs/auth/approle.html

Usage :

`{{ lookup('hashi_vault', 'secret=secret/hello:value auth_method=approle role_id=myroleid secret_id=mysecretid url=http://myvault:8200')}}`

You can skip `role_id` and `secret_id` if you set `VAULT_ROLE_ID` and `VAULT_SECRET_ID` environment variables.
2017-12-14 13:25:05 -06:00
Adam Miller
6cb388a98a New Module: package_facts (#33195)
* new package_facts module

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>

* remove package_facts pkg manager aliases, they are misleading

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>

* fix package_facts tests now that aliases are dropped

Signed-off-by: Adam Miller <maxamillion@fedoraproject.org>
2017-12-14 13:47:47 -05:00
David Soper
d1cf9cfeb6 Connection and MAC pool module for Cisco UCS (#31151)
* Initial commit for UcsConnection and ucs_macpool module.
Configures MAC address pools on UCS Manager.

* ansible-doc fixes

* PEP8 fixes

* pep8, pylint, and validate-modules fixes

* Correct indent issue introduced during pycodestyle cleanup

* Simplified module arugment setup.
Placed all code in main to avoid multiple calls and arg passing.

* module_utils/ucs changed to UCSModule which now handles login/logout directly
login_handle removed from module.params
doc updates on mac_list params and change to first_addr/last_addr for mac blocks
checking of all mac params

* Move module_utils to remote_management/ucs
Fix validate-modules issue with docs

* UCS MAC pool integration tests
Fixed issues with MAC pool descr and address range params
2017-12-14 19:38:35 +01:00
Brian Coca
67c83823f2 Add q/query aliases to lookup (#33466)
* Add L alias to lookup, defaults to real list
* renamed to q/query as per core meeting
* also force wantlist=true
2017-12-14 11:53:00 -06:00
John R Barker
f127e5d535
Fix a few docs build issues (#33685)
Noticed when doing `make webdocs`
2017-12-14 17:33:27 +00:00
Prasad Katti
6995985a52 Pass in '**results' to exit_json only if results is a dict (#33910) 2017-12-14 10:59:56 -05:00
Brian Coca
11063dabaf fixed version_added, update clog 2017-12-14 10:41:46 -05:00
Brian Coca
1a7c096954
new redis lookup (#33883)
* new redis lookup

deprecated redis_kv

* typo fix
2017-12-14 10:35:46 -05:00
Nathaniel Case
67a8ff47aa
Promote get_prompt to live in network_cli instead of cliconf (#33880)
This removes the immediate need for a cliconf plugin to use network_cli
2017-12-14 09:51:41 -05:00
rhpvorderman
5578193ae4 Block markers in blockinfile no longer hard coded (#31787)
* Block markers in blockinfile no longer hard coded
2017-12-14 08:24:14 -06:00
Kairo Araujo
7a5ea9cae4 Included ansible_distribution_major_version #29561 (#31754)
Included ansible_distribution_major_version according with
issue #29561
2017-12-14 08:22:48 -06:00
Abhijeet Kasurde
4391f5c094
VMware: Handle No Permission exception while clone (#33806)
This fix adds exception handling for No Permission exception
raised while clone operation.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-12-14 19:13:23 +05:30
tchernomax
a09fd80bba VMware: fix vmPathName on VM creation (#33315)
* VMware: fix vmPathName on VM creation
* vmware_guest: enable unit tests disk_type_d1_c1_f0
2017-12-14 18:41:09 +05:30
Katerina Koukiou
137498bff1 cloud:ovirt:ovirt_storage_domains.py: Allow not passing dc_name parameter (#33377)
When state == absent we can skpi dc_name parameter.
This patch introduces same functionality for other states.
2017-12-14 07:53:42 -05:00
pmargara
5a4fd97955 Added 'quota' parameter and 'description' parameter to ovirt_disk module (#33860)
* Added 'quota' field and 'description' field to ovirt_disk module

* ovirt_disk: fixed example

* quota => quota_id and other improvement
2017-12-14 07:53:16 -05:00