title: Ansible templating yaml inside a task
body: <p>i am using the <em>lxd_container</em> module to create some lxd containers. One of these containers should include in its configuration the line <strong>security.nesting: "true"</strong>. I can't template this configuration since it is controlled by the lxc tool.
  I need something like :</p>
  
  <blockquote>
    <p>{% if item.0 == "gitlab" %} security.nesting: true {% endif %}</p>
  </blockquote>
  
  <pre><code>- name: Creating  containers
    lxd_container:
      name: "{{item.0}}"
      state: started
      source:
        type: image
        mode: pull
        server: https://cloud-images.ubuntu.com/releases
        protocol: simplestreams
        alias: 18.04/amd64
      profiles: ["default"]
      config:
        security.nesting: true // only if item.0 == gitlab
        user.network-config: |-
          version: 1
          config:
            - type: physical
              name: eth0
              subnets:
                - type: static
                  ipv4: true
                  address: "{{ item.1 }}"
                  netmask: 255.255.255.0
                  gateway: "{{ CONT_GATEWAY }}"
                  control: auto
      timeout: 7000
    with_together: 
    - "{{ CONT_NAME }}"
    - "{{ CONT_IP_ADRESS }}"
  </code></pre>
  
  <p>how could i achieve  this in one task ?</p>