Commit Graph

376 Commits (918f768890a32d5f1b03bd1d4d4de3f48261b63e)

Author SHA1 Message Date
Gonéri Le Bouder 0b579a0837 doc: preseve block-quote structure (#53293)
Without the `::`, the indentation of the example block is lost.
6 years ago
Sloane Hertel 9687879840
Fix inventory cache interface (#50446)
* Replace InventoryFileCacheModule with a better developer-interface

Use new interface for inventory plugins with backwards compatibility

Auto-update the backing cache-plugin if the cache has changed after parsing the inventory plugin

* Update CacheModules to use the config system and add a deprecation warning if they are being imported directly rather than using cache_loader

* Fix foreman inventory caching

* Add tests

* Add integration test to check that fact caching works normally with cache plugins using ansible.constants and inventory caching provides a helpful error for non-compatible cache plugins

* Add some developer documentation for inventory and cache plugins

* Add user documentation for inventory caching

* Add deprecation docs

* Apply suggestions from docs review

* Add changelog
6 years ago
Xaroth 646a8586a5 Remove old 'srtd' theme and references. (#49289) 6 years ago
Matt Martz a639dc6d88
Add a new check to ensure that module arguments are valid python identifiers (#53278)
* Add a new check to ensure that module arguments are valid python identifiers

* Move the check up higher, out of the if docs block

* Skip validate-modules on py2

* Remove errant alias
6 years ago
Chris Gavin 43042682e8 Fix an incorrect function call in a documentation example. (#53233) 6 years ago
Sebastian Wojciechowski 5cc6a70398 Remove redundant article in testing integration note (#53209) 6 years ago
Kevin Breit 4af5842409 Developer documentation - Change path to connection_plugins (#52577)
* Change path to connection_plugins

* Update docs/docsite/rst/dev_guide/developing_plugins.rst

Co-Authored-By: kbreit <kevin.breit@kevinbreit.net>
6 years ago
Jordan Borean 7360db5956 doc - skip/windows for integration tests (#53010) 6 years ago
John R Barker 80cc6417fa Docs: List of Sanity Tests (#52986)
* Improve sanity test docs, how to run sanity tests section
6 years ago
Esa Varemo 5bdc6636bc Fix the example plugin paths (#52881)
Based on https://docs.ansible.com/ansible/latest/reference_appendices/config.html
the default callback paths do not contain `_plugin`. Thus `~/.ansible/plugins/callback_plugins` and `/usr/share/ansible/plugins/plugin_type/action_plugins` are incorrect. Verified on 2.7.5 that by default `plugins/action` works and `plugins/action_plugins` does not.
6 years ago
Divided by Zer0 1f06b3ca7d ungrouped as a list (#50593)
* update the developing_inventory docs to show ungrouped as a dict with a "children" key; avoid 
[WARNING]: Found both group and host with same name: ungrouped
6 years ago
Abhijeet Kasurde e0d8d9c2bf validate-modules: Documentation bool (#50085)
* validate-modules: Documentation bool

This check allows to catch cases where type of argument is different than documentation does.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Wrong comparison for 'str'

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Add ignore.txt

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

* Fix logic and clean up ignore.txt
6 years ago
Jordan Borean de118734e9
Ansible.Basic - add required_by to module spec (#51407)
* Ansible.Basic - add required_by to module spec

* fix typo in docs
6 years ago
James Cassell 953058d025 standardize connection variable names (#51776)
* standardize user/password connection vars

* docs: use ansible_user and ansible_password

* docs: var precedence for connection vars

* docs: ansible_become_pass -> ansible_become_password etc
6 years ago
Richard Diphoorn ad549e375a Changed 'Control Machine' to 'Control Node' (#51696)
* Changed 'Control Machine' to 'Control Node' in the documentation. Changing the term 'Control Machine' to 'Control Node', to be in line with the basic concepts here: https://docs.ansible.com/ansible/latest/network/getting_started/basic_concepts.html

Also for both entities; Control/Managed using the same common denominator 'Node' brings consistency.

* Updated reference links to new term.
6 years ago
RMuskovets eb54dab362 Update developing_rebasing.rst (#51650) 6 years ago
Toshio Kuratomi dfd8b659c0 Have update-bundled check for updates to all bundled code
Add a test for whether we have bundled code inside of ansible that needs to be updated
6 years ago
Alex Willmer c7f8e5d05e doc: Correct path of unit tests directory (#51631)
+label: docsite_pr
6 years ago
Wojciech Sciesinski fbbda7267b Add a missed command (#50781)
* Add a missed command

* Link to the WinRM configuration page
6 years ago
Mahendra Yadav 10a402a9c8 Update developing_modules_general_windows.rst (#51493)
<!--- Your description here -->
Typo fix
+label: docsite_pr
6 years ago
Felix Fontein f6122fb63b Fix docs syntax highlighting errors (#50836)
* Add support for [WARNING]: ...

* Fix unreachable/failed output lexing.

* Detecting retry/--limit lines.

* Removing strange (invisible) characters which cause lexing problems.

* Using better-fitting lexers.

* Improve YAML lexing: don't accept quotes in keys.

* Add Django lexer (unchanged) from Pygments.

* Add support for != and % operators.
6 years ago
Brian Coca 96b3ef5553
Doc fragments to plugins (#50172)
* promote doc_fragments into actual plugins

  change tests hardcoded path to doc fragments
  avoid sanity in fragments
  avoid improper testing of doc_fragments
  also change runner paths
 fix botmeta
 updated comment for fragments
 updated docs
6 years ago
Ken Dreyer 1b09197244 doc: describe merging to ansible.module_utils.* (#51152)
Add a section to the documentation describing precisely how Ansible
merges custom module_utils/* Python code into the "ansible.module_utils"
namespace.
6 years ago
Dag Wieers 1fb2165bd8
Fix typo
+label: docsite_pr
6 years ago
Matt Martz ab0985a83a
Update the example for API use to reflect new context object (#50723) 6 years ago
Miguel Gonzalez 8546273f5e Make module handle its own exit (#50728) 6 years ago
Dag Wieers 7a1ceb6988
Correct the command for test coverage
+label: docsite_pr
6 years ago
Dag Wieers 9e003d702f
Fix relative paths
+label: docsite_pr
6 years ago
Matt Clay 560e922440 Add more ansible-test aliases to test docs. (#50921) 6 years ago
Simon Legner 33b9c880a4 Consistent typesetting of "GitHub" (#50929) 6 years ago
branen 88029a73d6 Correct docsite typos: it's -> its (#50812) 6 years ago
Karolis Kalantojus b5162c7a47 Documentation fix for developing own plugin (#50547)
Seems like `self` is not necessary in the call args

+label: docsite_pr
6 years ago
Alicia Cozine 90a6771bc8
removes space from example of L(link) syntax (#49908) 6 years ago
Jordan Borean 8d008fed35
windows dev docs: fix a few issues and add missing info (#49836) 6 years ago
Dag Wieers baf0ad2309 Docs: Add a "seealso" section to the module docs (#45949)
* Docs: Add a separate  "seealso" section to the module docs
to list related modules and/or related references. This clears up the notes
section for things that are actual notes.

So you can add a section in your module documentation and four types of
references are possible.

    seealso:

    # Reference by module name
    - module: aci_tenant

    # Reference by module name, including description
    - module: aci_tenant
      description: ACI module to create tenants on a Cisco ACI fabric.

    # Reference by rST documentation anchor
    - ref: aci_guide
      description: Detailed information on how to manage your ACI infrastructure using Ansible.

    # Reference by Internet resource
    - name: APIC Management Information Model reference
      description: Complete reference of the APIC object model.
      link: https://developer.cisco.com/docs/apic-mim-ref/

This PR also includes:

- Implements ansible-doc support
- Implements schema support for the seealso options
- Updates to the development documentation
- Rename filter convert_symbols_to_format to rst_ify, cfr the existing html_ify and tty_ify filters
  - This makes the existing template a lot easier to read and fixes the confusion I had myself rereading the template (again).
- We fixed the possible suboption types (which was limited to 'bool' only)

* Use latest stable instead of devel docs
6 years ago
Alicia Cozine a71cd49a0c Style guide index (#49746)
* First revision of ansible style guide index page
6 years ago
Sandra McCann 32c2b3b3be Styleguide basic (#49747)
* cleaned up basics page

* made codeblock visible

* added anchor
6 years ago
trogdor_the_burninator b3c277decc [FIX] grammatical structure of phrase (#49660) 6 years ago
Phuurl 29c96d20fb Corrects minor typos in the documentation (#49668)
Signed-off-by: Phuurl <chubble.10@icloud.com>
6 years ago
Abhijeet Kasurde 287a42eba0 Added recommendation about module name (#49540)
* Added recommendation about module name

Added general guidelines for naming a module.

Fixes: #19665

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Alicia Cozine 8d01e26d18 Refines docs on creating action plugins (#49392)
* Refines docs on creating action plugins

Co-Authored-By: acozine <879121+acozine@users.noreply.github.com>
6 years ago
Abhijeet Kasurde 45e41f5a3d Add Action plugin example (#49290)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Ian Wienand 44c734e624 Local test docs: correct tox shell command usage (#49350)
The ansible-test shell command doesn't have a --python option; you
have to specify the tox environment directly to the --tox command

Partially fixes: #49349
6 years ago
John R Barker 3433ca286d Docs reorg /community/index & /dev_guide/index (#48734)
* Improved community/index.rst makes it easier to find existing content
6 years ago
Matt Martz 7287d396e2 Prevent metadata changes in a stable branch (#48994) 6 years ago
Matt Martz 9773a1f289
Add a Singleton metaclass, use it with Display (#48935)
* Add a Singleton class, use it with Display

* update six import

* Move remaining failes to display singleton

* Fix rebase issues

* Singleton improvements

* Add code-smell for 'from __main__ import display'. ci_complete

* s/self/cls/g

* Add docs for no-main-display

* Address linting issues

* Add changelog fragment. ci_complete

* Implement reentrant lock for class instantiation in Singleton

* Add Display singleton porting guide
6 years ago
Wojciech Sciesinski cebe64ac0c Add a missed command (#48857)
adds command to set the environment for the hacking script
6 years ago
Bianca Henderson 89a9bc0488 Change intro portion of Testing page (#48692)
* Change intro portion of Testing page
6 years ago
Bojan Vitnik b0cc240665 New module: xenserver_guest - manages XenServer VMs (#41041)
* XenServer related modules - initial commit

 - New module_util: xenserver. Contains common module arguments, functions
   and classes useful for future XenServer related modules.
 - New module_docs_fragment: xenserver. Describes common module arguments.
 - New module: xenserver_guest. Supports VM deployment, reconfiguration,
   removal, detection of changes, state management, fact gathering and
   Ansible check mode. Module is fully documented.
 - Updated: developing_module_utilities.rst.
 - Module params, workflow and some functions are based on or taken from
   vmware_guest module.

* Implemented support for configuring custom VM params in xenserver_guest module

* Compatibility fixes and documentation update

 - xenserver module_util: implemented support for XenAPI.py version older
   than 7.2.
 - xenserver module_util: PEP8 fixes.
 - xenserver module_util: Added missing imports.
 - xenserver module_util: Copyright notice fixes.
 - xenserver_guest module: updated module documentation with notes regarding
   module requirements and compatibility.
 - xenserver_guest module: bumped version_added to 2.7.
 - xenserver_guest module: minor fixes.

* VM power state management refactoring, subargument specs in xenserver_guest module, other fixes

 - VM power state management code moved from xenserver_guest module to xenserver
   module_util (set_vm_power_state function).
 - Code for waiting for VM IP address moved from xenserver_guest module to
   xenserver module_util (wait_for_vm_ip_address function).
 - xenserver module_util: implemented get_object_ref function to clean up
   a lot of repeated code in xenserver_guest module.
 - xenserver module_util: added additional aliases 'host' and 'pool' for
   'hostname' common module argument. They are more in line with what
   XenServer users are familiar with.
 - xenserver module_util: minor fixes.
 - xenserver_guest module: removed VM state management other than 'present',
   'absent' and 'poweredon'. Other states are to be managed by separate module.
 - xenserver_guest module: added subargument specs and cleaned up custom code
   for subargument validation.
 - xenserver_guest module: reorganized code for disk and network reconfiguation
   to minimize code duplication.
 - xenserver_guest module: renamed 'cdrom.iso' module argument to
   'cdrom.iso_name', avoids cryptic error message when parameter is
   missing.
 - xenserver_guest module: documentation update.
 - xenserver_guest module: changes in error messages.
 - xenserver_guest module: minor fixes.

* Implemented guest OS network parameter configuration and other

 - xenserver module_util: moved code for validating MAC addresses from
   xenserver_guest module and implemented a range of functions for validating
   IP addresses and related entities and converting prefixes to netmasks and
   vice versa.
 - xenserver module_util: updated fact gathering code to support guest OS
   network parameters.
 - xenserver module_util: added docstrings.
 - xenserver module_util: minor changes.
 - xenserver_guest module: implemented support for guest OS network parameter
   configuration.
 - xenserver_guest module: changed CD-ROM handling code.
 - xenserver_guest module: changed so that user friendly version of changes
   list is always returned in module result.
 - xenserver_guest module: error message changes.
 - xenserver_guest module: added docstrings.
 - xenserver_guest module: documentation update.
 - xenserver_guest module: minor changes and fixes.

* Various fixes and code cleanup

 - xenserver module_util: implemented get_xenserver_version function.
 - xenserver module_util: moved customization agent detection code to
   gather_vm_params function. customization_agent variable is now part of
   vm_params. An exception in customization agent detection code that prevented
   deployment of new VMs is also fixed.
 - xenserver module_util: added support for alternative VM state names with
   dash and underscore in set_power_state function.
 - xenserver_guest module: removed customization agent detection code
   as it is now implemented in xenserver module_util.
 - xenserver_guest module: fixed a bug in xenserver_data update code that
   occured when "networks.mac" was not specified in module params and
   other fixes.
 - xenserver_guest module: some code cleanup.
 - xenserver_guest module: bumped version_added to 2.8.
6 years ago
Matt Clay 8066acc90c
Support skip of platforms by version in tests. (#48826)
* Support skip of platforms by version in tests.

Previously a remote platform could be skipped completely using the alias:

`skip/{platform}` such as `skip/rhel`

Now a specific platform version can be skipped using the alias:

`skip/{platform}{version}` such as `skip/rhel7.6`

This feature is available for platforms specified with the `--remote` option.

* Add skip by version to the docs.
6 years ago
Matt Clay 1a3bf09f8a
Add test to require docs for action plugins. (#48376) 6 years ago
Matt Martz 8765d2a8e8
code-smell test that can find deprecated config items (#46273)
* Start of code-smell test that can find deprecated config items

* Strip deprecated.version from config item

* Don't use os.walk, rely on explictly passed list of files

* Properly disable the test

* Add docs

* Make config an orphan
6 years ago
Felix Fontein 9a848ca883 Fixing typo in developing_locally.rst (#48535)
`cacheing` → `caching`

+label: docsite_pr
6 years ago
Jordan Borean 501acae5ab
Added basic equivalent to PowerShell modules (#44705)
* Added basic equivalent to PowerShell modules

* changes based on latest review

* Added tests

* ignore sanity test due to how tests are set up

* Changes to work with PSCore

* Added documentation and change updated more modules

* Add some speed optimisations to AddType

* fix some issues in the doc changes

* doc changes
6 years ago
John R Barker 72359a10e6 Tidy up Contributors Docs (#47619)
* Tidy up docs on GitHub, direct people to docs.ansible.com
* De-duplicate documentation and move useful info
6 years ago
Ben Cornett 6229f89369 Fix spelling (#47692) 6 years ago
Johannes Brunswicker d3be5d5327 Creates base Sophos UTM module (#45781)
* Fixes #18568
* Commit of the first set of utm modules
* added documentation line for module_utils file
* removed other utm modules for the first pr
* added maintainers to botmeta
* implemented fixes for shippable
* fixed whitespaces and newlines in included doc fragment
* added types and choices to documentation
* fix for E501
* Implemented change requests
* changed utm_utils license to BSD
* changed str() to to_native()
* added a status state that will just return information about my object
* renamed state 'status' to 'info'
* added team_e-spirit to botmeta and added the team as maintainer for the utm_utils
* only return a result if the lookup was not empty. Do not return a null result
* removed info state
* added boilerplate
* made preparation for info-only modules
6 years ago
Alicia Cozine 4219d25fc7 Add docs about contributing to docs (#46481)
* adds page on community contributions to docs
6 years ago
Jordan Borean ddfd1dbfc6
Add helper function to return helpful import error msg (#47409) 6 years ago
He Guimin 85ba30a3db Add new module ali_instance (#36898) 6 years ago
Bianca Henderson ffc46e1648 Making minor grammatical changes (#46844)
fixes to dev_guide page
6 years ago
Sloane Hertel f3d5ebb355 add more consistent extension matching for inventory plugins (#46786)
* Add consistent extension matching for inventory plugins that support YAML configuration files

* Document extension matching expectations
6 years ago
Alicia Cozine 9764f32513 adds stub API docs in a single file (#46663)
* adds stub API docs in a single file
6 years ago
Matt Clay e2b6047514
Add symlinks sanity test. (#46467)
* Add symlinks sanity test.
* Replace legacy test symlinks with actual content.
* Remove dir symlink from template_jinja2_latest.
* Update import test to use generated library dir.
* Fix copy test symlink setup.
6 years ago
Alicia Cozine 66eb5681f4 yes, we do run validate_modules in Shippable (#46280) 6 years ago
Alicia Cozine d1beb8436b restores legacy testing file (#46095)
* restores legacy testing file

* corrects links to legacy testing page

* oops, copy-pasta fix
6 years ago
Simon Metzger fc7e5f16e8 Update developing_modules_general_aci.rst
<!--- Your description here -->

+label: docsite_pr
6 years ago
Jordan Borean 27c10fa502
add skip/docker alias to skip tests when running on Docker (#45955)
* add skip/docker alias to skip tests when running on Docker

* changed warning message wording
6 years ago
Pilou 60160c1e90 doc: exercising module code locally: update cmd (#45697)
The documented way to execute module code locally wasn't always working:

    $ python ./lib/ansible/modules/files/file.py <<< '{"ANSIBLE_MODULE_ARGS": {}}'
    Traceback (most recent call last):
      File "./lib/ansible/modules/files/file.py", line 177, in <module>
        from ansible.module_utils.basic import AnsibleModule
      File "~/ansible/lib/ansible/module_utils/basic.py", line 78, in <module>
        import tempfile
      File "~/ansible/lib/ansible/modules/files/tempfile.py", line 69, in <module>
        from tempfile import mkstemp, mkdtemp
    ImportError: cannot import name 'mkstemp'
6 years ago
Alicia Cozine f430f60541
Restore license agreement (#45809)
* adds page for CLA in community docs with links from dev and community docs
6 years ago
John R Barker 822236810e
BOTMETA Validator + Bulk tidyup, support:(core,community,network) (#44903)
plugins/ is COMMUNITY
Set sensible defaults for directories
support:network for the platforms that we Networking SUPPORTS,
everything else is COMMUNITY
Mark other support:network (ansible-connection, etc)
Infoblox is support:core
contrib/ by definition should be support:community
Remove duplicated labels
Make yamllint happy(ier)
Adds sanity test to ensure BOTMETA.yml is valid
6 years ago
Dag Wieers e038338e9f Improvements to structure 6 years ago
Jacob McGill 78d7769bd9 ACI: Move dev_guide from Wiki to Ansible docs 6 years ago
Dag Wieers afea00fa9f Improve the local toctree (and title) (#45590)
Make toctree for Windows dev guide local, remove 'Ansible' from the title, since
this documentation is about Ansible.
6 years ago
Alicia Cozine 6e68d77f6d adds license details to dev guide pages (#45574)
* adds license details to dev guide pages

* fixes capitalization error
6 years ago
Alicia Cozine 4264be2b18 Remove more docs build errors (#45364)
* orphans testing pages to avoid not-in-toctree errors

* orphans various pages pending reorg

* adds module_utils and special_vars to main TOC

* uses a glob for scenario_guide TOC

* normalize and Sentence-case headings on community pages, typos

* re-orgs community TOC, adds all pages to toctree

* removes scenario guides index page

* adds style guide to community index

* basic update to style guide

* fix typo that created a new error

* removes not-in-toctree from ignore errors list

* leave removing files for future cleanup task
6 years ago
Alicia Cozine 9a76441c02
rewrite of the developer guide, part 1 (#45179)
* rewrite of the developer guide, part 1
6 years ago
Brian Coca 893d59fabe
updated guides to avoid connection: local (#44227)
- want they really need is `delegate_to: localhost`
 - also reduced 'local_action' usage in favor of same
6 years ago
Donghyun Kang 5fecf8baab doc: fixed typo (#44685) 6 years ago
Toshio Kuratomi 68c60ad307 Change validate-modules for removed modules
Removed modules now don't have documentation.  Need to account for that
when checking them in validte-modules
6 years ago
Andreas Olsson 00e5123e4c Update documentation based on 301 permanent redirects (#43675) 6 years ago
Toshio Kuratomi da26ba3760 Documentatin fixes 6 years ago
Toshio Kuratomi c4951cce0b Exorcise Python-2.6 6 years ago
Will Smith 2de692348f change raising errors example to raise error (#43664)
Example instantiates an AnsibleError which derives from Exception but doesn't actually raise it like intended. This is misleading as it's not clear without examining the code for AnsibleError to know that it's not some function which would raise the exception automatically.
6 years ago
Andreas Olsson 1a11cecaef Prefer https:// links in the docs site
All the changed urls are availible by way of https://. Most of them
already redirect.
6 years ago
Matt Martz 01c0446cb5
Add AnsibleModule signature schema, and fix associated issues (#43512) 6 years ago
Matt Clay 4e489d1be8
Update Shippable integration test groups. (#43118)
* Update Shippable integration test groups.
* Update integration test group aliases.
* Rebalance AWS and Azure tests with extra group.
* Rebalance Windows tests with another group.
6 years ago
Brian Coca a37f27a243 removed note from already removed 1.x api comment
fixes #39888
6 years ago
Sachidananda Urs fecda03066 Fix typos in documentation (#42406)
Fix typos in unit test documentation

Fixes:  #42405
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
John R Barker 6366df700d Document module links (#42308) 6 years ago
John R Barker d962611528 Allow documentation of module options type (#42285)
* Allow documentation of module options

Pass through the `type` of a modules option so it's displayed on the
html module docs

* docs
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
Andrea Tartaglia a342538aba Add shell out checks (#41545)
* Added error codes for shell_out checks

* Added ignore lines for allowed Modules

* Added shell out checks

* Fixed pep8

* Updated regex to only match subprocess.Popen

* Added failing modules to ignore.txt

* Wrong postgresql module in ignore.txt

* Removed bigip from ignore.txt
6 years ago
Abhijeet Kasurde 27b85e732d Argument spec must be dict/hash (#40858)
validate-modules should fail when argument is not dict/hash.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Matt Clay 70c475da6c Implement new changelog generator. 6 years ago
Sam Doran 8746d9ef87 Add guidelines on developing lookup plugins (#38681) 6 years ago
Matt Clay 8d39515914 Remove tab check from validate-modules.
It is redundant with the pycodestyle W191 "indentation contains tabs" check.
6 years ago
Simon fb6ae90f60 Memset: initial module, integration tests, module_utils and supporting documentation. (#40071)
*  * Memset:
   * module_utils and associated documentation.
   * module to manage DNS zones.
   * integration tests to run against Memset's API.

* * memset.py:
  * remove import of requests from memset.py in favour of internal Ansible modules.
  * import necessary Ansible modules for request and response handling.
  * create a response object in order to retain a stable interface to memset_api_call from existing modules.
  * rework memset_api_call to remove requests.
* memset_zone.py:
  * improve short description to be more verbose.
  * ensure all imports directly follow documentation.
  * remove any reference to requests.
  * correct keyerror carried over from elsewhere.

* remove dependency on requests from documentation string

* disable integration tests until we have a cleanup method available
6 years ago
Jon Dufresne 1d640182c6 Update all pypi.python.org URLs to pypi.org (#38988)
For details on the new PyPI, see the blog post:

https://pythoninsider.blogspot.ca/2018/04/new-pypi-launched-legacy-pypi-shutting.html
6 years ago
Ken Celenza e476089bb9 spacing issue (#39884) 6 years ago
Matt Martz 1663b64e18
Allow subspec defaults to be processed when the parent argument is not supplied (#38967)
* Allow subspec defaults to be processed when the parent argument is not supplied

* Allow this to be configurable via apply_defaults on the parent

* Document attributes of arguments in argument_spec

* Switch manageiq_connection to use apply_defaults

* add choices to api_version in argument_spec
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
Alicia Cozine c8a9b411bc
Last docs link fixes (#39391)
* should not need <>, but fails without

* adds anchor to keywords page, uses it on plugins pages

* fixes envvar link errors

* harmonize file name and ref name as python_3

* removes undefined-lable from ignore list
6 years ago
Abhijeet Kasurde 9f1254a32f Typo fix in testing link (#39407)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Alicia Cozine 4b52a54e18 Reduce warnings (#39254)
* removes FAQ links; no entries exist for linked config settings

* fixes various anchors and links

* addresses abadger comments, thanks

* marks orphan pages, avoids TOC errors

* adds links for remote_tmp setting to FAQ
7 years ago
Matt Clay 7975c8fab0
Improve integration-aliases docs. (#39087) 7 years ago
Alicia Cozine 8f83061e70 corrects links to 'list_of' pages (#39161) 7 years ago
Matt Clay c262dbfd30 Use https for links to ansible.com domains. 7 years ago
Alicia Cozine bbfd6c6ab1 Internal refs (#39094)
* fixes community refs

* fixes appendix refs

* fixes scenario refs, keeps ACI guide link to devel

* fixes windows refs

* fixes user guide refs

* fixes dev guide refs
7 years ago
Alicia Cozine 64dcc7def0 Fixes more rST errors (#39042)
* removes include, avoids duplicate label rST warnings

* reduces literal_block errors on playbooks_filters

* addresses TOC errors

* ref error on modules page

* trying ref for list_of_database_modules
7 years ago
Toshio Kuratomi 9faf7b949e Fix places in docs that refer to modules without namespace
We've namespaced all plugin docs.  Change the docs to reflect that
7 years ago
Matt Clay 3d57f45815 Update httptester docs. 7 years ago
Rémy Léone d639d5dc96 Fix typo (#38652)
Typo
+label: docsite_pr
7 years ago
Matt Clay 26fa3adeab Add docs-build sanity test. 7 years ago
Pierre Templier 1e0df01980 Small typos in docs (#38371)
* Small typos in docs

* Use same wording as in porting_guide_2.5.rst
7 years ago
ewubnhn ea9ece8e72 Update spelling_word_choice.rst (#38113)
Added missing format string on "Installer"

 label: docsite_pr
7 years ago
Sam Doran b5b3beff83 Correct syntax highlighting in plugin dev docs (#38184)
Use rst em dash
7 years ago
Matt Martz ffbbb5a25b
Use arg_spec type for comparisons on default and choices (#37741)
* Use arg_spec type for comparisons on default and choices

* Further improve type casting

* Make sure to capture output in more places

* Individually report invalid choices

* Update ignore.txt after resolving merge conflicts
7 years ago
scottb 381359a8f8
Doc build warning/broken link clean-a-palooza (#37382)
* Doc build warning/broken link clean-a-palooza, WIP commit 1.

* Fixed broken anchor

* Fixing additional broken links; converting from doc to ref.

* Fix anchor
7 years ago
Alexander Lex 19f92005b9 Update developing_api.rst (#37108)
Fix for #17716 and #36110
7 years ago
Adam Miller 3fd5b0740e allow ANSIBLE_KEEP_REMOTE_FILES for local test runner (#33357)
* allow ANSIBLE_KEEP_REMOTE_FILES for local test runner
* add ANSIBLE_KEEP_REMOTE_FILES to tox.ini, update docs
* Clarify handling of environment variables.
7 years ago
John R Barker 985f09270d
Ability to link to other pages from plugin docs (#37009)
Support relative links
7 years ago
scottb e7f9c5cc60 Copy edits and tweaks 7 years ago
Brian Coca cf43e0d605 updated api example
- added many more comments
- removed very obsolete 1.x refs
7 years ago
Kevin Breit 487ff1fe9b Fix typos (#36671)
Fix minor typos
7 years ago
Brian Coca 3eff279dd7 updates to module testing (#36043)
* updates to module testing

gives those using internal modules an alternative

* Copy edit
7 years ago
Matt Martz 50adc5409b Add several new doc<->arg_spec checks (#36247)
* Add several new doc<->arg_spec checks. See #18183

* Update ignore.txt for validate-modules
7 years ago
David Newswanger 3f5caf659e added support for --testcase flag in ansible-test (#36134)
* added support for --testcase flag in ansible-test

* fixed command format

* added tab completion

* fixed sanity issues

* added documenation for --testcase

* don't autocomplete when multiple modules are selected
7 years ago
scottb 373b1dcf59
Core Docs Refactor and Redesign (#36067)
* Docs refactor as outlined in https://github.com/ansible/proposals/issues/79. Moves content into 'guides'; refactors TOC; fixes CSS; design tweaks to layout and CSS; fixes generated plugin, CLI and module docs to fix links accodingly; more.

* Adding extra blank line for shippable
7 years ago
Rvgate d5ae63c0ea Change wording of Going Further section (#35949)
* Change wording of Going Further section

The original wording was confusing with its non-devel branch part.
Made it much clearer for people to understand what to do.

Also removed the git command for creating branches, I believe a
develop should be aware of how basic git commands work.

* Edited for concision and clarity.

* Typo fix

* Typo fix
7 years ago
John R Barker c3523cdd60
Test against a single transport (#35903)
Network integration tests can use tags to run only a specific transport
7 years ago
Joshua Smith 0c012703c1 Update developing inventory script docs. (#35639)
* Update developing inventory script docs.

* Copy edit.
7 years ago
Alicia Cozine adf76b7d3f
Reflect new process for network integration tests (#35577)
With `ansible-test network-integration` we don't need the top level yaml files
except NXOS and Dell (for now)
7 years ago
John R Barker a23c95023b
Module deprecation: docs, scheme and tests (#34100)
Enforce module deprecation.
After module has reached the end of it's deprecation cycle we will replace it with a docs stub.

* Replace deprecated modules with docs-only sub
* Use of deprecated past deprecation cycle gives meaningful message (see examples below)
* Enforce documentation.deprecation dict via `schema.py`
* Update `ansible-doc` and web docs to display documentation.deprecation
* Document that structure in `dev_guide`
* Ensure that all modules starting with `_` have a `deprecation:` block
* Ensure `deprecation:` block is only used on modules that start with `_`
* `removed_in` A string which represents when this module needs **deleting**
* CHANGELOG.md and porting_guide_2.5.rst list removed modules as well as alternatives
* CHANGELOG.md links to porting guide index

To ensure that meaningful messages are given to the user if they try to use a module at the end of it's deprecation cycle we enforce the module to contain:
```python
if __name__ == '__main__':
    removed_module()
```
7 years ago
Jordan Borean 4da19f2d6b Added code-smell check to verify filenames are allowed with Windows (#35436) 7 years ago
Matt Clay 7abdab6c9e Convert ansible-test compile into a sanity test. 7 years ago
Matt Clay e0010f15e4 Add pslint sanity test. (#35303)
* Add pslint sanity test.

* Fix `no-smart-quotes` sanity test.

* Add docs for `pslint` sanity test.
7 years ago
Matt Martz 3c400c5899
ANSIBLE_METADATA doesn't support YAML currently, change 315 to invalid data type (#35009) 7 years ago
Matt Martz a352d43824
Compare arg+aliases between docs and argument_spec (#34809)
* compare arg+aliases between docs and argument_spec

* Add some special handling for the network modules provider options that also appear in the top level arg spec

* Fix error code for bigip_hostname

* Address merge conflicts due to changes in f5 modules

* Update validate-modules ignore based off a clean execution

* Address merge conflicts

* Address renamed module

* Address recent changes to modules

* Add ignore for ucs_ip_pool

* Update aci modules to get more reliable documentation comparison, but not mutating the module_utils aci_argument_spec

* Update ignore.txt after recent aci updates

* Add extra guard to ensure we handle provider special only for network modules

* Address additional changes to modules
7 years ago
Alexander Lex 59042d79f5 Update developing_api.rst to use correct inventory format for single explicit host (#34919)
Fix for #34918
7 years ago
Brian Coca bbd6b8bb42 Temporary (#31677)
* allow shells to have per host options, remote_tmp

added language to shell
removed module lang setting from general as  plugins have it now
use get to avoid bad powershell plugin
more resilient tmp discovery, fall back to `pwd`
add shell to docs
fixed options for when frags are only options
added shell set ops in t_e and fixed option frags
normalize tmp dir usag4e

- pass tmpdir/tmp/temp options as env var to commands, making it default for tempfile
- adjusted ansiballz tmpdir
- default local tempfile usage to the configured local tmp
- set env temp in action

add options to powershell
shift temporary to internal envvar/params
ensure tempdir is set if we pass var
ensure basic and url use expected tempdir
ensure localhost uses local tmp
give /var/tmp priority, less perms issues
more consistent tempfile mgmt for ansiballz
made async_dir configurable
better action handling, allow for finally rm tmp
fixed tmp issue and no more tempdir in ballz
hostvarize world readable and admin users
always set shell tempdir
added comment to discourage use of exception/flow control

* Mostly revert expand_user as it's not quite working.

This was an additional feature anyhow.

Kept the use of pwd as a fallback but moved it to a second ssh
connection.  This is not optimal but getting that to work in a single
ssh connection was part of the problem holding this up.

(cherry picked from commit 395b714120522f15e4c90a346f5e8e8d79213aca)

* fixed script and other action plugins

ensure tmpdir deletion
allow for connections that don't support new options (legacy, 3rd party)
fixed tests
7 years ago
jctanner b10d5f34ea Extend validate-modules to check the next to last line (#34819)
* Add validation for the next to last line of a module

* Fix last error code

* Reduce to a single conditional

* Fix conditionals

* Move the final warnings statement to main() in mysql_replication
7 years ago
Matt Martz dcc05093db Validate modules arg spec fixes (#34477)
* Update validate-modules arg_spec introspection to be faster, by only mocking the imports we explicitly list
* The use of types.MethodType in redhat_subscription wasn't py3 compatible, use partial instead
* Remove argument_spec import hacks, make them errors, we can ignore them with ansible-test
* Enable the --arg-spec flag for validate-modules
7 years ago
Samer Deeb f8884f12bc Mellanox OS name change: MLNXOS changed to ONYX (#34753)
* Mellanox OS name change: MLNXOS changed to ONYX

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

* Fix alphabetical order of modules metadata

Signed-off-by: Samer Deeb <samerd@mellanox.com>
7 years ago
Pilou b66863abf0 dev_guide: don't ask to use '© Ansible Project' (#34704)
contributor don't sign any copyright assignment, then this makes no
sense.
7 years ago
osLEccse 9c7d987395 Update developing_api.rst (#34629)
Module path needs to be array instead of a string variable in order to work.
7 years ago
Lars Kellogg-Stedman 29fbf0c756 remove erroneous '.' in docsite footer (#34592)
This removes an erroneous '.' in the docsite that someone pointed out
on irc.
7 years ago
Pilou 6a6f5129a9 dev_guide: fix a slip (#34143)
replace 'Formatting options' with 'Formatting functions'
7 years ago
Matt Martz 57575d1cfa
Fix tests as filters #4 (#33930)
* Resolve newly added tests as filters

* Add code smell to test for ansible provided jinja tests as filters syntax

* Add docs for no-tests-as-filters code smell test

* Address tests as filters in new integration tests

* Address feedback

* Address feedback 2
7 years ago