Commit Graph

71 Commits (0cf4aabc55ad8408a0332ae2b5b02ec551db3bb4)

Author SHA1 Message Date
Abhijeet Kasurde 0a7ab396c7
filters: minor doc fix (#71178)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 years ago
Baptiste Mille-Mathias 8c48366f1c
Document to_json will convert to ASCII strings by default (#70954)
... as reported in issue #68702
4 years ago
Fixmetal 7a42d27462
Proper example for splitext filter in docs (#70494)
* Update playbooks_filters.rst with a clear example of how to extract its 2 tokens. 

Co-authored-by: Sloane Hertel <shertel@redhat.com>
4 years ago
Alicia Cozine db354c0300
Docs: User guide overhaul, part 5 (#70307) 4 years ago
FloMiau f7db428375
update documentation link to python 3 (#70509)
update the docs link for strftime on the filters page to point to the python3 docs
4 years ago
David Shrewsbury 4e41e37aa7
Fix flatten null perserve versionadded (#70435) 4 years ago
Brian Coca 7a15a3a109
fix flatten handling of nulls/nones (#70141)
* fix flatten loop control issue (break -> continue)

fix issue #69012

(cherry picked from commit 2127be5ec5)

* fixed null break bug and added option to include

 fixes #69012
 fixes #69013

Co-authored-by: pseudocoder <borisovano@users.noreply.github.com>
Co-authored-by: David Shrewsbury <Shrews@users.noreply.github.com>
4 years ago
Alicia Cozine c89f3cda9e
incorporate minimalism feedback on filters page (#70366)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
4 years ago
Gonéri Le Bouder b491f776b9
doc: avoid mix of single and double quotes (#70115)
Avoid mix of single and double quotes in the `ternary`, this way
we can copy/past the example without any surprise.
4 years ago
Westley Argentum Hennigh-Palermo 5885ed4455
remove gendered example (#70117)
Changed example to not assume things about names and genders
4 years ago
Alicia Cozine 6fffb0607b WIP: Docs: User guide overhaul, part 4 (#69266)
Co-authored-by: Alicia Cozine <acozine@users.noreply.github.com>
4 years ago
Sandra McCann 44a4538280
add FQCN for migrated filters (#69321) 4 years ago
Christophe Drevet-Droguet e867535a57
regex_replace multiline support (#65051)
* document multiline parameter for regex_replace
* add changelog fragment
* tests for regex_replace_multiline
5 years ago
Jordan Borean 423a900791
Clarify b64encode with Python 2 (#67488) 5 years ago
tchernomax 53e043b5fe
combine filter: fine list handling (option b) (#57894) 5 years ago
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
5 years ago
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>
5 years ago
Anthony Bourguignon d3e9ef3c35 add a path_join filter which joins path components (#62713) 5 years ago
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.
5 years ago
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