Commit Graph

22516 Commits (501503f4cb424d01c030e14cb5e5f8445fcdada3)

Author SHA1 Message Date
Zim Kalinowski e43d4ac512 fixing mysql server sample (#43300) 6 years ago
Zim Kalinowski 3f9cacf777 fixed postgresql server sample (#43299) 6 years ago
Nilashish Chakraborty 18235af363
Fix baud rate and nxos_logging default case idempotency bug (#43295)
* Fix baud rate and idempotency bug

* Fix Shippable errors

* Combine commands calls

* Fix Shippable errors II
6 years ago
Nathan Hyde d3230b9172 Correct link to Getting Started with Docker Guide (#42709)
Update link to the docker getting started guide.

+label: docsite_pr
6 years ago
Nathaniel Case ab40c72a3c
httpapi: Split off and save response text contents (#43305)
* Split off and save response text contents

* login might depend on httpapi
6 years ago
Abhijeet Kasurde 13dd1acbec Fix typo in ignore_unknown_extensions doc
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Blair Rampling 7a35e2f8c1 adds naptr record module (#39383)
* adds naptr record module

* fixes pep8

* fixes doc errors
6 years ago
Ganesh Nalawade 5e44189a36
Update junos_netconf module documentation (#43291)
Fixes #42719

* Add module documentation to reflect that when netconf
  port is not mentioned the module by default enables
  netconf on port 830 only.
6 years ago
Dag Wieers 32b5992578 uri: Avoid false traceback in common scenarios (#39526)
* uri: Avoid exception in common scenario

So I was confused by the fact that the **uri** module, when not
returning an acceptable HTTP status code, returns:

    The full traceback is:
      File "/tmp/ansible_UQwiI4/ansible_module_uri.py", line 471, in main
        uresp['location'] = absolute_location(url, uresp['location'])

While the actual error was:

    Status code was 400 and not [201]: HTTP Error 400:

I also wonder why that message ends abruptly. I would have expected
`HTTP Error 400: Bad Request` which would be more useful.

* uri: Avoid false positive tracebacks in fail_json() on PY2
6 years ago
Toshio Kuratomi 6eacfecb73 ANSIBLE_REMOTE_TMP was an implementation of unified temp that was later changed
One of the earlier implementation of unified temp for 2.4 passed the
temp diretory to the remote side using this environment variable.  We
later changed it to be passed via a module parameter but forgot to
remove the environment variable.
6 years ago
Adam Miller 66b1adfc83 fix fedora version dnf fact, default pkg_mgr detection per distro family (#43261)
* fix fedora version dnf fact, default pkg_mgr detection per distro family
* loop over possible dnf/yum paths in case there are multiple canonical sources later in life

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
John Jensen 7ba0d8f60e fix regex parse for total memory in slxos_facts.py (#43258)
* fix regex parse for total memory in slxos_facts.py

* account for one or no spaces per LindsayHill's suggestion
6 years ago
Fabian von Feilitzsch d27de6acd9 Add from_yaml_all to support multi document yaml strings (#43037)
* Support multi-doc yaml in the from_yaml filter

* Most automatic method of handling multidoc

* Only use safe_load_all

* Implement separate filter

* Update plugin docs and changelog
6 years ago
Julien Champseix 19dc267e4c Allow specifying the output encoding in the template module (#42171)
Allow specifying the source and destination files' encodings in the template module

* Added output_encoding to the template module, default to utf-8
* Added documentation for the new variables
* Leveraged the encoding argument on to_text() and to_bytes() to keep the implementation as simple as possible
* Added integration tests with files in utf-8 and windows-1252 encodings, testing all combinations
* fix bad smell test by excluding windows-1252 files from the utf8 checks
* fix bad smell test by excluding valid files from the smart quote test
6 years ago
Andrew Gaffney dbff49dee0
Remove dead 'vault_password' play attribute (#41847) 6 years ago
Dag Wieers 9bf22309b3 Clarify uncertain nature of tracebacks on Python 2 (#42513)
* Only add exception/traceback on Python 3

On Python 2 the traceback could be any exception from the stack frame
and likely unrelated to the fail_json call.

On Python 3 the traceback is cleared outside any exception frame, so the
call always returns the most inner traceback (if any), and therefor is
most likely related to the fail_json call.

* Add uncertainty to traceback on Python 2

On Python 2 the last exception in the stack frame is being returned,
this could be unrelated to the actual error, especially if fail_json()
is called outside an except: block.
6 years ago
curry9999 1305fca414 change version_added cobbler_sync (#43248) 6 years ago
saichint fa5f396a4b nxos_file_copy enhancement (#42424)
* add file_pull option

* typo correction

* fix shippable error

* review comments

* fix for review comments by mwiebe

* possible shippable fix

* remove file_copy from ignore

* more review comments addressed

* review comments

* add localhost for remote scp server in tests

* timeout fix
6 years ago
mjmayer a488b3a8ed elb_application_lb purge rules option (#43113)
* Add parameter to keep elb rules

Does not purge elb rules. This is usefull if running the elb_application_lb
 role and there is the desire to keep existing rules.

* Change variable name keep_rules to purge_rules

The descriptor purge has been used in the past.

* Changed default for purge_rules

Default is purge_rules. This is how the module has functioned previously. This change maintains
 the previous behavior.

* Add integration test for purge_rules flag

* Change wording of test task

* Fix merge conflcit

* Changed default for purge_rules

Default is purge_rules. This is how the module has functioned previously. This change maintains
 the previous behavior.

* merge conflcit

* Change wording of test task

* Add purge_rules option to test

* Change test description wording

* Expand purge_rules documentation

* Clarifies documentation for purge_rules option
6 years ago
Fran Garcia 577306e74b Fix #42000 : ovirt_host_pm documentation for slot parameter (#42196)
* Fix for #42000: ovirt_host_pm ignores slot parameter

* Fix for #42000: ovirt_host_pm ignores slot parameter

* Remove non-required slot parameter
6 years ago
Jordan Borean 2c9cbae3f9
Removed deprecated Windows items slated for removed in 2.7 (#43231) 6 years ago
tomelrod 5eb47066e3 Documentation change for resizefs (#43224)
* Documentation change for resizefs

Changed documentation to match the default value of resizefs set in the code.
Added a note on the resizefs use on the example utilizing it.

* Remove test now it validates fine
6 years ago
Dag Wieers 939de473c6
Add a 'finished' test for async jobs (#38325)
This provides a more convenient way for testing (async) jobs.

When used with a non-async job it will report a warning so the user is
aware that he may be doing something incorrect.

Since the 'finished' result value is an integer (!), the test is turning
this in a proper boolean.
6 years ago
Dag Wieers 5ecfb0b793 cobbler_system: New module to manage Cobbler systems (#39913)
* cobbler_system: New module to manage Cobbler systems

This module is useful to provision new systems using Cobbler and Ansible.

* cobbler_system: warn on invalid properties
6 years ago
Andrew Gaffney 42346937b1
Display task banner before item status (#42892)
This is a follow-up to #41058
6 years ago
Brian Coca 917b6b0d09 import_playbook is not usable from inside a play
(cherry picked from commit 55dddf530ad094810929823f80c4546e97a69ac7)
6 years ago
Nathaniel Case a7097f6735
Try to enable more exotic auth methods in httpapi (#43212)
* Try to enable more exotic auth methods in httpapi

* Auth tokens won't always come back.

* Reconcile #43147 with this PR
6 years ago
Brian Coca ac1f05478e Allow to specifically customize console's color 6 years ago
Xyon 3bb9f689e9 Fix spelling; summery -> summary (#43213)
Fix the incorrect spelling of "summary".
6 years ago
Rémy Léone 3113c68053 Fix author name in the documentation 6 years ago
Gregory Hellings 6f007c35c1 Improved the documentation of known_hosts
The documentation for the key parameter was lacking in specificity and
also lacking in testing. These parts are both remedied herein.

Fixes #43157
6 years ago
Brian Coca 0718a53b07 also get checksum on 'any' if it is a file
fixes #42785
6 years ago
Brian Coca cdc762dd9e
don't assume all delegation subkeys exist (#43032)
* don't assume all delegation subkeys exist

fixes #43026

* add tests
6 years ago
Deepak Agrawal bf544c2200
Add support for commit label in iosxr_config (#42931)
* Add support for commit label in iosxr_config

* sanity pep8 etc fixes
6 years ago
Abhijeet Kasurde 4f1746ee1d
vault: check dir value before passing (#43184)
This fix checks if dirname is not equal to '' before proceeding
to create actual directory with name.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Trishna Guha dd6ef3355f
get_device_info nxos zero or more whitespace regex (#43178)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Andreas Olsson c6854fde29 Fix cloudflare_dns JSON response error handling (#42894)
* The JSONDecodeError exception only exists in Python 3.

* Without a properly parsed JSON response there is no more error
  processing to be done, no matter the http response code.

Relates to #38178
6 years ago
Lindsay Hill 42a9fb1337 Fix broken IPv6 regex (#43175) 6 years ago
uwila c0048007a9 Detect failed sysvinit module (#43127)
* Detect failed sysvinit module

- This checks the stderr instead of the rc to detect whether the
  sysvinit module was successful or not, as even when failing, the
  rc would be 0.
- It immediatly became obvious that the debug info when failing
  was far too little to properly debug the role. To improve this,
  I also added the rc, stderr and stdout to the debug output.

* Revert stderr check to rc check, rename out->stdout, err->stderr
6 years ago
Jordan Borean d5d29f4cfa
ssh - skip connection reset if controlpath does not exist (#43062) 6 years ago
Jordan Borean 04431216e7
win_user: use different method to validate credentials that does not rely on SMB/RPC (#43059)
* win_user: use different method to validate credentials that does not rely on SMB/RPC

* Use Add-Type as SetLastError on .net reflection not working on 2012 R2
6 years ago
Jordan Borean 48ad90ac8e
powershell: support recursive requires statements (#43143) 6 years ago
Jordan Borean 93c05074ee
win_chocolatey: refactor module to fix bugs and add new features (#43013)
* win_chocolatey: refactor module to fix bugs and add new features

* Fix some typos and only emit install warning not in check mode

* Fixes when testing out installing chocolatey from a server

* Added changelog fragment
6 years ago
Jarryd Tilbrook 460f858640 Enable check_mode in command module (#40428)
* Enable check_mode in command module

This only works if supplying creates or removes since it needs
something to base the heuristic off. If none are supplied it will just
skip as usual.
Fixes #15828

* Add documentation for new check_mode behavior
6 years ago
Charles 7fedda4c1d move the TLS detection block of win_uri before creating WebRequest (#43168)
* move the TLS detection block of win_url before creating WebRequest

* fix typo security_protocols
6 years ago
Nathaniel Case 8a0967554f
Actually fix eos_facts feature detection (#43155) 6 years ago
Trishna Guha 1d5f881f5c
Add text output along with structured output in nxos_facts (#42886)
* nxos_facts to use default output instead of structured output

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix shippable error

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* nxos_facts refactor

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* Add structured output back

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Mo Balaa 3c0a3a1de1 Add debug messasge to aws_ec2 inventory plugin (#43112) 6 years ago
Jonathan Lozada D d48415ed57 Fixed typo in gitlab_group (#41349)
Changed 'requried' to 'required'
6 years ago
Deric Crago 5522e9e934 VMware: fixed network['vlan'] str / int mismatch (#42984)
Typecast network vlan into string.
6 years ago
Matt Martz 35b4b1923d Allow adhoc to execute includes and imports 6 years ago
Julien PRIGENT 151419b87a ec2.py: Set source_dest_check default value to None (#42863)
* ec2.py:
  * source_dest_check default value is now None, updated docs
  * Refactor restart_instances and startstop_instances -> Two new functions to prevent repetition: check_source_dest_attr and check_termination_protection
6 years ago
Seuf 9faadce0b2 Add new grafana dashboard lookup plugin (#41319) 6 years ago
Adam Miller 562ff66a98 Fix pkg_mgr_name fact finding for Fedora (#40922)
* Properly handle default package manager vs apt

For distros where apt might be installed but is not the default
package manager for the distro, properly identify the default distro
package manager during fact finding and re-use fact finding from
DistributionFactCollector and instead of reimplementing small
portions of it in PkgMgrFactCollector

Add unit test to always check the apt + Fedora combination to test
the new code.

Fixes #34014

Signed-off-by: Adam Miller <admiller@redhat.com>

* remove q debugging output I accidentally left behind

Signed-off-by: Adam Miller <admiller@redhat.com>

* add os_family to the conditional so we're only hitting that code path when needed

Signed-off-by: Adam Miller <admiller@redhat.com>

* setup for a _check* pattern for general os_family group pkg_mgr checking

Signed-off-by: Adam Miller <admiller@redhat.com>

* use Mock.patch decorator for os.path.exists in TestPkgMgrFactsAptFedora

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Eric Coutu ab3475e3f9 Explicitly pass HTTP method to fetch_url 6 years ago
Matt Martz 8d933928d2 Only assume GET if no data, otherwise POST (#43133)
* Only assume GET if no data, otherwise POST. Fixes #42876 #43091 #42750
6 years ago
Will Thames 0b77262288 Add merge_type parameter to k8s module (#42219)
Allows patching of custom Kubernetes resources that
don't support strategic merge patching

Check that openshift module supports content_type param
(requires version newer than 0.6.0)
6 years ago
Yunge Zhu 40fbee6369 Fix azure_rm_keyvaultkey/azure_rm_keyvaultsecret bugs (#41683)
* fix keyvault tests

* missing keyvault requirement

* fix keyvault auth bug

* apply fix in secret

* fix lint

* enable keyvault key and secret tests

* add azure service principal object_id lookup plugin

* fix lint

* add dependency in integration test

* fix bug

* put azure sp lookup plugin into test

* fix lint

* move lookup plugin

* repath lookup plugin

* repath lookup plugin

* repath files

* put az sp lookup plugin to lookup_plugins folder
6 years ago
Deepak Agrawal 20769de560
Don't close persistent connection socket on command timeout (#43071)
* Don't close persistent connection socket on command timeout

* handle exception in client of ansible-connection instead removing socket removal
6 years ago
Nathaniel Case 8c620a17d4
Let called functions use `method` keyword (#43086)
Hopefully we can live without `method_` instead
6 years ago
Jordan Borean 64f5f9c2f9
win_acl: fix recent bug and add basic tests (#43054) 6 years ago
Dusan Matejka d43b2b54d5 Fixed incompatible unicode and int comparison in zabbix_host module when using proxy option (#43097) 6 years ago
Joe Abbey a9b077f763 Stop throwing TypeErrors (#43036) 6 years ago
Abhijeet Kasurde b02e0c07d8
dnsimple: refactor dnsimple module (#42548)
* Update dnsimple-python minimum version to 1.0.0 as it supports API v2 and API v1 is deprecated.
* Update examples.
* Update documentation.

Fixes: #42495

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Chris Smolen bb35973e37 nxos_logging: add example using aggregate (#41052)
* add example using aggregate
+label: docsite_pr
+label: issue ansible/community#311
* Update nxos_logging.py
6 years ago
Yanis Guenane b1c60eaa83 Vultr: Introducing vr_startup_script_facts module (#43004)
This commit introduces a new module called vr_startup_script_facts.

This module aims to return the list of startup scripts avaiable
avaiable in Vultr.

Sample available here:

```
"vultr_startup_script_facts": [
  {
    "date_created": "2018-07-19 08:52:55",
    "date_modified": "2018-07-19 08:52:55",
    "id": 327140,
    "name": "myteststartupscript",
    "script": "#!/bin/bash\necho Hello World > /root/hello",
    "type": "boot"
  }
]
```
6 years ago
abirami-n 1152f86ba1 Fixes #41549 (#41551)
* Fix_module_correction
6 years ago
Sandra McCann 87f004c503 Merge branch 'devel' of github.com:ansible/ansible into devel 6 years ago
Daniel Schneller 40b1ecf38a Add src parameter to elasticsearch_plugin (#39915)
* Add src parameter to elasticsearch_plugin

Previously specifying a URL or a file name (which is supported by the
Elasticsearch plugin tooling) would not work correctly with Ansible, because the
detection of the current installation state did not handle this well.

This commit adds a new "src" parameter for the module, which can be specified in
addition to the plugin name. It will be used to retrieve the plugin from
a custom location while keeping the final plugin name available to determine if
it is already present or not.

The url parameter remains for ES 1.x compatiblity.

* Fix sanity test errors

* Add version_added for src option

* Increase first added version to 2.7
6 years ago
Barry Peddycord III dc42b43cd1 NCLU Module: Improve performance by not operating on empty lines (#43024)
* Update nclu.py

Stop module from running `net` on empty commands.

* Update nclu.py

Updated the copyright date

* Update nclu.py

Returned metadata version to 1.1

* Update nclu.py

Fix indentation to be a multiple of 4.

* Create changelog fragment
6 years ago
Thierry Bouvet 5d23406926 Fix ssl_version default value. (#42955)
* Fix ssl_version default value.

* Add changelog
6 years ago
Sandra McCann 2e93eab920 pr 42271 - fixed merge conflicts 6 years ago
Nathaniel Case dba975470d
Eos subnet overlap fix (#43023)
* Detect overlapping subnet & provide better errors
6 years ago
Alexander Gubin e129616ba6 sysvinit: Fix for false changed messages (#42956) 6 years ago
Ryan Brown b6f8de9204 [aws] Enable SQS events for `lambda_event` module (#43019)
* Enable SQS events for `lambda_event` module

* Handle SQS event type properly

* PEP8
6 years ago
Julien PRIGENT 3272188170 elasticache_parameter_group.py: add parameter group compatibility with redis4.0 (#43041) 6 years ago
Ryan Brown 07927edfac
[AWS] Fix SSM Parameter Store module when description is missing (#43020) 6 years ago
Andrey Laguta 2e62e36590 Fix multiple var files combining (followup to #36357) 6 years ago
Abhijeet Kasurde cadbd6ea9c
VMWare: update documentation for linked_clone (#42881)
linked_clone requires snapshot_src parameter. This fix makes them required_together
and update documentation. Also, testcase is added.

Fixes: #42349

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Ganesh Nalawade 97d4e53131
Support setting persistent command timeout per task basis (#42847)
* Support setting persistent command timeout per task basis

Fixes #42200

*  Add variable `ansible_command_timeout` to `persistent_command_timeout`
   option for `network_cli` and `netconf` connection plugin so that the
   command_timeout can be set per task basis while using `connection=network_cli`
   or `connection=netconf`
   eg:
   ```
   - name: run copy command
     ios_command:
       commands:
       - show version
     vars:
      ansible_command_timeout: 40
   ```

* Modify `ansible-connection` to read command_timeout value from
  connection plugin options.

* Add `ansible_command_timeout` to `persistent_command_timeout`
  option in `persistent` to support `connection=local` so that
  it is backward compatibilty

* To support `connection=local` pass the timeout value as variables
  from persistent connection to `ansible-connection` instead of sending
  it in playcontext

* Fix CI failure

* Fix review comment
6 years ago
Tim Rupp 867dedc787
Updates F5 module utils (#43047)
New functions and fixes/refactorings for existing functions for
the 2.7 work
6 years ago
Rémy Léone 267c7667f6 Fix archived machine bu (#43017) 6 years ago
Pilou 06f5e49dfb inventory plugins: add test about config API usage (#41888)
* Check get_option method works with inventory plugins

This use case is already tested by some cloud inventoty plugin but
these tests are slow and aren't always executed, hence this new quick
test.

* AnsiblePlugin: Fix typo in docstring
6 years ago
Martin Szulecki 2653bd3f50 Fix docker_image archive features to work with Python 3
Without binary mode, ansible shows a "write() argument must be str,
not bytes" error when using Python 3.
6 years ago
Sumit Jaiswal 8759d97071 infoblox list requirements as infoblox_client and should be infoblox-client (#42993)
* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client

* change infoblox_client to infobblox-client
6 years ago
Brian Coca 9217fbb7dd
better error messasge (#42770)
* better error messasge
6 years ago
Matej Vadnjal 7c318d4e30 ios_user module - implement sshkey option (#38782)
* ios_user module - add sshkey support

* ios_user - Add version_added to sshkey option

* ios_user - pep8 indentation fixes in unit tests

* ios_user - use b64decode method that works on python 2 and 3
6 years ago
Sam Doran 0ca61e9d87
Only report change when home directory is different on FreeBSD (#42865)
* Only report change when home directory is different

Add tests with home: parameter

Have to skip macOS for now since there is a bug when specifying the home directory path for an existing user that results in a module failure. That needs to be fixed in a separate PR.
6 years ago
Will Thames 786613f426 Handle FieldLevelEncryptionId in cloudfront_distribution (#41770)
Ensure that FieldLevelEncryptionId is properly handled - passing it if
set, and keeping it if returned by GetDistribution

Update cloudfront_distribution tests to remove references to
test_identifier so test suite actually works

Fixes #40724
6 years ago
Roberto Barreda f0f335d2bd parametrize allow_reassignment in ec2_eni (#41982)
* parametrize allow_reassignment

* fix documentation

* fix version_added
6 years ago
yaakov kuperman 61b0981341 [AWS] check mode for ec2_elb and elb_instance (#42694)
what ELBs an instance will be deregistered from prior to actually
executing
6 years ago
Andy Eff 26fd05c288 Update wait_for.py (#43002)
<!--- Your description here -->
This change is intended to help users know that a win_wait_for module exists and should be used for working on Windows hosts, as the documentation gives the impression that this module works on Windows - but if tried, it produces a large amount of stderr output.
+label: docsite_pr
6 years ago
Abhijeet Kasurde f2640d3394
VMware: handle pnic in proxyswitch (#42996)
Fixes: #42943

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Raoul Scarazzini 86387df8b3 Fix docker_container stop/start image dependency (#41678)
This commit adds a conditional inside the constructor so that if a user
didn't specified an image parameter all the code related to the image
version comparison is omitted.
This is extremely useful when a user want to just stop and start
containers using just the name, keeping everything as it is, without the
need of specifying all the image and command stuff used at creation.
Today if you don't specify the image you get an error, and this is a
confusing [1] behavior.

[1] https://github.com/ansible/ansible/issues/27960
6 years ago
Jez McKinley 0f6488bb15 JM: allow choco to install 32 bit version (#42946)
* JM: allow choco to install 32 bit version

* JM: style corrections

* Revert style changes in lists

* JM: changing from boolean to string choice

* JM: updating example
6 years ago
John McDonough f89d3721b4 UCS NTP Server module (#42375)
* UCS NTP Server module initial commit

* change name to ntp_server, keep name as alias for ntp_server
6 years ago
David Soper c527af58f1 ucs_storage_profile module and integration tests (#42205)
* ucs_storage_profile module and integration tests

* Remove space in doc link to fix docs-build issue.

* Added suboption documentation and argument spec supporting list suboptions.

* Various small edits
6 years ago
Yanis Guenane 1754f533b5 Vultr: Introducing vr_firewall_group_facts module (#42997)
This commit introduces a new module called vr_firewall_group_facts.

This module aims to return the list of firewall groups avaiable
avaiable in Vultr.

Sample available here:

```
"vultr_firewall_group_facts": [
  {
    "date_created": "2018-07-17 12:22:51",
    "date_modified": "2018-07-17 12:24:47",
    "description": "ansible-firewall-group",
    "id": "fb5a0876",
    "instance_count": 0,
    "max_rule_count": 50,
    "rule_count": 1
  }
]
```
6 years ago
Yanis Guenane f6ca231729 Vultr: Introducing vr_dns_domain_facts module (#42994)
This commit introduces a new module called vr_dns_domain_facts.

This module aims to return the list of DNS domains avaiable avaiable in
Vultr.

Sample available here:

```
"vultr_dns_domain_facts": [
  {
    "date_created": "2018-07-19 07:31:14",
    "domain": "ansibletest.com",
  }
]
```
6 years ago
hitsumabushi c43e51e39e print vyos_config diff (#42494) 6 years ago
saichint bea8e0200c warning message improved (#42969) 6 years ago
Lindsay Hill 70564ffd89 Missing close " (#42985)
Command was missing a close `"`. This was still interpreted properly by the switch, and was not breaking anything, but this is tidier.
6 years ago
FragmentedPacket d2409fb165 Add example of using loop: with when: statements (#42776) 6 years ago
Adam Harwell a9b1af8bdd Yum: Add support for --downloadonly (#41506) 6 years ago
Yanis Guenane 2c4ba7a9e9 Vultr: Introducing vr_user_facts module (#42951)
This commit introduces a new module called vr_user_facts.

This module aims to return the list of user avaiable avaiable in Vultr.

Sample available here:

```
"vultr_user_facts": [
  {
    "acls": [],
    "api_enabled": "yes",
    "email": "mytestuser@example.com",
    "id": "a235b4f45e87f",
    "name": "mytestuser"
  }
]
```
6 years ago
Bryce Verdier b16fef9aad removing duplicate operations from the use of list comprehensions. None of the logic within the code has been changed, just more refined. (#41098) 6 years ago
Frank Vissing 66adabfd42 disable_excludes (#42510)
* implementing disable_excludes

* add check for yum version

* limit choices

* add testcases for disable_exclude

* fix formating

* add documentation

* syntax fix for test case

* fix indentation

* need to ignore errors when we want to do a test that fails

* test disable_excludes with zip and not sos

* add tests for yum < 3.4 not supported

* fix formating

* centos 6.1 does not support map

* drop unsupported selectattr

* cleanup testcases

* fix test cases beloging to wrong test scenarion (propper when)

* evaluate expression

* minor test fixes

* check output of msg
6 years ago
Dag Wieers f2acc97b84 Windows: Get rid of remaining Get-Attr modules (#42921)
This is the final cleanup of modules still using the old Get-Attr
interface. Ready to deprecate this mechanism.
6 years ago
Orion Poplawski 32436ea9a5 dnf: Call dnf.Base.close() before exit to cleanup. (#41810) 6 years ago
Sloane Hertel 67cf2da2a1 Fix error when removing S3 lifecycle rules (#42762) 6 years ago
Vladimir Pavljuchenkov a7d0804279 Update cloudformation.py (#42948)
missed space

+label: docsite_pr
6 years ago
Samer Deeb 3ca4a35334 Add support for global IGMP configuration on onyx switches (#42164)
* Add support for global IGMP configuration on onyx switches

Signed-off-by: Samer Deeb <samerd@mellanox.com>

* Add support for global IGMP configuration on onyx switches

Signed-off-by: Samer Deeb <samerd@mellanox.com>
6 years ago
Anil Kumar Muraleedharan 0897e79bd1 Persistence connection for cnos_vlan (#42500)
* Changing Lenovo Inc to Lenovo and update License file to be consistent.

* Changing cnos_vlan from paramiko to persistence connection of Ansible. Also talking care of CLI changes in CNOS commands with backward compatibility.

* Fixing Validation issues

* Trailing lines removal

* Review comments of Gundalow are getting addressed. He mentioned only at one place for cnos.py. But I have covered the entire file.

* Changes to incorporate Review comments from Qalthos

* Removing configure terminal command from module code

* Aligning with change in run_cnos_commands method changes

* Editing cliconf for latest CNOS CLIs
6 years ago
Hossein Zolfi e756ef8265 Fix example of nmap plugin (#42925) 6 years ago
Yanis Guenane a826ac3ea9 vultr: Add proper extension to vr_region_facts(.py) (#42944) 6 years ago
Guy Templeton 841b063d12 Fixes #37752 Delete all versions and deletemarkers in S3_Bucket when force paramet… (#39781)
* Delete all versions and deletemarkers in S3_Bucket when force parameter is passed

* Fix PEP8 style conformance

* Clarify explanation of force parameter
6 years ago
Yanis Guenane 9a1185e57c Vultr: Introducing vr_plan_facts module (#42470)
This commit introduces a new module called vr_plan_facts.

This module aims to return the list of plan avaiable avaiable to use on
booted servers.

Sample available here:

```
"vultr_plan_facts": [
  {
    "available_locations": [
      1
    ],
    "bandwidth": 40.0,
    "bandwidth_gb": 40960,
    "disk": 110,
    "id": 118,
    "name": "32768 MB RAM,110 GB SSD,40.00 TB BW",
    "plan_type": "DEDICATED",
    "price_per_month": 240.0,
    "ram": 32768,
    "vcpu_count": 8,
    "windows": false
  }
]
```
6 years ago
Yanis Guenane aef97c5ac4 Vultr: Introducing vr_os_facts module (#42473)
This commit introduces a new module called vr_os_facts.

This module aims to return the list of OSes avaiable avaiable to use to
boot servers.

Sample available here:

```
"vultr_os_facts": [
  {
    "arch": "i386",
    "family": "ubuntu",
    "id": 216,
    "name": "Ubuntu 16.04 i386",
    "windows": false
  }
]
```
6 years ago
Yanis Guenane 11fd20b5ea Vultr: Introducing vr_region_facts module (#42471)
This commit introduces a new module called vr_region_facts.

This module aims to return the list of region avaiable avaiable to use
where boot servers.

Sample available here:

```
"vultr_region_facts": [
    {
      "block_storage": false,
      "continent": "Europe",
      "country": "FR",
      "ddos_protection": true,
      "id": 24,
      "name": "Paris",
      "regioncode": "CDG",
      "state": ""
     }
  ]
```
6 years ago
Yanis Guenane 9b898ebc20 Vultr: Introducing vr_sshkey_facts module (#42615)
This commit introduces a new module called vr_sshkey_facts.

This module aims to return the list of SSH keys avaiable in Vultr.

Sample available here:

```
"vultr_sshkey_facts": [
   {
    "date_created": "2018-07-10 14:49:13",
    "id": "5b43c760d7d84",
    "name": "me@home",
    "ssh_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+ZFQv3MyjtL1BMpSA0o0gIkzLVVC711rthT29hBNeORdNowQ7FSvVWUdAbTq00U7Xzak1ANIYLJyn+0r7olsdG4XEiUR0dqgC99kbT/QhY5mLe5lpl7JUjW9ctn00hNmt+TswpatCKWPNwdeAJT2ERynZaqPobENgewrwerqewqIVew7qFeZygxsPVn36EUr2Cdq7Nb7U0XFXh3x1p0v0+MbL4tiJwPlMAGvFTKIMt+EaA+AsRIxiOo9CMk5ZuOl9pT8h5vNuEOcvS0qx4v44EAD2VOsCVCcrPNMcpuSzZP8dRTGU9wRREAWXngD0Zq9YJMH38VTxHiskoBw1NnPz me@home"
  }
]
```
6 years ago
sevs44936 7dbdc8a92e Fix for cloudflare_dns SRV record and Python3 (#42914)
This fix adds correct way of comparing dict with dict while managing cloudflare_dns SRV record.

Fixes: #40445
6 years ago
Jordan Borean 8447f25e10
win_chocolatey_config: added module to manage Chocolatey config (#42915) 6 years ago
Jordan Borean 7ae5912d91
win_chocolatey_feature: new module (#42848)
* win_chocolatey_feature: new module

* Fixed up copyright header in PowerShell file
6 years ago
Jordan Borean 933d36b25f
win_chocolatey_source: add new module to manage Chocolatey sources (#42790)
* win_chocolatey_source: add new module to manage Chocolatey sources

* Added examples and fix diff run

* Minor fixes from review

* When editing a source, recreate with the explicit options instead of using the existing source

* Fixed up copyright header in PowerShell file
6 years ago
Abhijeet Kasurde db9c9e7fc5 VMware: dns_suffix as a list of domain suffixes (#42678)
This fix adds dns_suffix as a list of domain suffixes and
also updates documentation and example.

Fixes: #42229

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Michael Steffens 4af16d0c76 Python3: compare bytes with bytes and strings with strings. (Fixes #42677) (#42878) 6 years ago
Dag Wieers 95a1170908 Windows: Add "special" parameter types to docs (#42853)
* Windows: Add special parameter types

Adding explicit parameter types now exposes this information in the
module documentation, and proves really helpful.

We only do this for non-string types as strings, mostly because strings
are implicit.

PS We also make copyright statements consistent and use #Requires for
explicit library imports

* Type "string" must be type "str"

* A few more Copyright corrections

* More fixes

* Don't add file encoding to Powershell files

* Don't add missing interfacetypes parameter

Otherwise CI demands an incorrect version_added

* Small fix
6 years ago
Tim Rupp 290df027e3
Adds the ipaddress compat library backport from Python 3.x (#42265)
This library is a backport (to 2.x versions of Python) of the code
that is found in the mainline versions of Python 3.x. It is being
included so that networking vendors, and others, can make use of it
without needing to add a python module dependency to their own modules.

A separate dependency would add to user burden of satisfying those
dependencies before using some Ansible modules.

In a previous core meeting, this was approved. Naming of the directory
it is found in was up for debate, but "compat" was the first directory
to have some sort of concensus.
6 years ago
Fabian von Feilitzsch 9eccc96586 Special case project creation so that it is possible (#42132) 6 years ago
Dag Wieers e899824c49
ACI: Add parameter types to module docs (#42893)
* ACI: Add parameter types to module docs

* Update validate-modules ignore list
6 years ago
Gregory DEPUILLE 0d1c06814f vmware_vmotion: added storage vmotion capabilities. (#21421)
This fix adds vmotion capabilities to vmware_vmotion across different datastores and different hostsystem.
6 years ago
Yanis Guenane 577427b1c2 vultr: Make get_result handle list (#42890)
Currently get_result() can only handle a dict. When requiring facts, and
when there is more than one fact, get_result() should be able to handle
a list of dicts, so the normalization process happens to all the items.
6 years ago
Adam Conway b6e9df2065 Update yum_repository.py (#42859)
* Update yum_repository.py

Having spent some time trying and googling how to enable an installed repo with this, I discovered that the thread at https://github.com/ansible/ansible-modules-extras/issues/2384 had decided that this would not be supported and recommended use of ini_file instead.  Since I am sure I'm not alone in expecting yum-repository to support enabling/disabling a configured repo, I suggest adding a note so people find this easier.
6 years ago
Fran Fitzpatrick 27a3a90fc8 FreeIPA: new module ipa_config (#42279)
* Adds new ipa_config module

* Modify _post_json to handle config_show/config_mod

* Doc: Add periods

* More documentation

* Added aliases
6 years ago
Rémy Léone 2177d37d5a Use IP address instead of server id to index servers (#41658) 6 years ago
Abhijeet Kasurde cb1396b5be VMware: vmware_vm_facts check for template config (#42354)
This fix adds additional check for getting template from
virtual machine before using it.

Fixes: #42011

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Derek Whatley 24a3669662 Fix invalid Dockerfile created by "galaxy init --type apb" (#42017) 6 years ago
Abhijeet Kasurde e8c90b47eb
VMware: support for 2.6 and sslContext (#42237)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
uwila f26272a492 Fix 2 issues in sysvinit module (#42786)
* Do not compare result to unset parameter in sysvinit module

* Fix misformed command in sysvinit module

* Small None-comparison style fix in sysvinit module
6 years ago
dgeo ae96ba0d4f fix a (forgotten?) change in moving createhome -> create_home (#42711)
* fix a (forgotten?) change in moving createhome -> create_home

Fix for following bug on FreeBSD host whith user module:
```
fatal: [webssp]: FAILED! => {"changed": false, "module_stderr": "X11 forwarding request failed
Traceback (most recent call last):
  File \"/tmp/ansible_2rmlBl/ansible_module_user.py\", line 2487, in <module>
    main()\n  File \"/tmp/ansible_2rmlBl/ansible_module_user.py\", line 2426, in main
    (rc, out, err) = user.modify_user()
  File \"/tmp/ansible_2rmlBl/ansible_module_user.py\", line 1011, in modify_user
    if (info[5] != self.home and self.move_home) or (not os.path.exists(self.home) and self.createhome):
AttributeError: 'FreeBsdUser' object has no attribute 'createhome'
", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
```
It happenned with 'createhome' AND with 'create_home' form, with python 2.7 AND python 3.6

* Add changelog


Co-authored-by: dgeo <dgeo@users.noreply.github.com>
6 years ago
Jiri Tyr 92c58e9a66 Adding namespace option into the xattr module (#42755)
* Adding namespace option into the xattr module

* Include namespace into the tests

* Make it backward compatible, remove re and operator module
6 years ago
Abhijeet Kasurde 7f0fe1898e urls: handle incorrect parsing of https_proxy env (#41472)
If user exports https_proxy without scheme, then generic_urlparse
fails to parse SCHEME and HOSTNAME from https_proxy variable.
This fix raises ProxyError is generic_urlparse API fails to parse
either of them.

Fixes: #25421

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Yanis Guenane 08acc74056 vultr.py: fix env var handling (#42659) 6 years ago
Wojciech Sciesinski cf4e7fd70a Make the code more PowerShell compliant (#39464)
* Make the code more PowerShell compliant

* Correction of the mistaken comment

* Revert style changes to If/Else/Elseif

* Remove an ignored PSScriptAnalyzer rule due to the code correction

* Decreasing of an entropy ;-) and replacing the next to aliases

* minor whitespace changes
6 years ago
Matt Martz 27b4d7ed31
Add feature to expose vars/defaults with include/import_role (#41330)
* First pass at making 'private' work on include_role, imports are always public

* Prevent dupe task execution and overwriting handlers

* New functionality will use public instead of deprecated private

* Add tests for public exposure

* Validate vars before import/include to ensure they don't expose too early

* Add porting guide docs about public argument and change to import_role

* Add additional docs about public and vars exposure to module docs

* Insert role handlers at parse time, exposing them globally
6 years ago
Kevin Breit 106e4b374a Meraki utility - construct_path() now supports custom keys (#42286)
* construct_path() now supports custom keys

- Allows for much more flexible test substitution
- Implemented functionality in meraki_vlan for test case

* Fix comments for PEP8
6 years ago
Matt Davis 5d76b627ef
fix py3 string error in ssh failure handling (#42655) 6 years ago
Fabian von Feilitzsch 0421305254 Properly format API key when set in an enviroment variable (#42202) 6 years ago
Fabian von Feilitzsch 4f63134d78 Use top level values as defaults if metadata is not provided (#42277) 6 years ago
Brian Coca f1dcfe4f4c
use get_option instead of directly internal dict (#42199)
* use get_option instead of directly internal dict

as get_option can populate it, while direct access cannot
also setup fallback values for derived plugins not using config system correctly
6 years ago
MedicMomcilo a97618b486 Add option to control CDATA tags stripping (#42689)
* Add option to control CDATA tags stripping

* Fix remaining issues before merging.

* Add missing trailing dot.
6 years ago
Fabian von Feilitzsch fa8de0c384 [k8s] Fix typo that breaks check mode when a resource is created (#42763) 6 years ago
Sloane Hertel 2c3e6f8bd3 [elb_target_group] fix docs and add default for wait_timeout - fixes #42324 (#42477)
Add default for wait_timeout and version_added flag
6 years ago
Toshio Kuratomi a0748c0837 Don't use deepcopy when creating attributes unless really needed 6 years ago
Andrew Gaffney e4af3a8957
Mark vars from facts cache as unsafe (fixes #42656) (#42682)
Facts are marked as unsafe when originally gathered, but they lose that
marking when they are serialized to JSON and parsed back out.
6 years ago
Brian Coca 44d4327bc7 moved to use 'get_option'
also fixed bad str() usage
6 years ago
Dennis Conrad f0463befc7 Fixes #42734 - typo in update-rc.d detection 6 years ago
Kevin Mooney 7a0c28cc37 Put umask value in quotation marks (#41409)
The given example causes the pip module to fail. If the umask is given as an octal string without quotation marks, the pip module converts it into an integer (i.e., an invalid umask). 

+label: docsite_pr
6 years ago
Jared Hocutt 7e97380664 Fix docs for the volume parameter in the ec2_instance module (#42710)
The existing docs specified valid keys of ebs.device_type and ebs.device_size
but they should instead be ebs.volume_type and ebs.volume_size.
6 years ago
Trishna Guha d5e9653c96
Add get_capabilities in nxapi module_utils (#42688)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
jamessemai dc32842573 win_security_policy: Allow setting a value to empty (#42051)
* win_security_policy: allow removing values (resolves #40869)

* Removing warning

* Adding test for remove policy setting

* Fixing string comparison

* Make idempotent

* Adding idempotency and diff test

* added changelog fragment
6 years ago
Avi Shefi b2527c55c3 fix win_unzip and win_share Powershell cmdlets output invalid JSONs (#42713) 6 years ago
Jordan Borean e3521776f5
win_chocolatey: add TLSv1.2 support for install phase (#41992) 6 years ago
Brian Coca 006f08da99
Fix fact cleaning (#42595)
* fix fact cleanup

fixes #41684
6 years ago
Chris Brown a4a37e8dfb Fixed a typo in documentation (#42702)
"Therefor" to "Therefore"

+label: docsite_pr
6 years ago
Gennady Aleksandrov 12057de1c6 Fix #38038 cloudfront_facts module returns only first page of response (#38045) 6 years ago
Clement Trebuchet 7c97bb5077 Devel ios vrf submode (#41659)
* add submode features ipv4/ipv6

* add tests for submode

* the parameters both_ * were not idempotent, in what is read in the configuration we have a list with 2 entries (import, export) while the input parameter has only one parameter which will be applied twice

* add docstring to the ios_vrf module + provide a fix for: https://github.com/ansible/ansible/issues/41581

* complete tests

* add missing description

* fix KeyError for address-family ipv*

* fix both_* tests

* fix E231, W292, W293

* fix W293

* remove set has it doesn't preserve order of routes

* fix E106

* remove ImportError: cannot import name OrderedDict

* We should be able to mix the parameters for the routes targets , while remaining imdepotent. During the first implementation we did not take this into account, which did not correspond to the reality of the needs in production (to be able to use each parameter indifemently together)

* remove epdb reference

* FIX E111, E106

* FIX E302

* using loop produce a result who  was not imdepotent

* FIX E241

* fix: used pass intead of list
6 years ago
Kevin Breit 2038ff5569 meraki_mx_l3_firewall - Fix idempotency for default rule logging (#42649)
* Fix idempotency and default syslog bugs

* Fix idempotency check for syslog_default_rule

* Syntax errors
6 years ago
Kevin Breit 9105149595 Cange URL for organization device lookup (#42648) 6 years ago
Peter Sprygada d086d57d11 adds a new feature to the telnet action plugin
This change adds a new argument to the telnet action plugin that will
cause the module to send a newline character before trying to login.
This is convienent when using telnet over a console connection that
needs an initial newline character to start the login process.

This change also will cause the sent command and command response to be
displayed on stdout when running in verbose mode (5 v's).
6 years ago
Brian Coca 12a8363fae
Error on empty group/host name (#42584)
* error on false host/group name
6 years ago
Martin Krizek 00c88f6497 [aws] Add missing methods to AnsibleAWSModule (#42679) 6 years ago
Henryk Konsek ebeb46aa61 Added Scaleway volume module (#41667)
* Added Scaleway volume module.

* Fixed imports order.

* Fixed version added.

* Improved sanity checks.

* Fixing style formatting.

* Added new line at the end of file. Fixed typo in comment.
6 years ago
Dag Wieers 5465dca7ec
aci_bd_subnet: Support parameter scope not set (#42675)
If parameter scope is not set (is None) the usual handling of lists does
not apply, and should be avoided or we get an exception.

This needs to be backported to earlier versions of Ansible.
6 years ago
Calvin Wu 7e42e88cc1 ecs_taskdefinition can absent without containers argument (#41398)
* ecs_taskdefinition can absent without containers argument

* add regression test for absent with arn

* Add PassRole privilege for ecs_cluster to pass
6 years ago
Ryan Brown e4c28571d0 Update to AnsibleAWSModule and remove now-duplicate fail_json_aws function (#42629) 6 years ago
Nathaniel Case 6b162142a7 ios_file: Don't leave leftover files behind (#42622)
* Don't leave leftover files behind

* Fix writing files in python3

* Replace nonascii.bin with one that will not pass for unicode
6 years ago
Ganesh Nalawade 6a94090e7f
Fix junos facts integration test failures (#42623)
*  Make fetching old style facts optional
   and try to fetch the old style facts only when
   `ofacts` value is present in `gather_facts`
* Fix in junos_facts integration test
6 years ago
Jordan Borean d723b8541d changed winrm _reset to reset and make ssh reset show warning (#42651)
* changed winrm _reset to reset and make ssh reset show warning

* minor changelog update
6 years ago
Matt Davis a5fc9a17f0
return wu result from inner job (#42647)
fixes #42423
6 years ago
Brian Coca e115e6496f
preserve delegation info on no_log (#42577)
* preserve delegation info on no_log

fixes #42344
6 years ago
Pavel Eremeev 2a90bea311 Several kubectl fixes (#40882)
* Fixed typo

* Fixed namespace parameter and tmp dir
6 years ago
Felix Fontein 765a5130d5 Docker modules: improve documentation on docker vs. docker-py Python package requirements (#42457)
* Make sure all docker-py/docker requirements are listed, and clarify about docker vs. docker-py.

* Adjusting changes made in #40839.
6 years ago
Dag Wieers 27f540ac5c
Add parameter types to documentation (#42572)
Few documentation fixes
6 years ago
rhorer 28820d3de0 Very slightly clean up the inline documentation 6 years ago
Samir Musali 985768b2af LogDNA Callback Plugin (#40296)
* LogDNA Callback Plugin...
6 years ago
Clement Trebuchet c7981c4cc8 Add the NIOS RECORD PTR Module (#41900)
* Add the NIOS RECORD PTR Module

* FIX E241,E231, E105

* FIX module should not be executable

* FIX module RWX

* Remove change in nios_srv_record

* Remove change in nios_srv_record

* FIX test_nios_ptr_record_update_comment

* ADD: Integration and target tests for the NIOS PTR RECORD module.

* FIX module name in integrations tests

* Update integration

* Refactor nios_ptr_record module

* Refactor the nios_ptr_record_idempotence

* FIX name

* Smoketests for the NIOS modules does not take care of the PTR:RECORD object

* REM the default for view

* Add finals test, after adding the PR (https://github.com/ansible/nios-test-container/pull/1) in order to handle PTR:RECORD

* add the define nios specific constant for PTR:RECORD

* fix: documentation style

* add create an ipv6 ptr record

* rename class name, add ipv6 unittest
6 years ago
Fran Fitzpatrick 5928ec04ca Adds an ipmath filter (#41985) 6 years ago
Sloane Hertel 7086863c52 [s3_bucket] import urlparse (#42474) 6 years ago
Toshio Kuratomi ccbac66128 Revert "Make ansible doesn't parse template-like password in user's input (#42275)"
This reverts commit de40ac02a5.

Passwords from the cli need to remain bytes on input otherwise we have
encoding problems when users input non-utf8
6 years ago
Jerry Chong 42f44b24c6 Fix NameError in pause module (#42038)
* Fix NameError in pause module

* Add comment and changelog

Co-authored-by: Jerry Chong <jchong@netbase.com>
6 years ago
Grzegorz Śliwiński d6f20952fe Fix ec2_asg metric* option's version introduction - refs #25168 (#42626)
Introduced in 404f9260d9 during 2.6, so version_added: 2.5 was incorrect.
6 years ago
Nilashish Chakraborty fa624eba29 Fixed regex to pick correct items (#42557) 6 years ago
Will Thames 42eaa00371 Provide kubernetes definition diffs in check_mode (#41471)
Move dict_merge from azure_rm_resource module to
module_utils.common.dict_transformations and add tests.

Use dict_merge to provide a fairly realistic, reliable
diff output when k8s-based modules are run in check_mode.

Rename unit tests so that they actually run and reflect
the module_utils they're based on.
6 years ago
hitsumabushi cf7a42b4f4 allow empty line in src template file (#42493) 6 years ago
Jordan Borean 940d4a0e89
win_reboot: fix 2.6 issues and better handle post reboot reboot (#42330)
* win_reboot: fix 2.6 issues and better handle post reboot reboot

* changed winrm _reset to reset

* Add handler to reset calls when .reset() throws an AnsibleError on older hosts

* Moving back to _reset to get the issue fixed
6 years ago
Toshio Kuratomi 780c8986af Add boilerplate from __future__ and type declarations 6 years ago
Andreas Calminder 577e66660d Simple file locking feature (#42024)
* class for file locking feature
6 years ago
Marcos Alano 2d6bb2500e Add support for espeak-ng. Closes #42438 6 years ago
Andrew Gaffney 824524c67a
Display task banner before showing file diff (#42573) 6 years ago
Matt Martz 8aea8901c3 Add config to fail on invalid task attributes. Fixes #42479 6 years ago
Brian Coca 937e710485
ensure 'text' source assumptions (#42522)
* ensure 'text' source assumptions
6 years ago
Brian Coca 1c08eb8b27
fix irc module to work with py3 (#42267)
* fix irc module to work with py3

fixes #42256
6 years ago
Brian Coca 4a7940c562
Ensure string types (#42362)
* actually enforce string types

* unquote after its text

* fixed incorrect template type

* fixing string showed error in template typing
6 years ago
Kevin Breit a65d9257fd Removed any temporary get_net() methods (#42391)
- Made appropriate changes where needed
6 years ago
Yuwei Zhou e9bf3c70e6 disk fact should return create_option value (#42398) 6 years ago
Yanis Guenane 593f484d77 Fix E324 for vultr modules. (#42464) 6 years ago
Toshio Kuratomi 673c55f2ef Separate some 255 exit codes that are not ssh errors
The ssh connection plugin is overzealous in thinking that error code 255
can only come from ssh.  Python can return 255 in some circumstances and
error from php does as well.
6 years ago
Toshio Kuratomi 9350a81ae4 Port modules away from __file__
* __file__ won't work if we want to invoke modules via -m or if we
  figure out how to keep modules from hitting the disk with pipelining.
* module.tmpdir is the new way to place a file where it will be cleaned
  automatically.

Change format string to not depend on __file__:

* cloud/amazon/ec2_elb_lb.py
* cloud/amazon/elb_classic_lb.py

Use module.tempdir:

* packaging/os/apt.py
* files/unarchive.py
6 years ago
Pilou 72d7a1eb5c Setup module: use C() formatting function in parameter descriptions, add a task based example (#42411)
* setup module: use C() in parameters description

* setup module: use a task example
6 years ago
Matt Martz abb05c98f3 Make sure we are comparing bytes extensions in inventory plugins (#42475)
* Ensure we are comparing text paths with extensions. Fixes #42118

* Add changelog
6 years ago
Brian Coca 8e1d223301
complete plugin docs (#42355)
* complete plugin docs

  * add missing 'plugin' option
  * user and password are now 'correctly' required
  * added  inventory source example and extension information for user
6 years ago
Brian Coca 2496fd35fb added required missing field for common yaml fmt 6 years ago
Matt Martz 50905b980d Support item label in v2_playbook_on_include (#42478)
* Support item label in v2_playbook_on_include. Fixes #42301

* test fixes
6 years ago
bpetit 9bd7bd5d46 [docs] Document requirements for `plan_file` option in terraform module (#42514)
plan_file is required if state: planned is used. This should be mentionned in the documentation.

+label: docsite_pr
6 years ago
Zhikang Zhang 70e33ef92c
Make ios_vlan identify vlans starting with 9 (#42247)
* Make ios_vlan identify vlans starting with 9

* Add unit test for vlan id start with 9
6 years ago
Jakub Libosvar 26b0908270 openvswitch_db: Make 'key' parameter optional (#42110)
The OVSDB schema consists of typed columns. The 'key' parameter is
required only for columns with type of a 'map'. This patch makes 'key'
an optional parameter to allow setting values for other column types
like int.

Fixes #42108
6 years ago
Fabian von Feilitzsch e9c7b513a1 [k8s] allow user to pass list of resources in to definition parameter (#42377)
* allow user to pass list of resources in to definition parameter

* Add new validator for list|dict|string

* use string_types instead of string

* state/force information is lost after the first item in the list

* Add tests

* Appease ansibot
6 years ago
Paul Neumann dfb2b3fdd5 ios_facts: Report space of file systems (#41850)
* ios_facts: Report file system space

Parse total and free space from dir output. For this, add a hash
filesystems_info containing the keys spacetotal_kb and spacefree_kb.

* ios_facts: Add unit test for file system space reporting

* ios_facts: Add integration test for file system space reporting
6 years ago
Felix Fontein dbb58b34c3 Version must be quoted (otherwise it is printed as 2.1) (#42496) 6 years ago
Dag Wieers 3c35b1dbc5
sefcontext: Improve documentation (#42416)
* sefcontext: Improve documentation

* Clarify why this module does not apply changes to filesystems

* Fix

* More clarity
6 years ago
Dag Wieers 0fbaf9940f
cobbler_sync: New module to sync Cobbler changes (#39910)
This module is required if you're using Cobbler for provisioning
systems using Ansible.
6 years ago
Dag Wieers 198b62b906
file: Recover from unexpectedly disappearing files (#42281) 6 years ago
Dag Wieers 8eb1e8c0e6
Ensure boolean value 'yes' is shown and add types (#42361)
And a few small cosmetic changes.
6 years ago
Kevin Breit 7b07c9b220 meraki_network - Add support for disableMyMerakiCom (#42418)
* Add support for disable_my_meraki parameter

- Meraki added support for the disabling access to Meraki websites on
devices. This module now supports this.
- I haven't tested this as it was developed on an iPad. It will work
before submitting PR.
- Rework of payload generation code is required or at least
recommended.
- Integration tests need to be developed.

* Added support for disableMyMerakiCom parameter

* - Remove proposed functions as it isn't required for updates
- Add integration tests
- Still pending a case response from Meraki since I can't seem to
set disableMyMerakiCom to false after it's true

* Fixed word wrap problem

* Add version_added to disable_my_meraki
6 years ago
Kevin Breit c644e3da79 meraki_network - Added proper response documentation (#42393)
* Added proper response documentation to meraki_network

* Missing colon
6 years ago
Kevin Breit 78fd5ce651 Improve documentation of module (#42332) 6 years ago
Kevin Breit 9cd2388d1a New module - meraki_ssid (#42329)
* Initial commit of meraki_ssid module
- CRUD functionality for Meraki wireless SSIDs
- Much more testing is needed
- Module is not currently idempotent

* Improve integration tests
- Original integration tests didn't have any assertions in it
- Single bug fix in module found via integration test

* Added idempotency support
- Changes are only made when needed.
- Added integration test to check for idempotency.
- Relies on a forthcoming PR to make idempotency check a single pass.

* Improved documentation
6 years ago
Kevin Breit 132943cac5 New module - meraki_mr_l3_firewall (#42328)
* Initial commit for meraki_mr_l3_firewall module

- CRUD functionality for layer 3 firewall rules on the Meraki MR access points
- Complimentary integration test
- Need to add support for SSID lookup

* Added support for specifying SSID name and improved documentation

* Added examples to documentation

* Removed whitespace
6 years ago
Kevin Breit 3d3d919c11 New module - meraki_mx_l3_firewall (#42326)
* Initial commig for meraki_mx_l3_firewall
- View and modify L3 firewalls applied to Meraki MX firewalls
- Initial integration tests included

* Added example documentation

* Added documentation for responses

* Documentation tweaks for typos

* PEP8 fix
6 years ago
Kevin Breit ca5f9aab1e Meraki module utility - get_net() downloads networks if data isn't provided (#41423)
* Enable get_net() to download nets if data isn't provided

- Currently, get_net() requires data to be passed to it
- PR enables get_net() to download all networks if data isn't passed
- Slightly simpler code
- Best practice is to download nets early in execution

* Apply fixes related to get_net()

* Removed extra code from the rebase
6 years ago
Kevin Breit eeada86554 Add net_id support to config_template (#42446)
- Added net_id support to config_template
- Changed integration test to use blocks to cleanup on failure
6 years ago
Kevin Breit 9036f846a3 meraki - Enabled support for configuration template configuration (#42392)
* Enabled support for configuration template configuration
- get_nets() now pulls down templates and networks
- A few changes in VLAN and network to operate as a POC

* Ansibot changes

- Fix undefined variable
- Document net_id in meraki_vlan

* Fix indentation
6 years ago
Kevin Breit 779f3c0c1a Allow module to claim devices into an organization (#42448)
- Before this, it allowed claiming devices into a network only
- Make integration tests a block
- Note, API doesn't allow unclaiming in an organization, only net
- Added an integration test for claiming into an org
	- Requires unclaiming manually
- There is a bug in the API which isn't showing claimed devices
6 years ago
Kevin Breit 5960b215bb meraki_admin - Added full return documentation for normal responses (#42487)
* Added full return documentation for normal responses

* Changed returned for responses

- Old responses were saying always returned, should have been success
or something more refined
6 years ago
Kevin Breit 0c59a3bc48 meraki_snmp - Added full response documentation for normal responses (#42488)
* Added full response documentation.

* Changed always to success for responses
6 years ago
René Moser d7c3d5501b
cs_vpc: fix disabled or wrong vpc offering taken (#42465) 6 years ago
Pilou 3301a0b530 docker_container: fix init check requirements (#40839)
* docker_container: ensure 'init' is supported

Check docker-py version too.

Move API version check in docker_container module since 'init' module
parameter isn't defined by other docker modules.

docker-py supports 'init' since 2.2.0:
https://github.com/docker/docker-py/blob/2.2.0/docs/change-log.md

* docker_container: fix compat with docker-py<2.2

Exception was:
TypeError: create_host_config() got an unexpected keyword argument 'init'
fatal: [localhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):
                        File ansible_module_docker_container.py, line 2089, in <module>
                          main()
                        File ansible_module_docker_container.py, line 2084, in main
                          cm = ContainerManager(client)
                        File ansible_module_docker_container.py, line 1704, in __init__
                            self.present(state)
                        File ansible_module_docker_container.py, line 1724, in present
                            new_container = self.container_create(self.parameters.image, self.parameters.create_parameters)
                        File ansible_module_docker_container.py, line 826, in create_parameters
                            host_config=self._host_config(),
                        File ansible_module_docker_container.py, line 932, in _host_config
                            return self.client.create_host_config(**params)
                        File lib/python3.6/site-packages/docker/api/container.py, line 157, in create_host_config
                            return utils.create_host_config(*args, **kwargs)
                      TypeError: create_host_config() got an unexpected keyword argument 'init'",
    "module_stdout": "",
    "msg": "MODULE FAILURE",
    "rc": 1
}
6 years ago
Julien Vey 0f612d1b76 efs_facts: improve performance by reducing the number of api calls (#36520)
* efs_facts: improve performance by reducing the number of api calls

* Remove efs_facts tests from running in CI
6 years ago
René Moser 0e6628395a
cs_firewall: fix idempotence and tests for cloudstack v4.11 (#42458) 6 years ago
Sam Doran 1d1595b990
Fix pause module so it does not stack trace when redirecting stdout. (#42217)
* Use separate variables for stdin and stdout file descriptors

* Do not set stdout to raw mode when output is not a TTY
6 years ago
Jackson Isaac 39ec12f395 junos/junos_config.py: Add RVI Example (#41867) 6 years ago
Jackson Isaac 0cced31795 junos_config: Add VLAN trunking example (#41972) 6 years ago
Jill R 8606fb33f0 Add additional puppet options (#42218)
* Add additional puppet options

Add support for puppet options --debug, --verbose, --summary,
and extend logdest to support logging to stdout and syslog at
the same time.

Fixes issue: #37986

* Fix docs

* Doc fix, add release note

* Fix silly yaml error

* Correct changelog, add C() to params in doc
6 years ago
Jordan Borean 8bdd04c147 Fix remote_tmp when become with non admin user (#42396)
* Fix tmpdir on non root become

 - also avoid exception if tmpdir and remote_tmp are None
 - give 'None' on deescalation so tempfile will fallback to it's default behaviour
   and use system dirs
 - fix issue with bad tempdir (not existing/not createable/not writeable)
   i.e nobody and ~/.ansible/tmp
 - added tests for blockfile case

* Revert "Temporarily revert c119d54"

This reverts commit 5c614a59a6.

* changes based on PR feedback and changelog fragment

* changes based on the review

* Fix tmpdir when makedirs failed so we just use the system tmp

* Let missing remote_tmp fail

If remote_tmp is missing then there's something more basic wrong in the
communication from the controller to the module-side.  It's better to
be alerted in this case than to silently ignore it.

jborean and I have independently checked what happens if the user sets
ansible_remote_tmp to empty string and !!null and both cases work fine.
(null is turned into a default value controller-side.  empty string
triggers the warning because it is probably not a directory that the
become user is able to use).
6 years ago
rcgoodfellow 3a695acf37 Update docker package version (#42394)
The docker API init parameter is the dependency requiring this bump. It was introduced 2.3.0 release of the docker package as per commit 13b5f785a7ab459960aae82fae00e4245e391387 in github.com/docker/docker-py.
6 years ago
nishiokay 7ee86ae370 [cloudstack] fix cs_host example (#42419) 6 years ago
Dag Wieers f98a0b521f
Add querying all bindings (#42366)
Also fix an issue with one of the check-mode tests.
6 years ago
Ganesh Nalawade 5635848654
Fix typo in cliconf pluign (#42399)
* Fix capability key typo error in ios, eos and
  vyos cliconf plugins.
6 years ago
Agris 5df01abd58 Fix for starttls connections for notification mail module (#42381)
* Fixes #42338

Fixes #42338
Fixed starttls connection usage by adding smtp.ehlo before smtp.has_extn function.

* remove Trailing whitespace

remove Trailing whitespace
Fixes #42338

* marged bcoca requested changes

Fixes #42338
move ehlo for starttls section only.

* Remove spaces
6 years ago
Brian Coca 475abc0af7
inventory plugin docs (#42022)
* inventory plugin docs
* added set options
* minor wording and formatting fixes
* changed headers to std as per #35520, also added to main readme
* unified inventory plugin devel, referenced from generic plugin dev
* fixed typos and update as per feedback
6 years ago
Carlos Mendible 133b70ff45 Added missing type for both template and parameters variables. (#42033)
* Added missing type for both template and parameters variables.

* changed object to dict
6 years ago
rcgoodfellow e3478e0da5 Update docker_container.py (#42370)
`docker-py` is no longer a thing.

https://github.com/docker/docker-py/issues/1431
6 years ago
Dag Wieers b90ae65e5c
aci_static_binding_to_epg: Add description parameter (#42244)
* aci_static_binding_to_epg: Add description parameter

This PR adds the description parameter to this module.

Tis fixes #42154

* Fix added_version
6 years ago
Deepak Agrawal 30688fecf3
Idempotency for net_get and net_put modules (#42307)
* Idempotency for net_get and net_put modules

* pep8 warnings fix

* remove import q
6 years ago
Zhikang Zhang de40ac02a5
Make ansible doesn't parse template-like password in user's input (#42275)
NOTE:
1. Use unsafe decorator but not builtin escape wrapper in jinja2
since ansible will try parse ssh password twice, the builtin
escape wrapper will be removed during the first parse.
2. Use class AnsibleUnsafeText but not '!unsafe' syntax since
passwords are not loaded by YAML env, '!unsafe' syntax doesn't
work for them.
6 years ago
Ganesh Nalawade 31dd41e4c5 Fix fetching old style facts in junos_facts module (#42336)
* Fix fetching old style facts in junos_facts module

Fixes #42298
* To fetch old style facts from junos device it requires
  login credentials in provider, hence while using
  connection=nectonf do not delete provider values
  as it might not be ignored

* Add `ofacts` as one of the options in `gather_subset`

* Minor update in documentation

* Fix CI failure
6 years ago
Will Thames 62e7a65459 k8s_facts trivially supports check_mode (#42335) 6 years ago
Jared Hocutt 8b711d9874 Fix examples in azure_rm_securitygroup (#42121) 6 years ago
Ganesh Nalawade 75382814f0
Add fetching default filter in ios cliconf plugin (#42339)
* Add capability to fetch default filter flag in
  ios cliconf plugin.
6 years ago
Nilashish Chakraborty ed5a0f2d9c
nxos_logging new feature - remote logging (#41237)
* Added feature - Remote Logging + More tests

* Fixed Shippable Errors

* Fixes - new feature version added error
6 years ago
Rémi REY da0f58787e callback/grafana_annotations: define validate_grafana_certs type as bool (#42318)
Fixes #42317
6 years ago
Sumit Jaiswal 828dd1a663
To fix the NoneType error raised in ios_l2_interface when Access Mode VLAN is unassigned (#42312)
* to fix the bug41657

* to fix review comment
6 years ago
Juan Manuel Parrilla 376b30ece4 FreeIPA: ipa_vault module to manage idm secure vault resource (#41902) 6 years ago
Alexandre Vicenzi df2e0c7c00 Fix broken links. (#42323) 6 years ago
Julien Brochet 2762c4fe1a Fix error message when using the params option (#42305) 6 years ago
Ganesh Nalawade c068b88b38
Update eos, ios, vyos cliconf plugin (#42300)
* Update eos cliconf plugin methods

*  Refactor eos cliconf plugin
*  Changes in eos module_utils as per cliconf plugin refactor

* Fix unit test and sanity failures

* Fix review comment
6 years ago
Felix Fontein 6b6c017dd1 ACME modules: documentation improvements (#42165)
* Always using current draft when referring to ACME v2.

* Adding URL for ACME v1 protocol.

* Improve cross-referencing of acme_* modules.

* General improvements.

* Fixing syntax error.
6 years ago
Deiwin Sarjas 6412cbf84b aws_eks_cluster: Add wait functionality (#42259)
* aws_eks_cluster: Improve output documentation

This data is already returned by the module, it just wasn't documented. These
fields are required for accessing the created Kubernetes API with e.g. the
k8s_raw module.

* aws_eks_cluster: Add wait functionality

This enables further cluster configuration once it's created and active.

20 minutes was chosen as an arbitrary default, so that if it takes longer than
the documented "usually less than 10 minutes" it's still likely to succeed.

* Correct security group name in aws_eks tests

* Improve teardown of aws_eks tests

Fix minor teardown issues. The `pause` step is a placeholder until
a waiter for `state: absent`
6 years ago
Ganesh B. Nalawade c43beef258 Minor changes 6 years ago
gstaicu 8590465d96 Update pause.py (#42297)
Change spelling from 'contols' to 'controls'
6 years ago
Ganesh B. Nalawade d1ff8e2dca Update ssh_config to accept file path 6 years ago
Trishna Guha df8ad8ebf9
fix regex cliconf nxos (#42288)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Dave Thelen 51092c6ea5 Update eos_l2_interface.py (#42270) 6 years ago
mjmayer b60fc33eef Add execution_role_arn parameter (#41849)
* Add execution_role_arn parameter

* Change ecs_taskdefinition to use AnsibleAWSmodule

Botocore version checking is becomming more common. Changing the ecs_taskdefinition
to use AnsibleAWSmodule allows more easily for this.

* Change launch type check to use botocore_at_least function

* Remove execution_role_arn param from params dict

* Change check to use parameter

* Fix typo

* Add test for old botocore version

* Add test for execution role parameter

* Remove iam_role_facts task

Task was unecessary. The same information could be gathered by registering
the iam_role task.
6 years ago
fxfitz f92b95b8cb Remove ipa_ modules from sanity ignore; fix the docs 6 years ago
cahlchang 92dce2943f [AWS] Add check Iam Role description update (#39773)
* add check description update

* Ensure 'Description' is in the role so KeyError isn't caused

* Fix changed when modifying the description with check mode
6 years ago
Ganesh B. Nalawade 8d8d4b3d86 Add options for jumphost in netconf connetion
Fixes #37262
Fixes #36284

*  Updates options in netconf connection to enable
   bastion/jump host setting using configuration/enviornment
   varaibles.
*  Update troubleshooting docs from using bastion host with netconf
   connection
6 years ago
Manu Pascual 313e7ba55e Fix set the correct key option in the docs (#42251)
In vmware_vmkernel, parameter is subnet_mask instead of netmask
6 years ago
Trishna Guha 805d13f287
nxos CI failures bugfix (#42240)
* fix nxos_portchannel and remove deprecated param in test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix _nxos_switchport CI failures

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix nxapi nxos_command test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* remove unsupported param nxos_smoke test

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* fix nxos_vxlan_vtep_vni

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* syntax error

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Trishna Guha 0e05425b32
Refactor nxos cliconf get_device_info and add requirements for JSON structured output support in nxos_facts module (#42089)
* nxos_facts requires JSON structured output support

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* refactor get_device_info for legacy devices

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>

* update additional logic

Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Ondra Machacek 0a6ab23f38 ovirt_affinity_lables_facts: Raise error when host/vm not found (#41790) 6 years ago
Ashish Billore faa83285dc Udate ini.py with corrected intended use (#42232)
* Udate ini.py with corrections to intended use

Corrected the intended use for ini reads.

* Update ini.py with corrected intended use info
6 years ago
krisek 55a94784a3 Update aci_vrf.py (#42246)
<!--- Your description here -->

+label: docsite_pr
6 years ago
Kevin Breit 05f7d64a98 Add properties for orgs and nets (#42085)
- Module utility now has orgs, nets, org_id, and net_id properties
- get_nets and get_orgs sets nets and orgs properties respectively
- Allows for storage of this data in the module. org_id and net_id aren’t set as I cannot guarantee that’s always desired.
6 years ago
Kevin Breit 08ddd202fb meraki_config_template - Check for HTTP status code (#42145)
* Check for HTTP status code

- All requests now check returned status code
- Fail if status code isn’t what is expected

* Fix blank line error

* Change HTTP check logic and improve integration tests
- Set HTTP status code check so default path is accept
- Added create and delete network for integration test
- Remove a few comments to clean up code
6 years ago
Kevin Breit 40b9862d38 Meraki modules - Added support for checking HTTP response codes (#42144)
* Added support for checking HTTP response codes
- All request calls now check for response code before responding
- If the response code isn't what it should be, it fails or returns nothing
- Breaking this into multiple PRs to make backporting easier
- Using status property in Meraki module utility which has the code

* Change logic of HTTP checks so success is default
6 years ago
Kevin Breit 3ee3fc893d Change idempotency check to be single pass (#42087)
- Previously all data between both data structures was compared
- Results in situations where updates are done when not needed
- Changes to single pass so only data in payload is compared
6 years ago
Dag Wieers 09fec5a482
aci_interface_policy_ospf: Create OSPF interface policies (#42184)
* aci_interface_policy_ospf: Create OSPF interface policies

New module to create OSPF interface policies

* Fix documentation issues

* Add missing integration tests

* Update documentation and examples
6 years ago
Dag Wieers 57c0471b54
Fix ACI validate-modules issues (#42222) 6 years ago
David Galloway 9539284010 nsupdate.py: Fix typo (#42209)
Signed-off-by: David Galloway <dgallowa@redhat.com>
6 years ago
tstoner db7300904d Enforcing NXAPI default HTTP behavior (#41817)
* nxos_nxapi http default behavior

* Use nxos_nxapi module in prepare_nxos_tests

* Refactor nxos_nxapi configure test to use yaml block

* Extend nxos_nxapi https & http test cases

* Removed NXOS internal release naming

* Resolved ansibot sanity errors

* Fix typo in prepare_nxos_tests

* Address PR comments

* Shippable indicates this is no longer needed

* Add port change logic and testing
6 years ago
Rob b87e1a023d [aws] add support for http2 to AWS ALB (#40372) 6 years ago
Alexander Saprykin 1eea5674ba Fix galaxy client executing queries with invalid http method (#42201)
Fixes: ansible/galaxy#796
6 years ago
jeromecc daaf711e44 clarify module functionality in docstrings: module creates domains and their @ A record only #35669 (#41872) 6 years ago
Abhijeet Kasurde 087fc0c20c Restore BOOLEANS import in basic.py (#42008)
This import was removed by mistake. This is required for backward
compatibility.

Fixes: #41988

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
fluxcess 6290a7c595 added description (#42187)
Added description to one of the really basic code examples

+label: docsite_pr
6 years ago
Trishna Guha 981c9f6a79
fix nxos_vxlan_vtep_vni issue (#42183)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
cclauss 14bc625c2c Catch the raised exception so we can report failure (#42177)
[AWS iam_policy] Avoid the _undefined name_ by catching the raised exception into the variable __e__ so it can be reported on the following line.

flake8 testing of https://github.com/ansible/ansible on Python 3.6.3

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./lib/ansible/modules/cloud/amazon/iam_policy.py:305:16: F821 undefined name 'e'
            if e.errno == 2:
               ^
./lib/ansible/modules/cloud/misc/rhevm.py:594:24: F821 undefined name 'e'
            setMsg(str(e))
                       ^
./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)
                                                                                           ^
3    F821 undefined name 'e'
3
```
6 years ago
Nathaniel Case 5850591d14
Base connection class for network-style connections (#41839)
* Create base class for network-style connections

* clean up some differences

* Move NetworkConnectionBase

* Tweak netconf for tests

* Tweak when network_os is checked to avoid failing tests

* Pull back exec_command
6 years ago
Kevin Breit dd31dcab70 Meraki module utility request() has improved error reporting (#39838)
* request() has improved error reporting
- 5xx errors show same as before
- 3xx and 4xx errors show error body

* Print body for errors greater than 300, but less than 500

* Remove trailing whitespace
6 years ago
cclauss 61d5454737 Catch the raised exception so we can report failure (#42072)
Avoid the _undefined name_ and mirror lines 389 and 459 by catching the raised exception in the variable __exc__ so it can be reported on the following line.

flake8 testing of https://github.com/ansible/ansible on Python 3.6.3

$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./lib/ansible/module_utils/network/iosxr/iosxr.py:414:42: F821 undefined name 'exc'
            module.fail_json(msg=to_text(exc))
                                         ^
```
6 years ago
Felix Fontein 52e7946de5 Minimizing information needed for second stage from first stage. (#42167) 6 years ago
Andrew Gaffney f4efa2c4cc
Provide a fallback value for all options in 'default' callback plugin (#42155)
This is necessary for plugins that subclass 'default' but don't also
include its docs fragment. This is a follow-up to #41058
6 years ago
Sam Doran fb55038d75 Add warning when using an empty regexp in lineinfile (#42013)
* Revert "Account for empty string regexp in lineinfile (#41451)"

This reverts commit 4b5b4a760c.

* Use context managers for interacting with files

* Store line and regexp parameters in a variable

* Add warning when regexp is an empty string

* Remove '=' from error messages

* Update warning message and add changelog

* Add tests

* Improve warning message

Offer an equivalent regexp that won't trigger the warning.
Update tests to match new warning.

* Add porting guide entry for lineinfile change
6 years ago
Brian Coca b6f2aad600 ignore ansible.cfg in world writable cwd (#42070)
* ignore ansible.cfg in world writable cwd
 * also added 'warnings' to config
 * updated man page template
6 years ago
Brian Coca de0e11c0d5 avoid loading vars on unspecified basedir (cwd) (#42067)
* avoid loading vars on unspecified basedir (cwd)
6 years ago
James Cassell 3627aa3391 pamd module regression fix (#42025)
* pamd: typo fix sufficicent->sufficient

* pamd: is_valid is a property, not a method; return a tuple

* pamd: define is_valid for all PamdLine classes

* pamd: use validate() for verbose errors, define generically

* pamd: PamdRule: rule_control is always str, use _control

Fixes https://github.com/ansible/ansible/issues/41179
6 years ago
Olli-Antti Kivilahti 8eacbd0381 elasticsearch_plugin - Show STDERR on module failures. (#41954)
* elasticsearch_plugin - Show STDERR on module failures.

I tried to install a ES plugin without
  become: yes
and found after debugging the module that the module failed ude to permission issues.

The only error message I got was
  Is analysis-icu a valid plugin name?

That was strange considering I followed the example documentation by the letter.

I found out that when this module fails, it hides the real reason for failure.

This patch replaces the generic error with more meaningful diagnostics.

* elasticsearch_plugin - Show STDERR on module failures. Changelog fragment

 samdoran commented 2 days ago

This looks good. Please create a changelog fragment to go along with this change. See fragments for examples.
6 years ago
Tyler Gregory fabd7823b2 Correct typo in win_domain_computer doc (#42123) 6 years ago
Sloane Hertel 22a6927dbd Fix file module with check_mode - Fixes #42111 (#42115)
* Fix file module check_mode
6 years ago
John R Barker e9dbebfa57
Fix some broken links (#42079)
* Fix some broken links

* We now only serve via https
* redirects don't work with anchors, so update those links (devel/dev_guide)
6 years ago
Sloane Hertel 44e5886385 Fix setting required options for inventory plugins (#42049)
* Fix setting required options for inventory plugins

* call set_options for yaml and script plugin
6 years ago
Matt Martz aea396f04b
Add items2dict filter that is the reverse of dict2items (#42071)
* Add items2dict filter that is the reverse of dict2items

* Address feedback about type checking, and add docs for zip/zip_longest
6 years ago
Fabian von Feilitzsch d75e49693b update module arguments to allow resource_definition to be a string (#40730) 6 years ago
David Soper 5f5fbffe8a UCS Server UUID pool modules and integration tests (#41743)
* UCS Server UUID pool modules and integration tests

* change version added to 2.7

* Doc and result changed updates from review.
6 years ago
David Soper f8f22f77ed Fix issue with vNIC redundancy templates (#36608)
* Fix bug with redundancy templates and add integration tests for redundancy templates.

* vlan_list absent state support and fix for vlans as strings in vlan_list
6 years ago
John McDonough bf932a852b Module for UCSM Manager Timezone Management (#36974)
* Module for UCSM Manager Timezone Management

* Module for UCSM Manager Timezone Management

* Module for UCSM Manager Timezone Management

* Addressed PR comments and added integration tests

* fixed mismatched default value between doc and argument_spec

* changed main() to call run_module()

* Change version to 2.7

* updated integration aliases indicating unsupported testing

* updates to DOCUMENTATION
6 years ago
Ganesh Nalawade 88b966e23b
Fix junos_config confirm commit issue (#41527)
* Fix junos_config confirm commit issue

Fixes #40626

* Due to issue in ncclient commit() method for Juniper
  device (ncclient/ncclient#238)
  add a workaround in junos netconf plugin to generate proper
  commit-configuration xml and execute it using ncclient
  generic `rpc()` method.

* Update junos_config doc
6 years ago
Ganesh Nalawade e41d427d1b
Add run_commands api for ios and vyos cliconf plugin (#42093)
* Add run_commands api for ios and vyos cliconf plugin

*  Add run_commands api to ios and vyos cliconf plugin
*  Refactor ios and vyos module_utils to check return code
   in run_commands

* Fix Ci failures
6 years ago
Fran Fitzpatrick 88764165ad Adds description of the group to documentation (#42080) 6 years ago
Ryan Brown d76e9008ee [aws] Default state of iam_managed_policy to `present` (#42069)
This default matches with the other IAM modules, such as iam_role.
6 years ago
Leif Madsen 4a05b6c8ba Fix EC2 example variable naming mismatch (#42048)
Fix EC2 example where variable name mismatched usage.

+label: docsite_pr
6 years ago
LeenSun 5ea414422b Update supervisorctl.py (#42031)
<!--- Your description here -->

+label: docsite_pr
6 years ago
Dave Thelen fa2366079a Update eos_vlan.py (#41852)
changing show command to work for both transport methods
6 years ago
saichint bd9b8b422d fix nxos_gir issues (#41809)
* fix nxos_gir issues

* review comments
6 years ago
Luke Short 5024b4e445 Update the minimum Ansible version to 2.4. (#41989) 6 years ago
John R Barker ed3933b67a
Corrects typos in net_get/put module docs (#41991) 6 years ago
Lukas Beumer 26abdbf0fd Add the possiblity to force a plugin installation (#41688) 6 years ago
Kevin Jones 09f4c51f9f [openstack] add endpoint_type parameter to examples (#41979)
Certain project functions are not available on the openstack public api. Creating and deleting projects are examples where you must use the admin api.

In most devstack or simple openstack deployments the public, internal and admin apis may live at the IP. However in most production deployments the admin APIs are on a separate network than the public APIs. Therefore for these examples to consistently work, we must specify the admin endpoint_type.
6 years ago
Eitan Akman fb7882bf86 Issue #39860: Add 'not_contains' method to parsing.py (#39874)
* Issue #39860: Add 'not_contains' method to parsing.py

* Issue #30860 Adds self.negate to Conditional class in lib/ansible/module_utils/network/common/parsing.py

* Issue #39860 Fix singleton-comparison issue per sanity tests

* Issue #39860 'test/integration/targets/nxos_command/tests/cli/not_comparison_operator.yaml' integration test

* Issue #39860 Add unit tests to '../../test/units/module_utils/network/common/test_parsing.py'

* Issue #39860 Fix singleton comparison issue

* Fix E302 expected 2 blank lines, found 1

* Issue #39860 Add license header to unit tests

* Issue #39860 Move integration test to 'test/integration/targets/nxos_command/tests/common/'; remove unnecessary comment from unit test

* Issue #39860 remove unnecessary comment from unit test
6 years ago
Jordan Borean 77526a5036
win_domain: fix typo in cmdlet call (#41993) 6 years ago
Andrew Saraceni bcb49f2575 Refactor/fix win_group_membership to use SIDs for internal comparisons (#40725)
* refactor win_group_membership to use SIDs for comparisons instead of name parsing

* carry over previous doc cleanup changes

* remove trailing whitespace from docs
6 years ago
Jordan Borean cc97e89620
Revert "win_security_policy: allow removing values (resolves #40869) (#41125)" (#41986)
This reverts commit f2bd6b6bfd.
6 years ago
jamessemai f2bd6b6bfd win_security_policy: allow removing values (resolves #40869) (#41125)
* win_security_policy: allow removing values (resolves #40869)

* Removing warning

* Adding test for remove policy setting

* Fixing string comparison
6 years ago
Matt Martz 1401fa74cc
Cache items when task.loop/with_items is evaluated to set delegate_to vars (#41969)
* If we evaluate task.loop/with_items when calculating delegate_to vars, cache the items. Fixes #28231

* Add comments about caching loop items

* Add test for delegate_to+loop+random

* Be more careful about where we update task.loop
6 years ago
Troy Murray 15ce7c5bab change OS X to macOS (#41294)
* change OS X to macOS

<!--- Your description here -->

+label: docsite_pr

* Update all Mac OS X references to be macOS

* Drop extra Mac
6 years ago
hirsts c0c20835ac Create splunk.py (#40568)
* Create splunk.py

This is a new callback for logging to Splunk. It is based on sumologic.py and updated to work with the Splunk HTTP Event Collector. 
This has been by our team and others. 
It is working with Ansible 2.5.2

* Update splunk.py

Addressed white spaces and formatting issues

* Update splunk.py

* Update splunk.py

* Updated version to match target release

Following code review recommendations. Thanks for the help

* Updated colon impacting documentation

Updated based on code reviews. Thanks the help

* Updated quotes to be consistent
6 years ago
Matthew Stone c5c3900c52 Adding slxos_lldp module (#39259)
* Adding slxos_lldp module
6 years ago
Brian Coca 27e3cd6e05 options should be settable multiple times 6 years ago
Kevin Breit 7ab3f755ce Fixes idempotency check for partial configurations (#41941)
- Previous PR would overwrite new and existing values improperly
6 years ago
Pierre-Louis Bonicoli 4e275a4ba8 tower_project: manual projects don't require creds 6 years ago
Ganesh Nalawade 9acb5780bc
Add diff capability in vyos edit_config (#41950)
* Add diff capability in vyos edit_config

Fetch onbox diff within edit_config cliconf
plugin and return it in response

* Remove diff returned from ios edit_config

* Fix CI failure

* More CI fixes
6 years ago
Jordan Borean 2af36412f9
runas + async - get working on older hosts (#41772)
* runas + async - get working on older hosts

* fixed up sanity issues

* Moved first task to end of test for CI race issues

* Minor change to async test to be more stable, change to runas become to not touch the disk

* moved async test back to normal spot
6 years ago
Steve Jennings 57ea4cafff Add productType property as an ansible fact (#41139)
* Add productType property as an ansible fact

Suggest to add productType property from win32_operatingsystem CIM instance to differentiate between versions and add new fact.

* update code to display human-readable string

Commit added in response to nizmahone's suggestion to add humane-readable strings to the display. uses switch statement to evaluate and update $ansible_facts hash table with proper information

* remove string conversion, modify switch default

Adjusts line 202 to remove .String() conversion from uInt32.
Adjusts switch test values to integers
Uses switch default clause to handle null values

* formatting

fixed formatting issues, moved product_type into variable.
adjust ansible_fact hash table key to be consistent with the rest of the code.

* Moved product type within distribution
6 years ago
Jordan Borean abfcc35e6f
win_iis_webapppool: do not output some cmdlet outputs (#41884) 6 years ago
Will Thames 895c512596 New k8s_facts module
Strip out the facts parts of the k8s module into a new simpler
module that deals with querying for facts, also allowing
field and label selectors
6 years ago
David Medberry ffba0a5d99 Update aws_caller_facts.py (#41936)
Minor typo (accont vs account) and rewording to remove dangling from.

+label: docsite_pr
6 years ago
Sam Doran 4b5b4a760c
Account for empty string regexp in lineinfile (#41451)
* Use context managers for interacting with files

* Account for empty string as regexp

Rather than explicitly testing for None, also test for an empty string which will evaluate to False. An empty string regexp matches every line, which ends up replacing the incorrect line.

* Store line parameter in a variable

* Add tests
6 years ago
Sam Doran eaae1318f8
Skip if insertbefore BOF until later (#41767)
If a line match is found in the file and no regexp is specified, insertbefore would improperly try to add a line if set to BOF.

Add tests for this scenario.
6 years ago
Matt Martz 93537425a0
Don't import password lookup from network filters. Fixes #41874 (#41907) 6 years ago
Matt Martz 1a2ef0922f
Use inventory.get_host instead of direct access to inventory.hosts (#41860)
* Use inventory.get_host instead of direct access to inventory.hosts. Fixes #32152

* Prevent potential side effect, by using self._inventory.localhost directly instead of get_host
6 years ago
Matt Martz d255cf42d7
Fix NameError, value was not available in this context leading to a generic unexpected error. Fixes #33275 (#41856) 6 years ago
Robin Roth 24e94ec3c6 Make zypper work with python3 6 years ago
Jordan Borean 9b7b564d75
Stop displaying kinit pass input on a failure (#41882)
* Stop displaying kinit pass input on a failure

* Fixed up minor logic info and added tests
6 years ago
Nathaniel Case 97ffb4c4d2
New base class for HttpApi plugins (#41915) 6 years ago
Dennis Benkert 28d0a173db [aws] add limit on number of CloudFormation stack events fetched by cloudformation module (#41840)
* Add a module parameter to configure the max fetched AWS CFN stack events
* Add version documentation for new configuration option
* Increase default in order to make sure that enough are fetched by default. This align roughly with the limit of manageable resources in CloudFormation.
6 years ago
Abhijeet Kasurde 4d909c1830 VMware: add new parameter in networks (#41899)
This fix adds a new parameter 'dvswitch_name' in networks argument spec.
When there are multiple distributed portgroup with the same name in the given
environment, it is difficult to pick particular dvpg. By specifying dvswitch value
we can pin point exact distributed portgroup to attach virtual machine to.

Fixes: #41781

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Martin Krizek 8b5283f547 Template handler name 6 years ago
permitanyany c309381f19 Add Show Interface Example (#41863)
<!--- Your description here -->

+label: docsite_pr
6 years ago
Kevin Breit 44e9ea30c9 Bugfix for idempotency bug (#41889)
- Comparison was not happening properly as it lacked full data
- Module now creates a full data structure on payload
- Defaults to America/Los_Angeles as that's what Meraki seems to do
6 years ago
Ganesh Nalawade b84adfd885
Fix ios and vyos cliconf edit_config return type (#41896)
* Fix ios and vyos cliconf edit_config return type

Modify cliconf edit_config api to return a json string with
diff and response received from remote host for ios and vyos.

* Doc change
6 years ago
Paul Neumann d4b9105c9c cliconf: Fix use of multiple prompts in send_command (#41885)
Upon preparing the commands for sending to the device, cliconf converts
the optional prompt to a byte string. However, since there might be
multiple prompts specified, the conversion has to happen for each prompt
individually. Otherwise, wrong regexes will be compiled in
_handle_prompt from network_cli Connection.
6 years ago
Felix Fontein 348f87d3f4 New module: acme_certificate_revoke (#40995)
* First version (without revocation checking).

* Adding check mode and OCSP revocation verification.

* Fixing ACME v1 behavior.

* Fixed superfluous space.

* Fixing links.

* Working around linter complaints.

* Added docstring.

* More defensive.

* Disabling check mode for now.

* Simplifying module by no longer checking OCSP, and removing check mode vestiges.
6 years ago
Ganesh Nalawade 773c031d33
vyos and ios cliconf plugin refactor (#41846)
* vyos and ios cliconf plugin refactor

*  Refactor vyos cliconf plugin
*  Change vyos module_utils and vyos_config as per refactor
*  Minor changes in ios cliconf plugin

* Fix unit test failure

* Fix sanity issues

* Add get_diff to rpc list
6 years ago
Andrew Gaffney 9c5d40ff15
Merge various stdout callback plugins into 'default' (#41058)
This allows mixing and matching of stdout callback features
6 years ago
Jordan Borean 2e46688bca
win_chocolatey: always return the rc return value (#41883) 6 years ago
David Passante f30e0b833d cloudstack: new module cs_disk_offering (#41795) 6 years ago
permitanyany 7135c1302a Add 2 EBGP neighbors with template (#41853)
<!--- Your description here -->

+label: docsite_pr
6 years ago
Brian Coca 11dbed1350 fix vars hostname fallback
also made it optimistic, rely on exceptions instead of copmlex if chains
6 years ago
Matt Martz 9a18385fab
Validate that rescue and always have an accompanying block. Fixes #26751 (#41822) 6 years ago
Matt Martz e9a5c53512
Handle typing of vars_files in Play.get_vars_files. Fixes #14708 (#41801) 6 years ago
Nathaniel Case dd932c9ace
Make validate_certs togglable for httpapi (#41538)
* Make validate_certs togglable for httpapi

* Add `version_added`
6 years ago
permitanyany 46dbb3e1e8 Show BGP Status In JSON (#41844) 6 years ago
Nathaniel Case 9aa8c652ba
Netconf bytes fixes (#41607)
* Solve some bytes issues on iosxr

* Solve some bytes issues in junos

* Do the correct thing with tostring based on lxml or not
6 years ago
Simon Dodsley c144adc9de Fix API call to get ActiveCluster information and add (#41744)
connected arrays and volume group counts to default
6 years ago
Sijis Aviles ba3db90e3a Fix: wildcard excludes in unarchive with tar archives (#40935)
* fix: exclude using wildcards for tar archives

Fixes #37842, #22947

* fix: Remove quote() as it munges the exclude format

* test: Refactor to use single archive structure

A common structure archived by different methods should simplify some of
the feature tests.

* test: Use common archive layout to validate exclude feature

* test: Use the same exclude checks for zip/tar archives
6 years ago
Adam Miller c65b7eb52e validate vars_files entries are string_type or list (#40985)
* validate vars_files entries are string_type or list

Fixes #17594

Signed-off-by: Adam Miller <admiller@redhat.com>

* use collections.Sequence to simplify if check

Signed-off-by: Adam Miller <admiller@redhat.com>
6 years ago
Fred-sun 0d4e113975 Update azure_rm_publicipaddress_facts.py example (#41833)
Example describe error
6 years ago
Kevin Breit 4d5d0b63f3 Remove extarneous json.loads() which was moved to the utility. (#41731) 6 years ago
Brian Coca 0102e42272
exclude lookup_terms from config errors (#41740)
* exclude lookup_terms from config errors
* moved direct
6 years ago
Olivier Bourdon 06b73ff8f1 Add random_mac string filter (#39775)
Add new filter to generate random MAC addresses from
string prefix. See docs/docsite/rst/user_guide/playbooks_filters.rst
for more detailed infos.
6 years ago
Brian Coca 2affb5f729 doc fix 6 years ago
Brian Coca 27c43daab8
fix minor issues with debug and item labels (#41331)
* fix minor issues with debug and item labels

 - no more `item=None`, we always have a label now
 - debug should only show expected information, either msg= or the var in var=
 - also fixed method name, deprecated misleading _get_item
6 years ago
Alex Stephen 929ac6155c [gcp] Fix service account email parameter on gcp_compute_instance (#41806) 6 years ago
James Mighion 8f4daf84c8 Revert "Fixes #35622 (#41522)" (#41805)
This reverts commit 8357ae69e7.
6 years ago
Ryan Brown c7a5e9d4eb Remove unused imports from aws_direct_connect_connection module (#41802)
* Remove unused imports from aws_direct_connect_connection module

* Fix tuple notation
6 years ago
HD650 07738cc848 Improve code style 6 years ago
HD650 8b9f707c21 More explanation in docstring 6 years ago
HD650 0586cb1536 Check type of fail_msg and success_msg 6 years ago
zhikangzhang 24189e7639 Point out that fail_msg is new in 2.7 6 years ago
zhikangzhang 2333b4474c Rename argument msg to fail msg
This change make the arguments of assert less ambiguous.
6 years ago
Abhijeet Kasurde 065d9ed6ac FreeIPA: Add support for TTL in dnsrecord (#41768)
Fixes: #33969

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Ryan Brown 5abb63ea56 Remove unused imports from aws_config_aggregator (#41803) 6 years ago
Ondra Machacek 8f144976df ovirt_auth: In case of token is passed u/p is not requierd (#41788) 6 years ago
Sloane Hertel ba7d3dab5c Document compose for aws_ec2 inventory plugin (#40621)
* Document compose for aws_ec2 inventory plugin

* split up examples into several parts with some additional comments
6 years ago
Dag Wieers da49aaf1d9 Add trailing dot and make it a separate item 6 years ago
Camillevau 79982473ca Update docker_container.py
<!--- Your description here -->

 label: docsite_pr
6 years ago
cpollard0 f93a171bb6 [aws][docs] Update max session duration in sts_assume_role documentation(#41765)
Update to reflect assume role updated durations as of March 2018. 
https://aws.amazon.com/blogs/security/enable-federated-api-access-to-your-aws-resources-for-up-to-12-hours-using-iam-roles/

+label: docsite_pr
6 years ago
Mark Phillips 355b56ef00 [docs] Change 'tag' to 'tags' in aws_ec2 inventory examples (#41438) 6 years ago