Commit Graph

52 Commits (6ba4f04f45a3d896d0f835669e16b25279ab5430)

Author SHA1 Message Date
Alicia Cozine 860cacc54f Docs: User guide overhaul, part 2 (#65474) 5 years ago
Evgeni Golov 3af1732bd8 fix rendering of GOOD/BAD code for regex_replace examples (#65654)
adds double colon (::) so the examples render as code
5 years ago
Sam Doran 21bbf49396 Mention Python builtin methods in filter docs (#65425) 5 years ago
Niklas Liechti 39ebd244e3 Update playbooks_filters.rst (#64769) 5 years ago
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.
5 years ago
Pierre Prinetti 2444fae208 Add a named parameter to the filter to_uuid (#64057)
Let the caller choose a namespace for `to_uuid` and document the
behaviour of both the default case, and the new explicit case.

This PR does not change the existing behaviour of the `to_uuid` UUIDv5
filter.
5 years ago
Andreas Olsson c8315bfd60 Prefer https:// links in the docs site (#62939)
This is a follow-up of last year's 1a11cec. It deals with links which
at that point either were not present or did not support https://.
5 years ago
Michael Prokop b33ae14949 doc: fix typos (#62852) 5 years ago
Mark Chesney 11be31db71 Fix naming discrepancy in zip filter example (#60918)
Fix naming discrepancy in zip filter example
5 years ago
Strahinja Kustudic 6131de29d4 Improve regex_replace filter docs (#57450)
* Add a few examples of how to correctly use `regex_replace` filter
because it behaves differently on different Python versions when using
regex qualifiers that can match an empty string (e.g. '*', '?', etc).
5 years ago
Sandra McCann c06f890f55 add docs for vlan_parser filter (#57498) 5 years ago
Ilya Reshetnikov bf0e846a39 Update playbooks_filters.rst (#57200)
* Update playbooks_filters.rst to show JSON in the "JSON Query Filter" example data structure
5 years ago
s-hamann 730456b402 Add seed parameter to random_mac filter (#51841) 5 years ago
James Cassell e55e8fe2c4 regex_escape: support POSIX basic regex (#50327) 6 years ago
Andrii Radyk 07cff73719 Fix yaml indentation for from_yaml_all filter example (#51998) 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
branen 88029a73d6 Correct docsite typos: it's -> its (#50812) 6 years ago
Satyajit Bulage 13d94ed681 Update filter documentation (#50255)
Added documentation for following filters -

* Product
* human_readable
* human_to_bytes

Signed-off-by: Satyajit Bulage <sbulage@redhat.com>
6 years ago
Brian Coca b0c28f86de Revert range change (#50155)
* Revert "Fix incorrect examples with random filter (#50137)"

This reverts commit 9a7dbd5213.

The correction is incomplete and also based on a 'fix' that was supposed to have been reverted already

* Revert "Added `+1` to the `end` in `random` filter so that it was inclusive (#27215)"

This reverts commit ea2b89c7ae.

reverted fix as agreed at the time, but missed by maintainers.
6 years ago
Dmitry Lihachev 9a7dbd5213 Fix incorrect examples with random filter (#50137) 6 years ago
Martin Krizek 79947245e2 docs: remove not implemented password_hash feature (#49945) 6 years ago
Will Thames 960ebd981f k8s append_hash (#48830)
* Add append_hash functionality to k8s module

append_hash adds a hash based on the contents of a ConfigMap
or Secret to the name - this enables immutable ConfigMaps and
Secrets.

* Provide k8s_config_resource_name plugin

The k8s_config_resource_name filter plugin provides a means of determining
the name of ConfigMaps and Secrets created with append_hash

* Add changelog fragment

* fix failing tests

* Update openshift version needed for append_hash
6 years ago
Rushan cc5b9c5fe1 enchance yaml filter documentation (#46629)
* update to_*_yaml filter documentation

* update to*_yaml filter documentation
6 years ago
Risto Oikarinen e1cfc2500c Clean playbook filters doc by adding whitespaces (#46569) 6 years ago
Dag Wieers 92037679c4 Fix subelements example correctly (#46482) 6 years ago
Andrew Paradi 641c569a20 Fix spelling error in subelements Filter example (#46446)
<!--- Your description here -->

+label: docsite_pr
6 years ago
Deric Crago 065b7ac300 moved 'strftime' filter into 'Other Useful Filters' section (#45801) 6 years ago
Peter Sprygada 1e68881c40 adds support for null values to the ternary filter (#45303)
* adds support for null values to the ternary filter

This change adds a third optional argument to the ternary filter to
handle a null value.  If the third option is specified null and false
are treated differently.

For instance, take the following example:

{{ enabled | ternary('no shutdown', 'shutdown') }}

If enabled == True, then 'no shutdown' is used.
If enabled in (False, None), then 'shutdown' is used.

With this change the following is possible:

{{ enabled | ternary('no shutdown', 'shutdown', omit) }}

If enabled == True, then 'no shutdown'
If enabled == False, then 'shutdown'
If enabled == None, then omit

* update documentation with example of filter

* update filter documentation example per comments

* fix logic error in user_guide example
6 years ago
Raymond Wanyoike c41632fad2 Add the key_name/value_name options to the dict2items filter (#45550)
* Add the key_name/value_name options to dict2items - as with items2dict, allow users to configure the key/value name for dict2items, add "version added" and examples
6 years ago
FloMiau e35c4be1c1 Change "Defaulting Undefined Variables" (#41379)
Rewording the text for the second parameter of default because the original text was misunderstandable. +label: docsite_pr
6 years ago
Matthias Fuchs 7871027c9d Share the implementation of hashing for both vars_prompt and password_hash (#21215)
* Share the implementation of hashing for both vars_prompt and password_hash.
* vars_prompt with encrypt does not require passlib for the algorithms
  supported by crypt.
* Additional checks ensure that there is always a result.
  This works around issues in the crypt.crypt python function that returns
  None for algorithms it does not know.
  Some modules (like user module) interprets None as no password at all,
  which is misleading.
* The password_hash filter supports all parameters of passlib.
  This allows users to provide a rounds parameter, fixing #15326.
* password_hash is not restricted to the subset provided by crypt.crypt,
  fixing one half of #17266.
* Updated documentation fixes other half of #17266.
* password_hash does not hard-code the salt-length, which fixes bcrypt
  in connection with passlib.
  bcrypt requires a salt with length 22, which fixes #25347
* Salts are only generated by ansible when using crypt.crypt.
  Otherwise passlib generates them.
* Avoids deprecated functionality of passlib with newer library versions.
* When no rounds are specified for sha256/sha256_crypt and sha512/sha512_crypt
  always uses the default values used by crypt, i.e. 5000 rounds.
  Before when installed passlibs' defaults were used.
  passlib changes its defaults with newer library versions, leading to non
  idempotent behavior.

  NOTE: This will lead to the recalculation of existing hashes generated
        with passlib and without a rounds parameter.
        Yet henceforth the hashes will remain the same.
        No matter the installed passlib version.
        Making these hashes idempotent.

Fixes #15326
Fixes #17266
Fixes #25347 except bcrypt still uses 2a, instead of the suggested 2b.

* random_salt is solely handled by encrypt.py.
  There is no _random_salt function there anymore.
  Also the test moved to test_encrypt.py.
* Uses pytest.skip when passlib is not available, instead of a silent return.
* More checks are executed when passlib is not available.

* Moves tests that require passlib into their own test-function.

* Uses the six library to reraise the exception.

* Fixes integration test.

When no rounds are provided the defaults of crypt are used.
In that case the rounds are not part of the resulting MCF output.
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
Fabian von Feilitzsch d27de6acd9 Add from_yaml_all to support multi document yaml strings (#43037)
* Support multi-doc yaml in the from_yaml filter

* Most automatic method of handling multidoc

* Only use safe_load_all

* Implement separate filter

* Update plugin docs and changelog
6 years ago
Chris Smolen 1e2b332001 Update the regex_findall example (#43052)
<!--- Your description here -->
The example has:
`{{ 'Some DNS servers are 8.8.8.8 and 8.8.4.4' | regex_findall('\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b') }}`

It needs be double backslashes to escape the backslashes:
`{{ 'Some DNS servers are 8.8.8.8 and 8.8.4.4' | regex_findall('\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}\\b') }}`
+label: docsite_pr
6 years ago
Sam Doran 7b0dea45e9 Update JSON Query filter examples (#42432)
* Update JSON Query filter examples

Correct syntax on one example
Add more examples of escaping
Change example to show joining list to string
6 years ago
Matt Martz aea396f04b
Add items2dict filter that is the reverse of dict2items (#42071)
* Add items2dict filter that is the reverse of dict2items

* Address feedback about type checking, and add docs for zip/zip_longest
6 years ago
Olivier Bourdon 06b73ff8f1 Add random_mac string filter (#39775)
Add new filter to generate random MAC addresses from
string prefix. See docs/docsite/rst/user_guide/playbooks_filters.rst
for more detailed infos.
6 years ago
zharalim d52ea9518d Update playbooks_filters.rst (#41628)
Add an example on how to use regexp_replace to modify list items.

+label: docsite_pr

Fix typo
6 years ago
Harri Hämäläinen 8dcb6c288c Document capability of giving regex search flags (#39893) 6 years ago
Matt Martz a5f05c6fc2 [WIP] Start of subelements filter (#39829)
* Start of subelements filter

* Add docs for subelements filter
6 years ago
Alexandre Chaussier e493891d08 Fix flatten filter documentation 6 years ago
Ewoud Kohl van Wijngaarden e4efc191c5 Fix code snippet in playbook filters doc (#39798) 6 years ago
Elias 7f5820274f Update call method for parse_cli_textfsm (#38437)
+label: docsite_pr
6 years ago
Jordan Borean fc210a4584
base64 filter: Added ability to specify encoding (#39714)
* base64 filter: Added ability to specify encoding

* Added unicode chars for further testing

* Removed errors to keep previous behaviour in place

* Removed surrogate pairs due to issues loading YAML in CI
6 years ago
Julien Palard ab4cbfd5d3 FIX: Removing superfluous bloc wrongly introduced in 2b7799f817. (#39723) 6 years ago
Brian Coca b533ebe20d
remove slice docs (#37946) 6 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
Martin Krizek 8173602a34
Add expandvars jinja2 filter (#38805)
* Add expandvars jinja2 filter

* Add docs

* Minor edit
7 years ago
Will Thames a8953fcac4 Add documentation on dict2items (#38375)
dict2items is worth mentioning in the filters and loops pages
(the latter as it's useful to replace `with_dict`)

Update some nearby broken links
7 years ago
Owen Kuemerle ba4f26313b Correct method to get timedelta seconds value (#37485)
* Correct method to get timedelta seconds value

This also adds additional clarification for extracting different time/date values for time deltas

* Small edit
7 years ago