1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/lib/ansible/utils
Feanil Patel 0abcebf1e4 Don't convert numbers and booleans to strings.
Before this change if a variable was of type int or bool and the variable was referenced
by another variable, the type would change to string.

eg. defaults/main.yml
```
PORT: 4567
OTHER_CONFIG:
  secret1: "so_secret"
  secret2: "even_more_secret"

CONFIG:
  hostname: "some_hostname"
  port: "{{ PORT }}"
  secrets: "{{ OTHER_CONFIG }}"
```

If you output `CONFIG` to json or yaml, the port would get represented in the output as a
string instead of as a number, but secrets would get represented as a dictionary.  This is
a mis-match in behaviour where some "types" are retained and others are not.  This change
should fix the issue.

Update template test to also test var retainment.

Make the template changes in v2.
Update to only short-circuit for booleans and numbers.

Added an entry to the changelog.
2015-04-11 12:03:42 -04:00
..
module_docs_fragments fixed minor issues with openstack docs not being valid yaml 2015-04-02 21:08:17 -04:00
__init__.py Fix assert to work with unicode values 2015-03-25 12:24:49 -07:00
cmd_functions.py Fixes #3973 Second Revision of live ansible-pull output 2014-01-10 11:18:02 -05:00
display_functions.py Moving display-related functions to new module in utils 2014-04-30 15:33:46 -05:00
hashing.py Move the hashing util functions to their own file to mirror v2 2015-02-02 10:25:09 -08:00
module_docs.py ansible-doc now shows return value docs 2015-02-19 13:18:05 -05:00
plugins.py Merge pull request #9293 from cchurch/module_suffixes 2015-02-26 23:33:51 -05:00
string_functions.py Allow isprintable() util function to work with unicode 2014-04-03 15:29:51 -05:00
su_prompts.py make su promt AIX compatible 2015-02-10 05:18:37 -05:00
template.py Don't convert numbers and booleans to strings. 2015-04-11 12:03:42 -04:00
unicode.py Didn't port isbasestring/isunicodestring from kitchen so switch to isinstance 2015-02-12 13:55:27 -08:00
vault.py Set proper permissions for ansible-vault view 2015-02-11 14:15:38 +01:00