Commit Graph

82 Commits (b6566d26dfe768857d75041552885fcdbd7dbd2a)

Author SHA1 Message Date
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
scottb 381359a8f8
Doc build warning/broken link clean-a-palooza (#37382)
* Doc build warning/broken link clean-a-palooza, WIP commit 1.

* Fixed broken anchor

* Fixing additional broken links; converting from doc to ref.

* Fix anchor
7 years ago
scottb 373b1dcf59
Core Docs Refactor and Redesign (#36067)
* Docs refactor as outlined in https://github.com/ansible/proposals/issues/79. Moves content into 'guides'; refactors TOC; fixes CSS; design tweaks to layout and CSS; fixes generated plugin, CLI and module docs to fix links accodingly; more.

* Adding extra blank line for shippable
7 years ago