ansible/docs/docsite/rst/user_guide
Sam Doran f506fd4730
Add ansible-galaxy collection list command (#65022)
* Start adding ansible-galaxy collection list options

* Working list all collections and list a specific collection

* Nuke debugging cruft

* Use to_text to get a string of the FQCN for sorting

* Improve collection output formatting

- add header
- display collection name and version in separate columns
- width of columns is dynamic based on collection name and version length

* Make role list output match collection output list

- add header
- add columns for role name and version
- make column width dynamic based on name and version length

* remove debug statemnt and extra header

* Revert "Make role list output match collection output list"

This reverts commit a0b3db47bb3b198aafd34c1f1be5b6561af2f928.

* Add validate_collection_path function

Utility function for ensuring a collection target ends with 'ansible_collection'

* Use validate_collection_path

* Do not warn if a specific collection in found in any search path

* Fix extraneous warning and remove duplicate code

Do not warn when listing a specific collection and it does not exist
in other collection paths.

Restructure the code that loops through collection paths to remove
duplicate conditional code.

* Indicate role path was found

* Use new function name

* WIP Save Point

* Use separate functions for role and collection list

* Wrap error message

There may be a better way to do this besides hard coding a line break, but this
does make the message a lot more readable.

* Add validate_collection_path function (#66441)

* Add validate_collection_path function

Utility function for ensuring a collection target ends with 'ansible_collection'

* Fix bad syntax

* Correct docstring

* Bikeshed the names

* Properly list a single role

* Simplify _display_warnings()

Only display warnings. Move exception raise back to each caller.

* Move private methods to private functions

They don't need self, so it makes sense to have them as functions
Get rid of _display_warnings() function since it doesn't do anything worthy of
an independent function.

* Add integration tests for ansible-galaxy collection list

* Fix docs sanity test

* Fix bug where ansible_collections dir does not exist

The path may exist, but if there is no ansible_collections dir inside that path,
an exception was raised in find_existing_collections().

Add integration test for this scenario

* Put execute_list() method back

* Add some informational messages for debugging

* Add unit tests

Units tests for the various private methods in support of collection list

* Start adding unit tests for test_execute_list

* Display collection path when listing specific collection

* Add unit tests for listing all collections and specific collection

- Create fixture for creating test objects
- Add function for controlling os.path.isdir results

* Set defaults for minimum collection widths

Ensure that collections with small FQCNs display correctly.
Add unit tests

* Split up unit tests and fix fixtures

Add more fixtures for mocking objects during the specific collection tests

* Change help message for -p in list subcommand

Give accurate description of what it actually does rather than trying to use language shared between sub commands.

* Disable colorized output in unit test

* Add docs for collection list

* Fix integration test on macOS

The temp file path is really long on macOS, so the warning message gets wrapped
across multiple lines. That make seth grep fail. Switch to matching on a smaller
part of the warning.

* Recreate common path options for collections

Improve help about what the '-p' option does and how it works.

* Remove unnecessary elif after continue statements

* Account for duplicate paths in collections_searh_paths

If someone specifies the same path via '-p' that is the COLLECTIONS_PATHS,
do not list the collections twice.

* Docs updates
2020-02-14 14:00:00 -06:00
..
shared_snippets Add docs detailing how to convert many with_X style loops to use loop and filters (#40964) 2018-06-01 10:37:21 -04:00
basic_concepts.rst Docs: User guide overhaul, part 1 (#63056) 2019-10-08 13:46:38 -04:00
become.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
collections_using.rst Add ansible-galaxy collection list command (#65022) 2020-02-14 14:00:00 -06:00
command_line_tools.rst Docs: User guide overhaul, part 1 (#63056) 2019-10-08 13:46:38 -04:00
connection_details.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
guide_rolling_upgrade.rst Docs: User guide overhaul, part 1 (#63056) 2019-10-08 13:46:38 -04:00
index.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
intro.rst Remove more docs build errors (#45364) 2018-09-11 17:51:47 +01:00
intro_adhoc.rst Docs: User guide overhaul, part 1 (#63056) 2019-10-08 13:46:38 -04:00
intro_bsd.rst docs: Prefer python3 on OpenBSD (#65447) 2019-12-10 09:05:18 -05:00
intro_dynamic_inventory.rst Docs: User guide overhaul, part 1 (#63056) 2019-10-08 13:46:38 -04:00
intro_getting_started.rst Fix list formatting in Getting Started docs page (#65713) 2019-12-12 16:52:52 -06:00
intro_inventory.rst Slash missing from /etc/ (#67220) 2020-02-10 14:07:22 -05:00
intro_patterns.rst Update intro_patterns.rst (#67151) 2020-02-11 11:52:00 -06:00
intro_windows.rst removes last :doc: links in user guide (#58433) 2019-06-26 17:07:27 -04:00
modules.rst removes last :doc: links in user guide (#58433) 2019-06-26 17:07:27 -04:00
modules_intro.rst Docs: User guide overhaul, part 1 (#63056) 2019-10-08 13:46:38 -04:00
modules_support.rst fixed some broken links (#66182) 2020-01-06 10:24:07 -06:00
playbook_pathing.rst doc(user_guide): fix typos (#47425) 2018-10-24 12:01:24 -04:00
playbooks.rst Docs: User Guide overhaul, part 3 (#66371) 2020-01-21 16:57:55 -05:00
playbooks_advanced_syntax.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
playbooks_async.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
playbooks_best_practices.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
playbooks_blocks.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
playbooks_checkmode.rst fix syntax issue (#65166) 2019-11-25 15:01:10 +00:00
playbooks_conditionals.rst Add (more) explicit references to Jinja2 docs in conditionals doc (#61814) 2020-02-14 10:53:14 -05:00
playbooks_debugger.rst Fix a tiny typo (#66589) 2020-01-18 10:35:31 +05:30
playbooks_delegation.rst Update indentation used in the code examples, unify empty lines (#65874) 2019-12-16 11:26:25 -06:00
playbooks_environment.rst [Fix] Typo in playbooks_environment.rst (#64496) 2019-11-06 17:31:16 +05:30
playbooks_error_handling.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
playbooks_filters.rst combine filter: fine list handling (option b) (#57894) 2020-02-12 16:40:36 -05:00
playbooks_filters_ipaddr.rst playbooks_filters_ipaddr.rst: fix syntax, indentation (#65208) 2019-11-25 15:00:15 -05:00
playbooks_intro.rst Fix indentation (#66991) 2020-02-03 12:30:12 -05:00
playbooks_lookups.rst "with in" changed to "within" (#54990) 2019-04-08 11:25:03 -05:00
playbooks_loops.rst loop: simplify dict2items example in docs (#66235) 2020-01-07 10:32:46 -05:00
playbooks_module_defaults.rst Add module_defaults group for ovirt (#64377) 2019-11-05 12:30:41 +05:30
playbooks_prompts.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
playbooks_python_version.rst Upstream jinja has decided not to rename from jinja2. (#66880) 2020-01-30 10:57:50 -05:00
playbooks_reuse.rst Docs: User Guide overhaul, part 3 (#66371) 2020-01-21 16:57:55 -05:00
playbooks_reuse_includes.rst Docs: User Guide overhaul, part 3 (#66371) 2020-01-21 16:57:55 -05:00
playbooks_reuse_roles.rst Add library in role directory structure (#67030) 2020-02-11 14:30:59 -06:00
playbooks_roles.rst removes last :doc: links in user guide (#58433) 2019-06-26 17:07:27 -04:00
playbooks_special_topics.rst clarifies FAQ answer about env vars (#48432) 2018-11-09 14:31:29 -05:00
playbooks_startnstep.rst
playbooks_strategies.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
playbooks_tags.rst all: fix all the the duplicate words (#66784) 2020-01-28 14:06:40 -05:00
playbooks_templating.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
playbooks_tests.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
playbooks_variables.rst Mention role defaults file (#67153) 2020-02-11 11:50:16 -06:00
playbooks_vault.rst clarify vault warning and fix typo (#64419) 2019-11-04 17:47:03 -06:00
plugin_filtering_config.rst Update plugin filter documentation (#46665) 2018-10-29 15:04:32 -04:00
quickstart.rst link from quickstart page to Network Getting Started (#65150) 2019-11-21 11:42:57 -05:00
sample_setup.rst Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
vault.rst Updated "Speeding up Vault Operations" section (#57701) 2019-06-14 10:17:40 -04:00
windows.rst Windows Setup doc; offer 10x perf improvement (#58259) 2019-07-30 15:53:17 -04:00
windows_dsc.rst fixed some broken links (#66182) 2020-01-06 10:24:07 -06:00
windows_faq.rst Deprecate Windows 2008, and 2008 R2 (#66257) 2020-01-14 11:22:39 +10:00
windows_performance.rst Windows Setup doc; offer 10x perf improvement (#58259) 2019-07-30 15:53:17 -04:00
windows_setup.rst remove the word "support" from Windows pages, add Windows Server 2019 (#61404) 2019-08-28 08:05:12 +10:00
windows_usage.rst Prefer https:// links in the docs site (#62939) 2019-09-30 15:11:19 -04:00
windows_winrm.rst Fixes #65590 add pywinrm version explanation (#65591) 2020-01-16 08:22:38 +10:00