ansible/test/integration
Alex Tsitsimpis c3ab6cb9b1 template: Add option to lstrip_blocks' and fix settingtrim_blocks` inline (#37478)
* template: Add integration tests for `lstrip_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Fix passing `trim_blocks' inline

Fix passing `trim_blocks' option to the template module as inline
argument. Previously passing the `trim_blocks' option inline instead of
using the YAML dictionary format resulted in it always being set to
`True', even if `trim_blocks=False' was used.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add option to `lstrip_blocks'

Add option to set `lstrip_blocks' when using the template module to
render Jinja templates. The Jinja documentation suggests that
`trim_blocks' and `lstrip_blocks' is a great combination and the
template module already provides an option for `trim_blocks'.

Note that although `trim_blocks' in Ansible is enabled by default since
version 2.4, in order to avoid breaking things keep `lstrip_blocks'
disabled by default. Maybe in a future version it could be enabled by
default.

This seems to address issue #10725 in a more appropriate way than the
suggested.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Add integration tests for `trim_blocks'

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>

* template: Check Jinja2 support for `lstrip_blocks'

Since the `lstrip_blocks' option was added in Jinja2 version 2.7, raise
an exception when `lstrip_blocks' is set but Jinja2 does not support it.
Check support for `lstrip_blocks' option by checking `jinja2.defaults'
for `LSTRIP_BLOCKS' and do not use `jinja2.__version__' because the
latter is set to `unknown' in some cases, perhaps due to bug in
`pkg_resources' in Python 2.6.6.

Also update option description to state that Jinja2 version >=2.7 is
required.

Signed-off-by: Alex Tsitsimpis <alextsi@arrikto.com>
2018-03-23 12:05:21 -04:00
..
group_vars Added support for new Ansible Infra (network_cli plugin, cliconf, module utils cleanup and test) for dellos10 Support t (#34915) 2018-01-25 12:37:27 +00:00
host_vars Simplify Windows versions in ansible-test. 2018-01-17 16:16:15 -08:00
roles Added support for new Ansible Infra (network_cli plugin, cliconf, module utils cleanup and test) for dellos10 Support t (#34915) 2018-01-25 12:37:27 +00:00
targets template: Add option to lstrip_blocks' and fix settingtrim_blocks` inline (#37478) 2018-03-23 12:05:21 -04:00
cloud-config-aws.yml.template
cloud-config-azure.yml.template
cloud-config-cs.ini.template
cloud-config-gcp.yml.template [cloud] New GCP module: DNS Managed Zones (gcp_dns_managed_zone.py) (#35014) 2018-02-06 11:50:16 -05:00
cloud-config-openshift.kubeconfig.template Initial OpenShift integration test support. (#36207) 2018-02-14 13:39:42 -08:00
cloud-config-tower.cfg.template Initial Tower module integration test support. 2018-03-07 14:21:55 -08:00
dellos6.yaml
dellos9.yaml
dellos10.yaml Added support for new Ansible Infra (network_cli plugin, cliconf, module utils cleanup and test) for dellos10 Support t (#34915) 2018-01-25 12:37:27 +00:00
integration.cfg
integration_config.yml Fix pip integration test. 2018-01-31 23:26:16 -08:00
inventory ACI: Support validate_certs, use_ssl and use_proxy (#35146) 2018-01-21 00:38:20 +01:00
inventory.networking.template Reflect new process for network integration tests (#35577) 2018-01-31 14:56:28 -06:00
inventory.remote.template
inventory.winrm.template
network-integration.cfg
nxos.yaml Module deprecation: docs, scheme and tests (#34100) 2018-01-30 12:23:52 +00:00
target-prefixes.network ACI: Make network testing work out-of-the-box (#35116) 2018-01-20 02:47:28 +01:00
windows-integration.cfg