Commit Graph

390 Commits (eac7fa186088bbcb82c1914b124cfb93d9436202)

Author SHA1 Message Date
Matt Clay 5a50fb35df Add sanity test for obsolete files.
This will help prevent accidental merging of content to recently obsoleted directories when adding new files.

It may also help contributors who have modified obsolete files understand where their changes should now be made.
5 years ago
Jeff Geerling 1405e48157 Fix documentation for collection build code example (#60156) 5 years ago
Matt Clay df59f06d6a
Additional ansible-test path fixes. (#60300)
* Add missing ansible-test injector symlink.
* More ansible-test path fixes.
* Expand bin-symlinks docs.
5 years ago
Matt Clay 39b3fc0926 Update ansible-test layout and payload handling. 5 years ago
Sandra McCann ed21aba442 add link to content collector tool (#59881) 5 years ago
Matt Clay a93a0c8fd6
Relocate validate-modules for easier testing. (#60214)
* Relocate module validator code and tests.
* Fix validate-modules entry point and imports.
* Fix paths and test entry points.
* Fix up unit tests.
* Fix shebang and execute bit.
5 years ago
Matt Clay 18867847f4
Split up "code smell" sanity tests. (#60174)
* Relocate ansible-only sanity tests.

* Get "code smell" sanity tests from multiple dirs.

- `test/lib/ansible_test/_data/sanity/code-smell/` - General purpose tests used for both Ansible and Ansible Collections.
- `test/sanity/code-smell/` - Tests specific to Ansible, will not be used for Ansible Collections.
5 years ago
Matt Clay d651bda123
Relocate ansible-test code. (#60147)
* Initial move of `test/runner/` content.

`test/runner/lib/` -> `test/lib/ansible_test/_internal/`
`test/runner/`     -> `test/lib/ansible_test/_internal/data/`

* Initial move of `test/sanity/` content.

`test/sanity/` -> `test/lib/ansible_test/_internal/data/sanity/` (except `test/sanity/ignore.txt`)

* Initial move of `test/units/pytest/` content.

`test/units/pytest/` -> `test/lib/ansible_test/_internal/data/pytest/`

* Follow-up move of `test/runner/unit/` content.

`test/lib/ansible_test/_internal/data/unit/` -> `test/lib/ansible_test/tests/unit/`

* Initial move of `ansible.cfg` content.

`test/units/ansible.cfg` -> `test/lib/ansible_test/_internal/data/units/ansible.cfg`
`test/env/ansible.cfg` -> `test/lib/ansible_test/_internal/data/env/ansible.cfg`

* Follow-up move of `data` directory.

`test/lib/ansible_test/_internal/data/` -> `test/lib/ansible_test/_data/`

* Update import statements.

* Add missing __init__.py for unit tests.

* Fix path references and miscellaneous issues.
5 years ago
Matt Clay 71e607dceb
Update docs references for ansible-test. (#60109)
* Remove outdated info from azure-requirements docs.
* Correct validate-modules usage.
5 years ago
Matt Clay 2be2ae366e Remove obsolete docs on pep8 sanity test. 5 years ago
Sandra McCann 9aa3130cd1
clarify what a namespace is or is not (#59809) 5 years ago
Ganesh Nalawade 127bd67f6e
Render elements in module doc and sanity test for sub-options (#59244)
* Render elements in module doc and sanity test for suboptions

*  Add support to render module elements value in ansible-doc output
   module html
*  Add validate-module sanity test of sunoptions.

* Add current validate module failures to ignore list

* Fix CI failure

* fix rebase conflict

* Fix CI issues

* Fix review comments

* Add validate-modules failure in ignore list
5 years ago
Sandra McCann fe3459ef86 add module_utils example (#59661)
* add module_utils example to collections docs
5 years ago
Sandra McCann 30c1d9754d Style end edit changes to collections doc (#59658)
* copy-edit of file
5 years ago
Matt Clay b4494fa547 Remove redundant "Sanity Tests »" from page title.
The docs now have multi-level breadcrumbs so including "Sanity Tests »" in the title on a sanity test page is redundant.
5 years ago
Matt Clay 5ed469f6b7 Fix sanity docs page titles.
The titles are used to generate the index of sanity tests, so they should match the name of the test.
5 years ago
Gonéri Le Bouder 964783fbd2 vmware_guest: speed up vmware_guest tests
- Use predictable VM name during the tests (test_vm1, test_vm2 and
  test_vm2). This to simplify the teardown of the newly created resource
  before the next test.
- Update the documentation to explain the new requirement
- Avoid VM creation with `with_items` when it's not mandatory. This to:
    - speed up the test execution, our hypervisors have limited resources
    - simplify the teardown
- Remove `create_d1_c1_f0_env.yml`, the test was just testing how Ansible
  pass environment variables.
- Correct the name for the `f0` variable (`f1`)
- Fix the DVS tests, the hosts can now reach the dvswitch1 vswitch
- Provision the VM with a poweroff status, this to improve the
  idempotency and sleep up the tests
- Avoid the use of `prepare_vmware_tests` to prepare virtual machines
  when we just need one machine
5 years ago
Matt Clay db7e9aa051
Use consolidated ignore.txt in ansible-test. (#59618) 5 years ago
Jordan Borean 9551528ba0 Replace Mazer references with ansible-galaxy (#59487)
* Replace Mazer references with ansible-galaxy
5 years ago
Matt Martz 95f4282c42
Verify package data in setup.py installs all files (#59537)
* Add sanity test to ensure all non-py files are installed

* Fix mode and regex

* Fix role skel inventory package_data

* Add docs

* Update package_data for inventory files

* Address pylint concerns

* Another tweak to package_data

* Address review feedback

* Change index to 1

* add to ansible-only.txt
5 years ago
Sandra McCann cb1dd6d77b remove molecule mentions (#59441) 5 years ago
Jordan Borean 65049620ee
Generate galaxy.yml based on single source of truth (#59170)
* Generate galaxy.yml based on single source of truth

* Fix up tests and align file names

* Minor Makefile tweak

* Remove link in galaxy.yml file and make it a template file

* Moved collections docs to dev_guide

* change Makefile clean path

* Added readme to example meta file

* review fixes

* Use newer style for doc generation script

* Fix mistake in dev_guide index

* removed uneeded file, fixed links and added preview banner

* Moved banner for sanity test
5 years ago
Tomáš Pospíšek 28b9f71640 remove ambiguity: use "my_test" as module name (#59335)
Naming a module "something_module" is misleading (see below). Let's drop the "_module" part of the module name on the developing_modules_general page.
5 years ago
Rémy Léone 30206d3066 Add an example for the debugging module (#50197)
+label: docsite_pr
5 years ago
Toshio Kuratomi 33d2728879 Rename python files in hacking/ directory to have .py suffix
ansible-test only passes files which have the .py suffix for sanity
tests on python files.  This change will allow sanity tests to run on
the Python files in hacking/

* Rename test-module to test-module.py
* Symlink test-module for backwards compat since end users may be using
  test-module
* Fix test-module sanity errors that are now triggered
* Rename ansible_profile to ansible-profile.py
* Rename build-ansible
5 years ago
Toshio Kuratomi 146a7f8ff6 Split the metaclass == type and from future boilerplate code.
The metaclass boilerplate is safe to apply en masse.  The future import
boilerplate needs code to be inspected to be sure that there aren't any
py2isms that need to be fixed.  Split these two checks so that we can
fix them independently

Be explicit about which files are grandfathered so we can fix them up one by one
5 years ago
Gonéri Le Bouder 13de8686e5 vmware: vmware_guidelines.rst
VMware specific documentation that explains:

- how to run the functional tests
- and the conventions.
- clarify the difference between govcsim and vcsim

Co-Authored-By: Alicia Cozine <879121+acozine@users.noreply.github.com>
Co-Authored-By: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Alicia Cozine 3fc0694ffc removes last :doc: links in the dev guide (#58417) 5 years ago
Sandra McCann 5569135efd create scenario guide template file (#58212)
* create scenario guide template file

* Apply suggestions from code review

Co-Authored-By: Alicia Cozine <879121+acozine@users.noreply.github.com>
5 years ago
ndclt 4376e88849 Coherence between example and text (use of to_native) (#58279) 5 years ago
Sandra McCann 7765bd41e6 add platform docs to network dev guide (#57960)
* add info on how to create platform docs to network dev guide
5 years ago
Ken Celenza 1a63f8642e Update local module options (#57553)
* Docs: Point out that local plugins can be loaded based on ansible.cfg settings
5 years ago
Pierre-Louis Bonicoli c289006e05 validate-modules: new module: fail if 'type' isn't documented
Don't require 'type' when:
- parameter name starts with an underscore
5 years ago
Sandra McCann 5243cba0b2 describe how to link to modules or plugins (#57806) 5 years ago
Bill Nottingham c493593b4b Adjust assorted terminology and wording around product offerings. (#57242)
* Adjust assorted terminology and wording around product offerings.

* Update docs/docsite/rst/dev_guide/style_guide/trademarks.rst
* Update docs/docsite/rst/user_guide/modules_support.rst
* Update docs/docsite/rst/reference_appendices/tower.rst
5 years ago
Sam Doran 50b1a66649 Update instructions for running module directly (#56883)
The internals of AnsiballZ changed silghtly
5 years ago
Felix Fontein 53ec9c8019 Clarify that GPLv3+ module_utils need core team approval (#56740)
* Clarify that GPLv3+ module_utils need core team approval.

* Update docs/docsite/rst/dev_guide/shared_snippets/licensing.txt

Co-Authored-By: Sam Doran <sdoran@redhat.com>

* More 'module_util' -> 'file in module_utils'.
5 years ago
Felix Fontein abca3f1956 Clarify documentation on _info vs. _facts modules (#56611)
* Clarify documentation on _info vs. _facts modules.

* Expand with examples for facts and non-facts.
5 years ago
Alicia Cozine 118cf3ece6
Cloud dev docs to rst (#56485)
* Moves developer docs for AWS, ovirt, and openstack modules out of lib/ansible/, integrates them with dev_guide, with abadger's fix to make python snippets pass rstcheck
5 years ago
Matt Clay f9b56a5b56 Add sanity test to check for unwanted files. 5 years ago
Alicia Cozine 3c8d8b1509 should have gone into 52373 (#56306) 5 years ago
Dag Wieers eac7f1fb58 dev_guide: Various small updates (#53273)
* Document the clarifications that I usually remark when doing reviews
* Update docs/docsite/rst/dev_guide/developing_modules_documenting.rst

Co-Authored-By: dagwieers <dag@wieers.com>
5 years ago
Toshio Kuratomi edafa71f42 Developer documentation update involving module invocation (#55747)
* Update docs for the 2.7 change to AnsiballZ which invokes modules with one
  less Python interpreter

* Add a section on how module results are returned and on trust between modules, action plugins, and the executor.

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

Co-Authored-By: abadger <a.badger@gmail.com>
5 years ago
Mark Zhitomirski b14f477bee docsite: correct path, list requirements for testing module docs, etc. (#52008)
* dev_guide: correct path, list requirements, etc.; module HTML docs are in '_build/html/module' subdir
5 years ago
Alicia Cozine 8542459b95
Docs: edits & expands module_utils & search path info in dev guide (#55931)
* Update docs/docsite/rst/dev_guide/developing_module_utilities.rst
5 years ago
Alicia Cozine 9d5b5d7ddd
correct description of modules vs plugins (#55784) 5 years ago
Sandra McCann cca365061c
add how to create HttpApi plugins for network modules (#54340)
* initial port over from gdoc

* crosslink httpapi pages

* Add some examples?

* Add quick example of using Connection

* Fix indentation of python code blocks

* moved to a full developer guide for networks

* Try to clarify some examples

* Fix typos

How did I even do that?
5 years ago
Gregor Dschung 158452661a Correct link to Thomas' GitHub account (#55587)
Thomas renamed his account from tstringer to trstringer
5 years ago
Alicia Cozine d7f6493084 adds better links to tips and pitfalls page (#55458) 6 years ago
Matt Martz 9f83139dcb
Don't register tests as filters (#55332)
* Don't register tests as filters. Fixes #55319

* Remove tests for deprecated functionality

* Remove no-tests-as-filters sanity tests

* Remove docs too

* Revert "Remove docs too"

This reverts commit 7daf457a74.

* Make no-tests-as-filters doc an orphan
6 years ago
Kevin Breit 521e62aa38 Update set_module_args in unit test docs (#55244)
* Update docs/docsite/rst/dev_guide/testing_units_modules.rst
`set_unit_args()` should be imported and used in the unit test documentation. 

Co-Authored-By: kbreit <kevin.breit@kevinbreit.net>
6 years ago
Kevin Breit a005dcfbbd Add example for full path on unit tests (#55243)
Docs: adds an example when a full path is needed for unit tests, with module_utils, etc.
6 years ago
Abhijeet Kasurde 3003954415 Update unit testing docs (#55272)
* Updated links
* Updated indentation
* Fixed typos

Fixes: #55242

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Sandeep Kasargod e1c4ee2514 New module for managing volumes in Vexata storage arrays (#49006)
* Initial commit for module to manage Vexata storage volumes + fixes form code review in pr #47091.

* Fix indent errors reported by lint.

* Refactor, implement code review changes

* Moved doc fragment file to new layout

* Added explicit types for all module parameters, updated copyrights + raw string for block text.
6 years ago
ximon18 7474e39c37 Rewrote one awkward sentence. (#54892)
Rewrote awkward sentence in the developing inventory guide.

+label: docsite_pr
6 years ago
Daniel Hagan e114d06801 Minor formatting fix in developing_modules_documenting.rst (#54785)
* developing_modules_documenting.rst - fix formatting error

* developing_modules_documenting.rst - remove errant whitespace from last commit
6 years ago
dthvt ea2fa07e23 AnsibleModule uses supports_check_mode (#54629)
<!--- Your description here -->

Looks like AnsibleModule uses supports_check_mode, not check_mode.

+label: docsite_pr
6 years ago
Brian Coca 6f77dbf66f update _facts and _info in checklist (#54182)
* update _facts and _info in checklist in docs/docsite/rst/dev_guide/developing_modules_checklist.rst

Co-Authored-By: bcoca <bcoca@users.noreply.github.com>
6 years ago
Matt Clay 39bbadb2fd
Replace no-underscore-variable test with pylint. (#54140)
* Replace no-underscore-variable test with pylint.
* Update orphan handling for sanity test docs.
* Update command for listing tests.
6 years ago
Jill R 3e670373e0 Add returned keys to example module (#53884) 6 years ago
Abhijeet Kasurde 9018819023
Update Testing page for OS version (#53800)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
David Passante 40af4a144d Update an example in documentation fields (#53760)
According to the `Linking within module documentation` section, the right syntax should be `I(state=present)`.
6 years ago
Gonéri Le Bouder 6421e89e23 docs: refresh testing_integration.rst (#53338)
* docs: refresh testing_integration.rst

Ensures the examples can be run:
- fedora25 is not available anymore, use fedora29 instead
- the posix/ci alias does not exist anymore, use shippable/posix/ instead
- explain how to list the target without argcomplete

* ansible-test should be in $PATH
* call ansible-runner from bin/, not test/runner
* we don't use credentials.template anymore, we use a collection of .template files.
* low-case bash bc we refresh to name of the binary
* refresh the command of Windows-CI example
* Update docs/docsite/rst/dev_guide/testing_integration.rst

Co-Authored-By: goneri <goneri@lebouder.net>
6 years ago
Brian Coca c0a4cf297d add '_facts' rule to module checklist (#53359)
* add '_facts' rule to module checklist

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

Co-Authored-By: bcoca <bcoca@users.noreply.github.com>
6 years ago
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