Commit graph

20879 commits

Author SHA1 Message Date
Kevin Breit
d5cfc54ef4 Validate SSL in panos_import (#36972)
* Fix bug 36936

* Added version_added to argument and fixed whitespace

* Update panos_import documentation

Update parameter documentation and add note.

* Add type documentation

* added version number for documentation

For real

* Integrated recommended changes

- Added recommended changes from PR

* Changed validate_ssl default back to True considering there is a
note at the top of documentation explaining change

* Format changes based on recommendations from gundalow

* Rename validate_ssl to validate_cert

* Change description to remove SSL reference

* Change url default ih documentation

* Integrated small changes from bug report
- Renamed validate_cert to validate_certs
- Changed documentation for disabling cert validation
2018-04-05 13:29:33 +01:00
shadbarton
613f24a346 Fix typo in apt.py (#38332) 2018-04-05 14:06:12 +02:00
James Hogarth
509f52a8ed ISSUE-37945 output not populated on failure (#37952)
* ISSUE-37945 output not populated on failure

This always includes output, but it is empty on failure.

* handle the other failcases as well
2018-04-05 05:49:10 -04:00
Ryan Brown
1c7b9e66b4 AWS WAF module custom waiter (#37026)
Consolidate waiters to a single file

* Add waiter message with token ID
* Add waiter

Add waiter for WAF change tokens

Working waiter for waf_condition module

Add support for waiters to waf_rule

* WAF data model refactor

* Fix ref to self.client

* Add custom waiters to aws_waf_web_acl

* Allow add/remove rule tasks to operate in parallel, then wait for their change tokens to complete

* Move waiter into run_func_with_change_token_backoff since it is generic to all WAF update operations

* Wait for deletes on waf_web_acl

* Remove always-wait

* Remove waiter retry catch
2018-04-05 11:30:57 +10:00
Milan Ilic
5b703a2a53 Add OpenNebula one_image_facts module (#38169)
* Add OpenNebula one_image_facts module

`one_image_facts` - module for gathering facts about OpenNebula images
Add integration tests

* Add an alias for ids
2018-04-04 22:53:31 +02:00
Martin Krizek
92bb3c2788 Fix grafana CALLBACK_VERSION 2018-04-04 11:26:22 -04:00
Colin Rymer
893b4e9116 Fix spelling of "lookup" across docs and src comments
PR #38273 by @colinrymer
2018-04-04 15:52:55 +02:00
Roman Bolshakov
3c53e2f8ea openvswitch_db: Split key-value pairs correctly (#33335)
Map values can contain commas, e.g.
    - name: Configure OVN bridge mapping
      openvswitch_db:
        state: present                                                                                                                                                                                                                                table: open_vswitch                                                                                                                                                                                                                           record: .                                                                                                                                                                                                                                     col: external_ids                                                                                                                                                                                                                             key: ovn-bridge-mappings
        value: '"vmnet-static:br-vmnet-st,vmnet-dynamic:br-vmnet-dyn"'

Previous behaviour was splitting the value and raised an exception.
2018-04-04 07:49:01 -06:00
Evgeny Fedoruk
5e990301bb Fixing lack of failure when uploaded source is invalid (#37461)
Checking the response status for 400 and throwing exception.
Unit tests updated.

Fixes #37406
2018-04-04 07:48:22 -06:00
John R Barker
a4e932ee9f ansible_ssh_pass is the ENV variable (#38035)
* ansible_ssh_pass is the ENV variable

* ansible_ssh_pass then ansible_password

* priority is top(lower)->bottom(higher)
2018-04-04 07:45:57 -06:00
Samer Deeb
72d42bd065 issue:38167 add support for onyx version 3.6.6000 for onyx_linkagg (#38191)
Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-04-04 07:43:10 -06:00
Daniel Andrei Mincă
19ca1b2b8a Fix typo in Slack Callback plugin (#38268)
`get_options` is an undefined method from CallbackBase

As a result, remove the trailing `s` letter.

Signed-off-by: Daniel Andrei Minca <mandrei17@gmail.com>
2018-04-04 15:29:49 +02:00
Abhijeet Kasurde
ac9dbdeb10 nmcli: check NMClient, NetworkManager availability (#38076)
This fix adds check for NMClient, NetworkManager availability
while using require_version API.

Fixes: #38042

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-04 05:58:38 -04:00
Ganesh Nalawade
3a4fc4af08
Add error handling for junos in case wrong connection type (#38023)
* Add error handling for junos in case wrong connection type

Fixes #37990

If a junos module doesn't support given connection/transport type
return appropriate error message.

* Fix CI issues

* Fix review comment
2018-04-04 09:54:47 +05:30
Jordan Borean
f37a44430f win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets (#37897)
* win_service: fix when dealing with paths with special chars and change WMI to CIM cmdlets

* compare username in lowercase for test
2018-04-03 18:28:10 -07:00
Dag Wieers
3a1cd4d45a
Fix incorrect RN used in module (#38245)
This requires backporting to v2.5
2018-04-04 02:43:58 +02:00
Julien Vey
63a8ae94a7 cloudfront_distribution: fix restrictions (#37476) 2018-04-04 10:26:14 +10:00
Rémi REY
71699d5140 Introduce grafana callback plugin. (#34246)
* Introduce grafana callback plugin.

The grafana plugin plublishes annotations to the HTTP API available in
Grafana 4.6+

The callback publishes:
* An annotation on playbook start, tagged with "ansible",
 "ansible_event_start" and playbook name, example:

```
{
    "text": "Started playbook test.yml\n\nFrom 'pc45.home'\nBy user 'remirey'\n",
    "tags": ["ansible", "ansible_event_start", "test.yml"],
    "time": 1514291163000
}
```

* An annotation on error containing the host and task who failed and
  tagged with "ansible", "ansible_event_failure" and playbook name, example:

```
{
    "text": "Playbook test.yml Failure !\n\nFrom 'pc45.home'\nBy user 'remirey'\n\n'TASK: simulate failure' failed on localhost\n\ndebug: {\"changed\": false, \"msg\": \"Some random failure\"}\n",
    "tags": ["ansible", "ansible_event_failure", "test.yml"],
    "time": 1514291165000
}
```

* A region annotation emitted on playbook stats, tagged with "ansible",
  "ansible_report" and playbook name, example:

```
{
    "text": "Playbook test.yml\nDuration: 1.641703\nStatus: FAILED\n\nFrom 'pc45.home'\nBy user 'remirey'\n\nResult:\n{\"localhost\": {\"unreachable\": 0, \"skipped\": 0, \"ok\": 2, \"changed\": 1, \"failures\": 1}}\n",
    "tags": ["ansible", "ansible_report", "test.yml"],
    "isRegion": true,
    "timeEnd": 1514291165000,
    "time": 1514291163000
}
```

Fixes #34225
2018-04-03 18:51:52 -04:00
Peter Sprygada
91a748e33b fixes issue when netconf would report ios is not supported (#38155)
* fixes issue when netconf would report ios is not supported

This change now will map ansible_network_os=ios to the correct netconf
plugin implementation.  This will resolve an error where the netconf
connection plugin will report that ios is unsupported.
2018-04-03 17:01:59 -04:00
Sloane Hertel
873a9ddf8d [cloud] Add custom waiters to stabilize ec2_vpc_subnet module - Fixes #36083 (#37534)
* stabilize ec2_vpc_subnet module

* Add waiters for ec2_vpc_subnet

Clean up integration tests

* Reenable CI for stabilized ec2_vpc_subnet tests

* rename waiters

* Use module_json_aws where applicable

Handle WaiterError first if waiting failed

* Fix traceback when tagging with keys/values that look like booleans

* Fix check mode with tags

* Add integration tests for tags that look like booleans and check mode

* Add waiter for deleting subnet

* Sleep a few seconds after using aws command line
2018-04-03 15:25:00 -04:00
Rémy Léone
95c15757a2 Initial commit for Scaleway support (#37638) 2018-04-03 14:04:42 -05:00
Julien Vey
b000339a31 ec2_instace: fix instance_role argument (#37465) 2018-04-03 11:39:39 -04:00
Matt Martz
ddf937d642
Don't pass keyword args as positional, include file_name. Fixes #38190 (#38194) 2018-04-03 09:59:13 -05:00
brhatiga
8199b448e8 Add no_log to activationkey (#36657) 2018-04-03 07:35:21 -04:00
Megian
7a5e7c83d3 dictionary changed size during iteration error (#37454)
Iterating an object and changing it at the same time is unsecure and no longer permitted in Python >= 3.6

Provisioning an instance fail with the Python error: "RuntimeError: dictionary changed size during iteration"
2018-04-03 06:13:09 -04:00
Kassian Sun
72657ce815 Add example to clear the usage of extra_opts (#31873) 2018-04-03 05:03:11 -04:00
Charles Chan
fd711671ed copy: doc: fix typo (#38197) 2018-04-03 09:26:35 +02:00
Trishna Guha
119352b538
nxos_vlan purge (#38202)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
2018-04-03 02:53:44 -04:00
saichint
24cc6b80bd fix nxos_aaa_server_host issues (#38188) 2018-04-03 01:53:43 -04:00
Dag Wieers
35b7b608bf
Add missing required property to docs
<!--- Your description here -->

+label: docsite_pr
2018-04-03 03:32:49 +02:00
Julien PRIGENT
70bcc5ed45 ec2_snapshot_copy: WaitError and ClientError exception handling (#38072) 2018-04-03 10:23:35 +10:00
Gennady Aleksandrov
67cd641c04 Fixes #38085 - cloudfront_invalidation doesn't work for the first invalidation ever (#38086) 2018-04-03 10:14:09 +10:00
Abhijeet Kasurde
2d90f50eeb git_config: add quotes in complex value (#38168)
This fix adds quotes to complex values of git config keys.

Fixes: #20954

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-04-02 19:09:39 -04:00
cpitre
5d779fada0 Doc formatting update for office_365_connector_card.py (#38142)
* Update office_365_connector_card.py

The two bullet items were about one single item; this module is not idempotent.
Therefore the two bullet items should be one.

 label: docsite_pr

* Update office_365_connector_card.py

Removed trailing white space that caused the test failure.
2018-04-02 16:23:47 -05:00
Ryan Brown
87bd169ca9 Allow subnets with names formatted like subnet-1234 (#37740)
* Allow subnets with names formatted like `subnet-1234`

* Deduplicate IDs, in case a subnet is specified both by name and ID
2018-04-02 17:13:44 -04:00
Alex Stephen
d129396274 GCP: Compute IP Addresses (#36325) 2018-04-02 16:42:49 -04:00
Artem Tiumentcev
082b03c829 fix set options in callbacks for foreman 2018-04-02 12:17:39 -04:00
Jim Gu
5839f07e0f yaml callback fails on python3
When the URI module returns complex JSON objects, the YAML callback
fails while trying to represent these objects.  The problem arises
because the filter method returns an iterator in Python 3, rather than a
str object.  Therefore, the str method expandtabs() is not available,
and the callback fails with the following error:

[WARNING]: Failure using method (v2_runner_on_failed) in callback plugin (<ansible.plugins.callback.yaml.CallbackModule object at 0x7f7c7ed8aa20>): 'filter' object has no attribute 'expandtabs'

Issue can be replicated by running this playbook:

- hosts: localhost
  gather_facts: false
  tasks:
    - uri:
        url: https://jsonplaceholder.typicode.com/posts

ansible-playbook tmp.yml -v
2018-04-02 11:41:00 -04:00
Will Thames
423b0e0f58 Improve details and events results for ecs_service_facts (#37983)
* Use AnsibleAWSModule to simplify AWS connection
* Add Exception handling, pagination, retries and backoff
* Allow events to be switched off
* Allow details to be obtained without having to specify services
2018-04-02 11:26:23 -04:00
Sascha Marcel Schmidt
50761bef0a changes description to match module (#31364) 2018-04-02 11:24:15 -04:00
Milan Ilic
a73e2a924b Add OpenNebula one_image module (#37831) 2018-04-02 16:58:39 +02:00
saichint
697c301f04 fix nxos_aaa_server issues (#38117) 2018-04-02 07:56:06 -04:00
Yasen Simeonov
b4debfad9a Add NSX-T Logical Switch support in vmware_guest (#37979)
* Add NSX-T Logical Switch support in vmware_guest

* Update vmware_guest.py

add space after % operator
2018-04-02 05:35:13 -04:00
balonik
0cdba9ff70 add instanceUuid (also called PersistentId) in vmware utils (#37127) 2018-04-02 01:49:39 -04:00
Felix Fontein
93fc99c576 Making clearer that the module has to be executed twice, and that the second run needs the data of the first (#37884). (#38135) 2018-03-31 10:07:00 -04:00
René Moser
28ce3c2329
doc: inventory: nmap: fix version added (#38157) 2018-03-31 11:45:12 +02:00
René Moser
b06dfbec54
cs_user: fix E325 (#38158) 2018-03-31 11:44:04 +02:00
Felix Fontein
8b98c29afd Remove the deprecated tls-sni-02 challenge method. (#38137) 2018-03-31 03:17:12 -04:00
Ondra Machacek
9a21f9b2db ovirt_host_networks: Fix of bond assignment (#38054)
* ovirt_host_networks: Fix of bond assignment

* ovirt_host_networks: Fix bond modes

* ovirt_host_networks: Fix incorrect prefix documentation
2018-03-30 07:56:11 -04:00
Ondra Machacek
477a602fdf ovirt_hosts: Fix failed_state after PM fence (#38102) 2018-03-30 07:55:17 -04:00
Yuwei Zhou
1c00a14c31 fix typo (#38131) 2018-03-30 03:46:53 -04:00
Dag Wieers
126a41327c
Update docs to highlight lookup plugins for templating
<!--- Your description here -->

+label: docsite_pr
2018-03-30 09:33:02 +02:00
Dag Wieers
3973eb4c30
Added an example using a templated payload file
<!--- Your description here -->

+label: docsite_pr
2018-03-30 09:27:45 +02:00
Abhijeet Kasurde
16cf51926d VMware: vmware_portgroup teaming policy support (#36778)
This fix adds support for specifying teaming policy in
vmware_portgroup module.

Fixes: #36773

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2018-03-29 23:03:45 -04:00
Martin Krizek
fd96bcd22f Use correct action in warning about missing name 2018-03-29 18:10:00 -04:00
Brian Coca
5e2f215dd7 Nmap inventory (#32857)
* nmap inv plugin draft

* more accurate regex

* fix format
2018-03-29 17:16:36 -04:00
Sam Doran
a4c82d5842 Update EdgeOS modules to be community supported (#38112) 2018-03-29 15:59:46 -05:00
gmaes
27c47f75ad #29334 handle maven local repo (#36159) 2018-03-29 16:16:46 -04:00
Sloane Hertel
ee06f57f0d
[ec2_vpc_nacl] revert suboptions for ingress and egress module parameters (#38071) 2018-03-29 16:16:01 -04:00
Dag Wieers
800dad5bdf uri: Add redirect tests for none, safe, urllib2 and all (#37068)
This is required if we want to ensure that #36809 doesn't cause any
important behavioral changes.

This PR changes the uri module to support follow_redirects=urllib2

It also adds a better error message when the connection closes before
any data was returned.
2018-03-29 14:54:42 -04:00
Renato Orgito
fea8c84a17 Fix returned landscape value when using python3 2018-03-29 11:44:05 -07:00
Pilou
7908f78fa6 module_common: handle None value for templar (#36651)
* module_common: set required parameter templar

Fix the following error (related to b455901):

  $ ./hacking/test-module -m ./lib/ansible/modules/system/ping.py -I ansible_python_interpreter=/usr/bin/python
  Traceback (most recent call last):
    File "./hacking/test-module", line 268, in <module>
      main()
    File "./hacking/test-module", line 249, in main
      (modfile, modname, module_style) = boilerplate_module(options.module_path, options.module_args, interpreters, options.check, options.filename)
    File "./hacking/test-module", line 152, in boilerplate_module
      task_vars=task_vars
    File "ansible/lib/ansible/executor/module_common.py", line 910, in modify_module
      environment=environment)
    File "ansible/lib/ansible/executor/module_common.py", line 736, in _find_module_utils
      shebang, interpreter = _get_shebang(u'/usr/bin/python', task_vars, templar)
    File "ansible/lib/ansible/executor/module_common.py", line 452, in _get_shebang
      interpreter = templar.template(task_vars[interpreter_config].strip())
  AttributeError: 'NoneType' object has no attribute 'template'

* module_common.modify_module: templar is required
2018-03-29 13:54:48 -04:00
jctanner
e10724fadb dedupe the --rsh options in favor of user supplied (#38096) 2018-03-29 09:32:27 -05:00
saichint
6f2cb28bb9 fix nxos_vlan issues (#38008) 2018-03-29 06:26:33 -04:00
Deepak Agrawal
66b389a00d
show version brief does not work on iosxr virtual (#37609)
* show version brief does not work on iosxr virtual

* ci failures fix
2018-03-29 12:33:41 +05:30
Fabian Zimmermann
0efbb702b9 fixes bug: puppet module is no longer updating persistent external facts (#38026) 2018-03-29 14:54:44 +10:00
jctanner
7ea05a2d56 synchronize: fix the mixture of quoting and passing of lists to run_command (#38020)
* switch to six.moves.shlex_quote

* remove the unncessary quotes on rsh
2018-03-28 18:45:49 -07:00
Milan Ilic
0128022654 Add OpenNebula one_vm module (#37825)
* Add OpenNebula one_vm module

* `one_vm` - module for managing VM instances instances on OpenNebula

* Add integration tests
2018-03-28 23:32:03 +02:00
Blair Rampling
e5d44934e7 changes default WAPI version to 2.1 (#37578) 2018-03-28 18:27:17 +01:00
Will Thames
98b29f8ad6 [cloud]Ensure SGs in default VPCs get default egress rule (#38018)
SGs created when a VPC ID was not specified would not necessarily
get the default egress rule, even when no explicit egress rules
were set.

Add some checks for egress rules in results from existing tests
2018-03-28 12:53:35 -04:00
Samer Deeb
9dfb665e43 issue:37307 Add support for changes in pfc output in onyx 3.6.6000 (#37651)
* issue:37307 Add support for changes in pfc output in onyx 3.6.6000

Signed-off-by: Samer Deeb <samerd@mellanox.com>
2018-03-28 17:13:54 +01:00
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