Apologies if it wasn't clear.
So it's a playbook that create an inventory file from a template for
kolla-ansible so it can install Openstack.

here is the playbook

---
- name: TEMPLATES
  file:
      path: "{{ deploy_env }}/my_envs/openstack/{{ deploy_env }}"
      state: directory
      mode: 0755

- name: Create inventory file from a template
  template:
      src: templates/osk_inventory.j2
      dest: "{{ deploy_env }}/my_envs/openstack/{{ deploy_env
}}/osk_inventory_{{ deploy_env }}"
      owner: root
      group: root


On Sat, May 9, 2020 at 3:55 PM Alfredo De Luca <[email protected]>
wrote:

> Hi all.
> I have ansible 2.9.7 running on ubuntu. I am just running some test and
> one is to create an inventory by a template.
> All good except when I use the template it says
>
>
> *fatal: [instance]: FAILED! => {"changed": false, "msg":
> "AnsibleUndefinedVariable: 'network_interface' is undefined"}*
>
> Now here is the inventory.j2 snip
>
> <SNIP>
> [control]
> {{ osk_nodes.split(',')[0] }}
>
> [compute]
> {% for node_ip in osk_nodes.split(',') %}
> {{node_ip}}
> {% endfor %}
>
> [all:vars]
> *network_interface=eno1*
> <SNIP>
>
> Not sure why it keep saying undefined variable. where I specifically set
> the network_interface to eno1.
>
> Any ideas/suggestions?
> Cheers
>
>
>
>
> --
> */Alfredo*
>
>

-- 
*/Alfredo*

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAAWpFTFzh%2B_sJf8vBU%3DKga-M6MwyXOcH8pxVDL-9xn4rmqneig%40mail.gmail.com.

Reply via email to