Commit Graph

999 Commits (97cc0cce7f53b704f8541530e42d5e515584cd95)

Author SHA1 Message Date
Yanis Guenane 593f484d77 Fix E324 for vultr modules. (#42464) 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
Dag Wieers 8eb1e8c0e6
Ensure boolean value 'yes' is shown and add types (#42361)
And a few small cosmetic changes.
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
fxfitz f92b95b8cb Remove ipa_ modules from sanity ignore; fix the docs 6 years ago
Fabian von Feilitzsch d75e49693b update module arguments to allow resource_definition to be a string (#40730) 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
Martin Krizek 2f60baa5e0 file: clarify attributes usage in docs (#41780) 6 years ago
Jon Dufresne bf304832ff Prefer readthedocs.io instead of readthedocs.org for doc links (#41537)
Read the Docs moved hosting to readthedocs.io instead of
readthedocs.org. Fix all links in the project.

For additional details, see:

https://blog.readthedocs.com/securing-subdomains/

> Starting today, Read the Docs will start hosting projects from
> subdomains on the domain readthedocs.io, instead of on
> readthedocs.org. This change addresses some security concerns around
> site cookies while hosting user generated data on the same domain as
> our dashboard.
6 years ago
Toshio Kuratomi 461a2733e6 Make admin_users only contain root and toor because admin is used for non-privileged accounts
This fixes one specific instance of failure to chown from a privileged
account:
https://github.com/ansible/ansible/issues/16052#issuecomment-384976615

Fixes #41160
6 years ago
Zhikang Zhang 8c15d71783 Fix typo in decrypt doc. (#41149)
Prior to this change, the document cannot render the default choice of decrypt correctly.
6 years ago
Brian Coca c86fd6e2df Fix error reporting on bad type for config setting 6 years ago
Eike Frost b72e3bb568 Documentation/default fix for keycloak modules (#37192)
* fix validate_certs doc and remove default for auth_client_id

* document admin-cli default instead of removing it
6 years ago
Artem Goncharov 89ce826a9f retire shade in favor of openstacksdk for openstack modules (#40532)
* Establish connection through openstacksdk
* Switch from shade to openstacksdk
* fix typo in link to openstacksdk
* remove nova_client usage
* further remove of min_version from openstack modules
6 years ago
Felix Fontein e294426b07 Rename letsencrypt module utils / document fragment to acme. (#40697) 6 years ago
Felix Fontein dec392793b Letsencrypt: add account management module (#37275)
* Removed superfluous space.

* Separating account init code from ACMEAccount constructor.

* Extracted module utils and docs fragment.

* Added new letsencrypt_account module.

* Ignore pre-1.0.0 versions of OpenSSL.

* Added account key rollover.

* Renaming letsencrypt_account -> acme_account

* Simplifying check for updating contact information.

* Rewriting docstring for ACMEDirectory.

* Changing license according to permissions given by individual authors in https://github.com/ansible/ansible/pull/37275.

* Updating BOTMETA.

* Preparing for change of ACME protocol currently discussed in ietf-wg-acme/acme.

* Updating documentation.
6 years ago
Yunge Zhu 21ea92feca Fixes #36621, support adfs auth through adal (#37909)
* update username/password auth to use adal lib

* remove default client_id after discussion

* fix lint error: trailing whitespace
6 years ago
Ondra Machacek 46fbfd5d53 ovirt: Add support to pass hostname (#40610)
Previously we supported only to pass API URL, now we support also
hostname.
6 years ago
Abhijeet Kasurde da79989e70
VMware: vmware_guest Documentation update (#38377)
This PR refactors vmware_guest module

- VMware: Documentation update
- Elaborate more on effects of state on virtual machine.
- Specify 'force' option usage.
- Formatting
- add review comments

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Chris Archibald 8b5f34e110 Add Na_ontap_broadcast_domain module. (#39753)
* add first module

* fix case

* Create na_ontap

* Fix small pep8 errors

* Fixes for issues found by Amit

* fixes for amit

* fix doc

* get doc to compile
6 years ago
Rafael 44eaa2c007 opennebula: new module one_host (#40041) 6 years ago
Trishna Guha 5eb6e3c611
nxos module doc fragment for authorize,auth_pass (#40074)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
6 years ago
Dag Wieers d7f3d3b867
Fix module validation checks and remove old params (#39926)
This PR includes:
- Fixes to the majority of module validation issues
  (deliberate inconsistencies between docs and arg_spec)
- Removal of deprecated parameters 'method' and 'protocols'
- A few typos in the documentation

There are still some left-over validation errors, some are deliberate
(like doc strings as default to indicate ranges, etc.)
6 years ago
Brian Coca cbb6a7f4e8
Enabled unsafe and vault in JSON (#38759)
* allow to load json marked as unsafe or vault

 * centralized json code/decode, add vault support
 * use generics to allow for more varied inputs
 * allow inventory to dump vault w/o decrypting
 * override simplejson also
 * add entry for unsafe also
 * load vaulted and unsafe json, support unvaulting if secrets provided
6 years ago
Kevin Breit c36aa6ae50 Panos/doc fragment (#37696)
* Create PanOS module documentation fragment

- Module documentation fragment currently holds 3 parameters
- It most likely won't be used in every single module since there is
some variance

* Modified PanOS module for use doc_frags

- Where documentation is consistent, module documentation now uses a
documentation fragment instead of all documentation being contained in
the module.

* Formatting and syntax error fixes

Updated some formatting errors to make ansibot happy.

* Revisions for grammar
6 years ago
Abhijeet Kasurde d70b3b4661
VMware: New module: vmware_tag (#37261)
This module is based on vSphere REST API. This module allows
user to manage various tags and their association with
categories. This fix also adds vCenter REST client library which can
be re-used for other REST based modules.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Kevin Breit c8d287fece Meraki organization module (#38773)
* Initial commit

Query an organization within Meraki. No support is in place for managing
or creating yet

* Change output_level method and make the state parameter required.

* Implemented listing all organizations

- Updated documentation
- Parse results and return all organizations
- Parse results and return specified organization

* Framework for creating an organization

- Documentation example for organization creation
- Framework exists for creating organizations, pending PR 36809
- Created functions for HTTP calls
- Renamed from dashboard.meraki.com to api.meraki.com
- Added required_if for state

* Remove absent state

- Meraki API does not support deleting an organization so absent is removed
- Updated documentation to call it state instead of status

* Small change to documentation

* Support all parameters associated to organization

- Added all parameters needed for all organization actions.
- None of the added ones work at this time.
- Added documentation for clone.

* Integration test for meraki_organization module

* Rename module to meraki for porting to module utility

* Meraki documentation fragment

- Created initial documentation fragment for Meraki modules

* Add meraki module utility to branch. Formerly was on a separate branch.

* CRU support for Meraki organization module

* CRU is supported for Meraki organizations
* There is no DELETE function for organizations in the API
* This code is very messy and needs cleanup
* Create and Update actions don't show status as updated, must fix

* Added Meraki module utility to module utility documentation list

* Added support for organization cloning
* Renamed use_ssl to use_https
* Removed define_method()
* Removed is_org()
* Added is_org_valid() which does all org sanity checks

* Fixes for ansibot
- Changed default of use_proxy from true to false
- Removed some commented out code
- Updated documentation

* Changes for ansibot
- Removed requirement for state parameter. I may readd this.
- Updated formatting

diff --git a/lib/ansible/module_utils/network/meraki/meraki.py b/lib/ansible/module_utils/network/meraki/meraki.py
index 3acd3d1038..395ac7c4b4 100644
--- a/lib/ansible/module_utils/network/meraki/meraki.py
+++ b/lib/ansible/module_utils/network/meraki/meraki.py
@@ -42,7 +42,7 @@ def meraki_argument_spec():
     return dict(auth_key=dict(type='str', no_log=True, fallback=(env_fallback, ['MERAKI_KEY'])),
                 host=dict(type='str', default='api.meraki.com'),
                 name=dict(type='str'),
-                state=dict(type='str', choices=['present', 'absent', 'query'], required=True),
+                state=dict(type='str', choices=['present', 'absent', 'query']),
                 use_proxy=dict(type='bool', default=False),
                 use_https=dict(type='bool', default=True),
                 validate_certs=dict(type='bool', default=True),
diff --git a/lib/ansible/modules/network/meraki/meraki_organization.py b/lib/ansible/modules/network/meraki/meraki_organization.py
index 923d969366..3789be91d6 100644
--- a/lib/ansible/modules/network/meraki/meraki_organization.py
+++ b/lib/ansible/modules/network/meraki/meraki_organization.py
@@ -20,11 +20,9 @@ short_description: Manage organizations in the Meraki cloud
 version_added: "2.6"
 description:
 - Allows for creation, management, and visibility into organizations within Meraki
-
 notes:
 - More information about the Meraki API can be found at U(https://dashboard.meraki.com/api_docs).
 - Some of the options are likely only used for developers within Meraki
-
 options:
     name:
         description:
@@ -32,21 +30,18 @@ options:
         - If C(clone) is specified, C(name) is the name of the new organization.
     state:
         description:
-        - Create or query organizations
-        choices: ['query', 'present']
+        - Create or modify an organization
+        choices: ['present', 'query']
     clone:
         description:
         - Organization to clone to a new organization.
-        type: string
     org_name:
         description:
         - Name of organization.
         - Used when C(name) should refer to another object.
-        type: string
     org_id:
         description:
         - ID of organization
-
 author:
     - Kevin Breit (@kbreit)
 extends_documentation_fragment: meraki
@@ -86,7 +81,6 @@ RETURN = '''
 response:
     description: Data returned from Meraki dashboard.
     type: dict
-    state: query
     returned: info
 '''

@@ -103,6 +97,7 @@ def main():
     argument_spec = meraki_argument_spec()
     argument_spec.update(clone=dict(type='str'),
+                         state=dict(type='str', choices=['present', 'query']),
                          )

@@ -125,11 +120,9 @@ def main():

     meraki.function = 'organizations'
     meraki.params['follow_redirects'] = 'all'
-    meraki.required_if=[
-                           ['state', 'present', ['name']],
-                           ['clone', ['name']],
-                           # ['vpn_PublicIP', ['name']],
-                       ]
+    meraki.required_if = [['state', 'present', ['name']],
+                          ['clone', ['name']],
+                          ]

     create_urls = {'organizations': '/organizations',
                    }
@@ -162,23 +155,16 @@ def main():

-
-    # method = None
-    # org_id = None
-
-
-    # meraki.fail_json(msg=meraki.is_org_valid(meraki.get_orgs(), org_name='AnsibleTestOrg'))
-
     if meraki.params['state'] == 'query':
-      if meraki.params['name'] is None:  # Query all organizations, no matter what
-        orgs = meraki.get_orgs()
-        meraki.result['organization'] = orgs
-      elif meraki.params['name'] is not None:  # Query by organization name
-        module.warn('All matching organizations will be returned, even if there are duplicate named organizations')
-        orgs = meraki.get_orgs()
-        for o in orgs:
-          if o['name'] == meraki.params['name']:
-            meraki.result['organization'] = o
+        if meraki.params['name'] is None:  # Query all organizations, no matter what
+            orgs = meraki.get_orgs()
+            meraki.result['organization'] = orgs
+        elif meraki.params['name'] is not None:  # Query by organization name
+            module.warn('All matching organizations will be returned, even if there are duplicate named organizations')
+            orgs = meraki.get_orgs()
+            for o in orgs:
+                if o['name'] == meraki.params['name']:
+                    meraki.result['organization'] = o
     elif meraki.params['state'] == 'present':
         if meraki.params['clone'] is not None:  # Cloning
             payload = {'name': meraki.params['name']}
@@ -193,7 +179,10 @@ def main():
             payload = {'name': meraki.params['name'],
                        'id': meraki.params['org_id'],
                        }
-            meraki.result['response'] = json.loads(meraki.request(meraki.construct_path('update', org_id=meraki.params['org_id']), payload=json.dumps(payload), method='PUT'))
+            meraki.result['response'] = json.loads(meraki.request(meraki.construct_path('update',
+                                                                                        org_id=meraki.params['org_id']),
+                                                                  payload=json.dumps(payload),
+                                                                  method='PUT'))

diff --git a/lib/ansible/utils/module_docs_fragments/meraki.py b/lib/ansible/utils/module_docs_fragments/meraki.py
index e268d02e68..3569d83b99 100644
--- a/lib/ansible/utils/module_docs_fragments/meraki.py
+++ b/lib/ansible/utils/module_docs_fragments/meraki.py
@@ -35,6 +35,7 @@ options:
         description:
         - Set amount of debug output during module execution
         choices: ['normal', 'debug']
+        default: 'normal'
     timeout:
         description:
         - Time to timeout for HTTP requests.
diff --git a/test/integration/targets/meraki_organization/aliases b/test/integration/targets/meraki_organization/aliases
new file mode 100644
index 0000000000..ad7ccf7ada
--- /dev/null
+++ b/test/integration/targets/meraki_organization/aliases
@@ -0,0 +1 @@
+unsupported

* Formatting fix

* Minor updates due to testing
- Made state required again
- Improved formatting for happier PEP8
- request() now sets instance method

* Fix reporting of the result

* Enhance idempotency checks
- Remove merging functionality as the proposed should be used
- Do check and reverse check to look for differences

* Rewrote and added additional integration tests. This isn't done.

* Updated is_update_required method:
- Original and proposed data is passed to method
- Added ignored_keys list so it can be skipped if needed

* Changes per comments from dag
- Optionally assign function on class instantiation
- URLs now have {} for substitution method
- Move auth_key check to module utility
- Remove is_new and get_existing
- Minor changes to documentation

* Enhancements for future modules and organization
- Rewrote construct_path method for simplicity
- Increased support for network functionality to be committed

* Changes based on Dag feedback and to debug problems

* Minor fixes for validitation testing

* Small changes for dag and Ansibot
- Changed how auth_key is processed
- Removed some commented lines
- Updated documentation fragment, but that may get reverted

* Remove blank line and comment

* Improvements for testing and code simplification
- Added network integration tests
- Modified error handling in request()
	- More testing to come on this
- Rewrote construct_path again. Very simple now.

* Remove trailing whitespace

* Small changes based on dag's response

* Removed certain sections from exit_json and fail_json as they're old
6 years ago
Luke Short 49e3f60c42 ovirt: Update documentation to showcase that the Python SDK 4.2.4 is required. (#39169)
This is related to the GitHub PR#35841. Some documentation was missed and did not get updated with those patches.
6 years ago
The Fox in the Shell efe7c20100 LDAP: Refactor and add ldap_passwd module (#33040)
* modules/net_tools/ldap: Refactor shared options
* modules/net_tools/ldap: Refactor shared code
* modules/net_tools/ldap: Add ldap_passwd module
* modules/net_tools/ldap/ldap_passwd: More robust change check
* In some deployments, using compare_s results in spurious “changed” results,
while bind is more reliable.  The downside is that it results in an extra
connection, and the code it more involved.
* ldap_passwd: Rename methods passwd_[cs]
* ldap_passwd: Remove unecessary type=str
* ldap: Factor-out failure cases
* ldap_passwd: Provide more precise error messages
* ldap_passwd: Irrelevant syntax changes
* ldap_passwd: Rename u_con to tmp_con
* ldap_passwd: Keep HAS_LDAP local
* LDAP doc update
* Resolved all copyright related issues
* Resolved self.fail calls
* Update documentation

Signed-off-by: The Fox in the Shell <KellerFuchs@hashbang.sh>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
jctanner bbfe7a8b2f
more debug logs for free, network_cli, paramiko and add hostname context to debugging messages (#39205)
* Add hostname context to debugging messages
* Set paramiko's channel
6 years ago
Toshio Kuratomi 83c1cba511
Fixes for mode=preserve (#39343)
* Fixes for mode=preserve

* Document mode=preserve for template and copy
* Make mode=preserve work with remote_src for copy
* Make mode=preserve work for template
* Integration tests for copy & template mode=preserve

Fixes #39279

* Changed mode option in win_copy to hidden option as it doesn't reflect copy mode
6 years ago
John R Barker 7c4b91844d
More validate module fixes (#39097)
* Fix type bool DOCUMENTATION issues
6 years ago
John R Barker 9e028ab704
Modules to link relatively to docs (#39081)
* Modules to link relatively to docs

* consistency
6 years ago
Thierry BOUVET 4117b2dd29 Fix documentation fragments for docker (#38378) 6 years ago
Andreas Nafpliotis c0243a8a31 fixed documentation to include esxi host (#38668) 6 years ago
Matt Martz b794fa4fe7 Expose verbosity as a var, dedupe attr list. Fixes #36170 6 years ago
Toshio Kuratomi 02f44176b9 Document the relationship between octal numbers and the leading zero
Fixes #37875
6 years ago
Yuwei Zhou 8c819dd9cb Support MSI for ansible on Azure resources (#36634)
* msi

* add env and param

* add msi in default

* add azure_rm

* add document

* subscription param

* if not enabled msi

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

* lint

* lint

* Update azure_rm_common.py

* fix

* catch exc and make error message more friendly

* lint

* Minor docs changes to the msi source option
6 years ago
Abhijeet Kasurde 0ae7a0e88c
VMware: Use environment variable for connection (#37726)
This fix adds environment variables for connection in vmware_*
modules.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Matt Clay 775539a8b8 Fix api_profile choices in Azure docs fragment. 6 years ago
Claes Nästén 458a07d5a4 add timeout parameter and increase default timeout for nso modules (#37391)
NSO operations can take much longer than 10 seconds as they operate on
real network equipment, set default timeout to 5 minutes and allow for
user override.
6 years ago
Dag Wieers cdd21e2170
Clean up module documentation (#36909)
* Clean up module documentation

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

* Fix remaining (new) validation issues
6 years ago
René Moser 2559e832df
cloudstack: fix common E324 in docs (#37082)
Notes about precedence of common args.
Partly fixes E324.
6 years ago
Anil Kumar Muraleedharan 23f15e6ff6 Lenovo license update (#36840)
* Editing the License text after Review of Lenovo Legal team.
6 years ago
John R Barker ebc71bcb16
Network modules to link to network guide (#37033)
* Network modules to link to network guide

* Make it clear what's deprecated
* enable -> become
* Detail when provider is still needed (eAPI/NX-API)
* Link to specific sections
* rx_rate & tx_rate to link to conditional docs
6 years ago
Dag Wieers cb79957b5f
Make use of named links in documentation notes (#37027)
* Make use of named links in documentation notes

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

* Add improvements to ACI documentation

* Disable QA for long line

* Add :menuselection: and :guilabel:

* Improve links on some modules
6 years ago
ABond e2615308f9 Include Digital Ocean Token Alias (#36810) 6 years ago
Gaurav Rastogi 60e39b9718 Updated the documentation of modules to match argspec including the type setting for bool parameters (#36821) 6 years ago
Dag Wieers 398b3a4d76
ACI: Parameter username is not required (#36817) 6 years ago
Mário Santos 8b52006d5c Fix sanity checks in OpenStack docs fragment (#36722)
* Fix sanity checks in OpenStack docs fragment

Signed-off-by: Mário Santos <mario.rf.santos@gmail.com>
6 years ago