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.
* Elminates a lot of logic in the AnsibleComposer class.
* Update tests with new column offsets. The rule should now be
consistently: Column is the start of the entry's value (so for
strings, the first non-space after the entry beginning, for dicts, the
first character of the first key)
* Changes AnsibleConstructor so that only unicode strings are returned
(no str type)
* Tracks line, column numbers for strings
* Adds unittests for AnsibleLoader (generic for all the yaml parsing)
The rest of ansible uses validate_certs, so make that the main
documented parameter. However, leave verify as an alias since that's the
passthrough value to the underlying libraries.
* Do backslash escape parsing in parse_kv() [was being done in the copy
module purely for newlines in the copy module's content param before]
* Make parse_kv always return unicode
* Add bandaid to transform args to unicode until we can fix things
calling parse_kv to always send it unicode.
* Make split_args deal with unicode internally. Warning, no bandaid for
things calling split_args without giving it unicode (shouldn't matter
as dealt with str internally before)
* Fix copy and unarchive action plugins to not use setdefaultencoding
* Remove escaping from copy (it was broken and made content into latin-1
sometimes). escaping is now in parse_kv.
* Expect that content is now a unicode string so transform to bytes just
before writing to the file.
* Add initial unittests for split_args and parse_kv. 4 failing
tests.because split_args is injecting extra newlines.