# template not expanding on Ubuntu 12.04 target host

**URL:** <https://forum.ansible.com/t/template-not-expanding-on-ubuntu-12-04-target-host/25417>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [September 6, 2017, 12:34pm UTC](https://forum.ansible.com/t/template-not-expanding-on-ubuntu-12-04-target-host/25417 "2017-09-06T12:34:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seb.stark](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@seb.stark](https://forum.ansible.com/u/seb.stark)\
**Post date:** [September 6, 2017, 12:34pm UTC](https://forum.ansible.com/t/template-not-expanding-on-ubuntu-12-04-target-host/25417/1 "2017-09-06T12:34:08Z")

</div>

Why would the following template not expand (instead it is copied verbatim) on an Ubuntu 12.04 host, while it expands alright on a similar 16.04 host? Client is ansible 2.3.1.0.

`

> cat templates/etc/security/access.conf.j2

# {{ ansible\_managed }}

{% for current\_scope in access\_scope %}  
{% for scope\_current\_content in access\_scope\_types[current\_scope] %}  
{{scope\_current\_content}}  
{% endfor %}  
{% endfor %}  
-:ALL:ALL  
`

The corresponding action is:

`

- name: Restrict access through pam  
action: template src=etc/security/access.conf.j2 dest=/etc/security/access.conf mode=0644  
tags:
- access
- restrict  
`

There is no error message, nor anything enlightening when I add -vvv.

I know I already posted when I had a very similar problem before, but I do not see the connection, as last time the issue was when moving the client to another Ubuntu version. This time only the template changed.

Thanks,  
Sebastian

---

<div class="post-metadata">

**Author:** ![seb.stark](https://avatars.discourse-cdn.com/v4/letter/s/e9c0ed/32.png) [@seb.stark](https://forum.ansible.com/u/seb.stark)\
**Post date:** [September 11, 2017, 1:26pm UTC](https://forum.ansible.com/t/template-not-expanding-on-ubuntu-12-04-target-host/25417/2 "2017-09-11T13:26:29Z")

</div>

Turns out I was stupid and forget to change a host variable (“access\_scope”) from a plain string to a list of strings. Is there a recommended way to check in a template that a variable is not only set but has the right type?
