i am using the lxd_container module to create some lxd containers. One of these containers should include in its configuration the line security.nesting: "true". I can't template this configuration since it is controlled by the lxc tool. I need something like :
{% if item.0 == "gitlab" %} security.nesting: true {% endif %}
- 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 }}"
how could i achieve this in one task ?