Commit graph

399 commits

Author SHA1 Message Date
Christophe Drevet-Droguet
e867535a57
regex_replace multiline support (#65051)
* document multiline parameter for regex_replace
* add changelog fragment
* tests for regex_replace_multiline
2020-02-19 12:19:40 -05:00
John R Barker
4844adff9a
Collection developer guide - BOTMETA (#67538)
* Docs: Improve how to migrate and create collections
* Update docs/docsite/rst/dev_guide/developing_collections.rst

Co-Authored-By: Alicia Cozine <879121+acozine@users.noreply.github.com>
2020-02-19 10:11:38 -06:00
Geoffrey Purdy
82ca00e4fe
Update windows_faq.rst (#67482)
Steers users around the error:  Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/xmltodict.py'
Consider using the `--user` option or check the permissions. -->
2020-02-17 13:38:46 -06:00
Jordan Borean
423a900791
Clarify b64encode with Python 2 (#67488) 2020-02-17 13:31:03 -06:00
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
Ken Dreyer
0485ce9d12
docs: fix path to roles' meta/main.yml file (#67408) 2020-02-14 11:10:33 -05:00
Carsten Rösnick-Neugebauer
b625b430f1
Add (more) explicit references to Jinja2 docs in conditionals doc (#61814)
Co-authored-by: Sandra McCann <samccann@redhat.com>
2020-02-14 10:53:14 -05:00
Sloane Hertel
97f011cf94
Add verify subcommand to 'ansible-galaxy collection' (#65618)
* [WIP] Add verify subcommand command to 'ansible-galaxy collection'

* Fix pep8 and use consistent display order

* WIP - docs

* Remove some redundancy in verify display messages by using an error queue for each collection

* Share common code and improve output format

* clean up documentation

* typo

* Apply suggestions from code review

Co-Authored-By: Sandra McCann <samccann@redhat.com>

* Move ModifiedContent namedtuple to the global scope

Add a public metadata property

Rename function to _get_json_from_tar_file

* Add some unit tests

* fix using common functions after rebase

* changelog

* Improve efficiency finding specific installed collections

Improve efficiency by only downloading the tar.gz from the galaxy server for comparison after checking that the collection has been installed

Handle multiple collection paths

Fix up tests

* pep8

* reword that for accuracy

* use more common code and verify collection name

* Improve error message and add documentation

* Update unit tests and add coverage for both local and remote collections that are unable to be located

* Only validate collections using the format collection_namespace.collection_name

Fix tests to reflect that

Fix documentation

* Fix a bug when a local collection does not contain a file

* pep8

* Fix formatting

Co-authored-by: Sandra McCann <samccann@redhat.com>
2020-02-14 08:57:04 -06:00
tchernomax
53e043b5fe
combine filter: fine list handling (option b) (#57894) 2020-02-12 16:40:36 -05:00
Jonas DOREL
29edcdcf5b
Add library in role directory structure (#67030)
* Add library directory to the list of directories in a role
2020-02-11 14:30:59 -06:00
Sriviswajth
070f946745
Update intro_patterns.rst (#67151)
Removed extra quotes from example.
2020-02-11 11:52:00 -06:00
Alex Humphreys
01a6e1c2c9
Mention role defaults file (#67153)
Add info on where role defaults are set; matches the entry for role variables.
2020-02-11 11:50:16 -06:00
JP Mens
585e79942c
Slash missing from /etc/ (#67220) 2020-02-10 14:07:22 -05:00
Ilias Trichopoulos
d6f2b4e788
Fix indentation (#66991) 2020-02-03 12:30:12 -05:00
Sam Doran
c8568a5c94
Add documentation about vars used in roles at the play level (#66907) 2020-01-30 11:08:24 -05:00
Toshio Kuratomi
4273e84962
Upstream jinja has decided not to rename from jinja2. (#66880)
So we're going to keep our intersphinx labels as jinja2 to match what
upstream is doing
2020-01-30 10:57:50 -05:00
Eitan Adler
86663abf37 all: fix all the the duplicate words (#66784) 2020-01-28 14:06:40 -05:00
Toshio Kuratomi
14cc63dc0f Switch intersphinx label from jinja2 to jinja (#66703)
* Switch intersphinx label from jinja2 to jinja

Co-Authored-By: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
2020-01-23 14:09:17 -05:00
Alicia Cozine
cb8ce7159d Docs: clarify that roles do not inherit collections set in a playbook (#66667)
Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
Co-authored-by: Sandra McCann <samccann@redhat.com>
2020-01-22 15:08:38 -05:00
Alicia Cozine
0b503f6057 Docs: User Guide overhaul, part 3 (#66371) 2020-01-21 16:57:55 -05:00
Walter Sosa
875ac4b7a5 Fix a tiny typo (#66589)
Fixes a very small typo: as --> a in playbook_debuggers.rst
2020-01-18 10:35:31 +05:30
hiyokotaisa
3bcb664497 Fixes #65590 add pywinrm version explanation (#65591)
* add pywinrm version explanation

* Update windows_winrm.rst

Changed pywinrm explanation to note style

* Add period

Co-authored-by: Jordan Borean <jborean93@gmail.com>
2020-01-16 08:22:38 +10:00
Jordan Borean
6f04f87a13
Deprecate Windows 2008, and 2008 R2 (#66257)
* Deprecate Windows 2008, and 2008 R2

* Remove shippable nodes

* Update windows_faq.rst

Be less specific about 2008/R2 timeframes

* Update setup.ps1

tweak warning text

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
2020-01-14 11:22:39 +10:00
林博仁(Buo-ren Lin)
011e0176c2 Clarify the advantage include* statement brought regarding looping (#66022)
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
2020-01-11 11:09:51 -05:00
Abhijeet Kasurde
469f104ec2 loop: simplify dict2items example in docs (#66235)
* Added a simple example to explain "dict2items" filters for better understading.

Fixes: #65505

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-07 10:32:46 -05:00
Anthony Bourguignon
d3e9ef3c35 add a path_join filter which joins path components (#62713) 2020-01-06 11:56:40 -05:00
Sandra McCann
80dff8743a fixed some broken links (#66182) 2020-01-06 10:24:07 -06:00
Lars Kellogg-Stedman
f85d9d7028 Correct rst syntax in playbooks_filters.rst (#66198)
The `regex_replace` documentation included an example that was meant
to be preformatted text but due to an indentation error was rendering
incorrectly.
2020-01-06 10:13:21 -06:00
Wojciech Sciesinski
aacc2d1a18 Update indentation used in the code examples, unify empty lines (#65874) 2019-12-16 11:26:25 -06:00
Steve Leonard
af1c788ba7 Fix list formatting in Getting Started docs page (#65713) 2019-12-12 16:52:52 -06:00
Mossroy
c3c1708dea Fix variable name in an example (#65760)
Makes the variable name consistent between the example code (`myname`) and the text below (mentioning a variable called `name`) in the docs.
2019-12-12 16:51:47 -06:00
Sandra McCann
9c30325704 fixed some link nits (#65772) 2019-12-12 13:20:08 -06:00
Alicia Cozine
860cacc54f Docs: User guide overhaul, part 2 (#65474) 2019-12-12 13:35:17 -05:00
Wojciech Sciesinski
95aef88a45 Update indentation used in the code examples, unify empty lines (#65346) 2019-12-10 10:55:51 -05:00
Evgeni Golov
3af1732bd8 fix rendering of GOOD/BAD code for regex_replace examples (#65654)
adds double colon (::) so the examples render as code
2019-12-10 08:49:38 -06:00
Jasper Lievisse Adriaanse
53cd0bdd29 docs: Prefer python3 on OpenBSD (#65447) 2019-12-10 09:05:18 -05:00
Sam Doran
21bbf49396 Mention Python builtin methods in filter docs (#65425) 2019-12-02 09:44:59 -06:00
林博仁(Buo-ren Lin)
8ebc57c186 Mention that Python keywords are invalid Ansible variable names (#65094)
* Mention that Python keywords are invalid Ansible variable names
Using a Python keyword as a variable name triggers the error `Invalid variable name in 'register' specified: 'return'`.
2019-12-02 09:42:40 -06:00
Niklas Liechti
39ebd244e3 Update playbooks_filters.rst (#64769) 2019-11-26 13:39:12 -05:00
Andrew Schultz
756ac826fe Improve ignore_unreachable documentation (#64938) 2019-11-26 13:35:02 -05:00
Kenyon Ralph
a797802d27 playbooks_filters_ipaddr.rst: fix syntax, indentation (#65208) 2019-11-25 15:00:15 -05:00
Sam Doran
0471ed3731 Add docs clarifying behavior of retry files (#65153) 2019-11-25 14:26:46 -05:00
gaoruifeng
f9f7a0c60e fix syntax issue (#65166)
- can disabled  
+ can be disabled
2019-11-25 15:01:10 +00:00
Alicia Cozine
b0c8e7926f link from quickstart page to Network Getting Started (#65150) 2019-11-21 11:42:57 -05:00
Baptiste Mille-Mathias
e65be0beee Put all files and Path filters under a specific section (#64913)
Many of the filters in the "other useful filters" list manipulate filenames and paths; add a heading and put them together.
2019-11-19 12:30:56 -06:00
Sandra McCann
a01376a493 update configuring ansible-galaxy client (#64796)
* update configuring ansible-galaxy client, deduplicate, clarify tokens, AH procedures, etc.
2019-11-15 09:49:51 -06:00
Robert de Bock
f17a55a181 Add advice how to prevent jinja2 warning (#60594)
* Add advice how to prevent jinja2 warning

##### SUMMARY
This addition helps users to demonstrate how to prevent `[WARNING]: when statements should not include jinja2 templating delimiters`.


##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr

* Update playbooks_tests.rst

* Update playbooks_tests.rst

Refer to the advised FAQ about when to use `{{ }}`.
2019-11-14 14:36:05 +00:00
Vincent Bernat
bf19060683 ipaddr: add an option to return peer of a point-to-point link (#59144)
* ipaddr: add an option to return peer of a point-to-point link

Signed-off-by: Vincent Bernat <vincent@bernat.ch>

* ipaddr: extend "peer" to also work with /30
2019-11-13 13:47:05 -05:00
James Cassell
a7f90df0e9 Document match/search tests (#64775)
* clarify `search` vs `match` tests

* string test docs: fix rst formatting
2019-11-13 11:14:10 -06:00
Sorin Sbarnea
7ea1db89d3 Documents storage of task files (#62345) 2019-11-08 16:23:33 -05:00