Use of Nested Variables

355 views
Skip to first unread message

Jeremey Wise

unread,
Feb 16, 2021, 8:24:43 AM2/16/21
to ansible...@googlegroups.com
# Goal:  When playbook / task is called.. use varibles set for specific host withing a group
/hosts.yml # site wide master ansible inentory
all:
  children:
###### Physical HyperConverge Server Devices for environment ###########
    hci_hosts: # Nodes for hosting VMs
      hosts:
        thor:
          vars:
            mgmt_nic: enp8s0f0 # Set in Kickstart OS install
            storage_nic: ens15f0
            ovs_nic: enp8s0f1
            ovirt_disk: ata-Samsung_SSD_850_PRO_512GB_S250NXAGA15787L # ls -al /dev/disk/by-id/ |grep sdb
            data00_disk: ata-WDC_WDS100T2B0B-00YS70_192490801828 # ls -al /dev/disk/by-id/ |grep sdc
            data01_disk: ata-WDC_WDS100T2B0B-00YS70_19106A802926 # ls -al /dev/disk/by-id/ |grep sdd
       odin:
          vars:
            mgmt_nic: enp8s0f0 # Set in Kickstart OS install
            storage_nic: ens15f0
            ovirt_disk: ata-Micron_1100_MTFDDAV512TBN_17401F699137 # ls -al /dev/disk/by-id/ |grep sdb
            data00_disk: ata-WDC_WDS100T2B0B-00YS70_183533804564 # ls -al /dev/disk/by-id/ |grep sdc
            data01_disk: nvme-nvme.126f-4141303030303030303030303030303032343538-53504343204d2e32205043496520535344-00000001 # ls -al /dev/disk/by-id/ |grep nvme0n1
<snip>...
       
       
    ####  Task:  setup host networking and disk.. where each host is different .. so have to set individulized varibles
    ---
# Configuration of unified /etc/hosts file for nodes
# v0.002 20210131
# file: /roles/role_network_hosts.yml
# <<<<<<<<<DRAFT>>>>>>>>>>>

- name: Copy a version of hosts file common for nodes to ignite cluster
  ansible.builtin.copy:
    src: hosts_ignition_template
    dest: /etc/hosts
    group: root
    setype: named_conf_t
    mode: 0644
### Test varible and precidence order
- debug:
    msg: "{{ inventory_hostname }} this should be hostname response of thor"

- debug:
    msg: "{{ ansible_default_ipv4.gateway }} this should be gateway this shoudld be response of 172.16.100.1"

- debug:
    msg: "{{ inventory_hostname[storage_nic] }} this should be NIC of thor for storage"

- debug:
    msg: "{{ storage_nic }} this should be NIC of thor for storage"
- debug:
    msg: "{{ ovirt_disk }} this likely will fail as it should be host ovirtdisk"


############### Test output
$ ansible-playbook hci_deploy.yml --limit thor

PLAY [Ansible Pinging Host which validates SSH passwordless login] *******************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************ok: [thor]

TASK [hci_cluster : Copy a version of hosts file common for nodes to ignite cluster] *************************************************************************************ok: [thor]

TASK [hci_cluster : debug] ***********************************************************************************************************************************************ok: [thor] =>
  msg: thor this should be hostname response of thor

TASK [hci_cluster : debug] ***********************************************************************************************************************************************ok: [thor] =>
  msg: 172.16.100.1 this should be gateway this shoudld be response of 172.16.100.1

TASK [hci_cluster : debug] ***********************************************************************************************************************************************fatal: [thor]: FAILED! =>
  msg: |-
    The task includes an option with an undefined variable. The error was: ansible.parsing.yaml.objects.AnsibleUnicode object has no element AnsibleUndefined
 
    The error appears to be in '/mnt/c/GitHub/penguinpages_cluster_devops/cluster_devops/roles/task_network_hosts.yml': line 43, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.
 
    The offending line appears to be:
 
 
    - debug:
      ^ here

PLAY RECAP ***************************************************************************************************************************************************************thor                       : ok=4    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0


#######################

Summary:  any variable caleld which is "nested" does not work.

Question:  How can I use a "host variable" nested. so when I call a playbook for a group, each host specific task can use common variables within sub routines

--

Jeremey Wise

unread,
Feb 17, 2021, 8:36:54 AM2/17/21
to Ansible Project

Any idea or help here


But for above example:

- debug:  # this works to set variable for storage interface https://docs.ansible.com/ansible/latest/collections/community/general/nmcli_module.html
    msg: "'{{ inventory_hostname }}s' this should be hostname with s added such as thors"
- debug: 
    msg: "{{ inventory_hostname }} this should be hostname response of thor"
- debug: 
    msg: "{{ inventory_hostname.storage_nic }} this should be response of ens15f0"
- debug: 
    msg: "{{ ansible_facts.storage_nic }} I guess if ansible_fact is a special ansible variable...this should be hostname response of ens15f0"


<< output>
/cluster_devops$ ansible-playbook hci_deploy.yml --limit thor

PLAY [Ansible Pinging Host which validates SSH passwordless login] *******************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************ok: [thor]

TASK [hci_cluster : Copy a version of hosts file common for nodes to ignite cluster] *************************************************************************************ok: [thor]

TASK [hci_cluster : debug] ***********************************************************************************************************************************************ok: [thor] => 
  msg: '''thors'' this should be hostname with s added such as thors'

TASK [hci_cluster : debug] ***********************************************************************************************************************************************ok: [thor] => 
  msg: thor this should be hostname response of thor

TASK [hci_cluster : debug] ***********************************************************************************************************************************************fatal: [thor]: FAILED! => 
  msg: |-
    The task includes an option with an undefined variable. The error was: 'ansible.parsing.yaml.objects.AnsibleUnicode object' has no attribute 'storage_nic'
  
    The error appears to be in '/mnt/c/GitHub/penguinpages_cluster_devops/cluster_devops/roles/task_network_hosts.yml': line 63, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.
  
    The offending line appears to be:
  
        msg: "{{ inventory_hostname }} this should be hostname response of thor"
    - debug:
      ^ here

PLAY RECAP ***************************************************************************************************************************************************************thor                       : ok=4    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Stefan Hornburg (Racke)

unread,
Feb 17, 2021, 9:07:20 AM2/17/21
to ansible...@googlegroups.com
On 2/17/21 2:36 PM, Jeremey Wise wrote:
>
> Any idea or help here
>
> I see this concept is
> valid.https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#referencing-nested-variables 
>
> But for above example:
>
> - debug:  # this works to set variable for storage interface https://docs.ansible.com/ansible/latest/collections/community/general/nmcli_module.html
>     msg: "'{{ inventory_hostname }}s' this should be hostname with s added such as thors"
> - debug: 
>     msg: "{{ inventory_hostname }} this should be hostname response of thor"
> - debug: 
>     msg: "{{ inventory_hostname.storage_nic }} this should be response of ens15f0"
> - debug: 
>     msg: "{{ ansible_facts.storage_nic }} I guess if ansible_fact is a special ansible variable...this should be hostname response of ens15f0"
>
>

You don't show the task which uses nmlci_module and provides storage_nic information.

inventory_hostname.storage_nic is totally bogus as a string can't be a nested variable.

Regards
Racke
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c02e59f8-dd9b-4a4d-a42f-101775323580n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/c02e59f8-dd9b-4a4d-a42f-101775323580n%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

OpenPGP_signature

Jeremey Wise

unread,
Feb 17, 2021, 9:55:47 AM2/17/21
to Ansible Project

Well. I was trying to keep it simple and just validate the variable call was valid before trying to use it in a task.

But task would be something along lines of:
- name: Get server storage IP address from /etc/hosts
  command: "grep '{{ inventory_hostname }}s' /etc/hosts | awk '{ print $1 }'"
  register: storage_ip

- task:  # Set Storage IP for host
  nmci:  
  ipaddress: {{storage_ip}}
  interface: {{ inventory_hostname.storage_nic }}
  mask: 24
  mtu: 9000

That is the hope it will work.

Stefan Hornburg (Racke)

unread,
Feb 17, 2021, 10:04:30 AM2/17/21
to ansible...@googlegroups.com
On 2/17/21 3:55 PM, Jeremey Wise wrote:
>
> Well. I was trying to keep it simple and just validate the variable call was valid before trying to use it in a task.
>
> But task would be something along lines of:
> - name: Get server storage IP address from /etc/hosts
>   command: "grep '{{ inventory_hostname }}s' /etc/hosts | awk '{ print $1 }'"
>   register: storage_ip
>

So the result of the command is stored in the variable storage_ip and the output of the command
is stored in storage_ip.stdout (as string) and storage_ip.stdout_lines (list of output lines).

To show the result:

debug:
var: storage_ip

> - task:  # Set Storage IP for host
>   nmci:  
>   ipaddress: {{storage_ip}}
>   interface: {{ inventory_hostname.storage_nic }}
>   mask: 24
>   mtu: 9000
>

So ipaddress might be {{ storage_ip.stdout }}

Regards
Racke
> <https://groups.google.com/d/msgid/ansible-project/c02e59f8-dd9b-4a4d-a42f-101775323580n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/c02e59f8-dd9b-4a4d-a42f-101775323580n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/029deda6-f9e9-46e3-9267-1c7d48369b68n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/029deda6-f9e9-46e3-9267-1c7d48369b68n%40googlegroups.com?utm_medium=email&utm_source=footer>.
OpenPGP_signature

Jeremey Wise

unread,
Feb 17, 2021, 10:45:10 AM2/17/21
to Ansible Project

My issue is not getting the variable set of "storage_ip"   

But that I have to define variables in the global inventory file.. That are unique to each host.

And when I run a playbook and it needs those variables..  how do I get them.

Ex:

When I want to   run a playbook for group "hci_cluster"   which then runs on three hosts..

First host is "thor"
It has its 10Gb storage NIC  as enp8s0f1

so when the playbook is running. use variable   "hci_cluster-> thor->storage_nic"  to know to bind ip to enp8s0f1

But how do I use a nested variable ?

Stefan Hornburg (Racke)

unread,
Feb 17, 2021, 11:05:32 AM2/17/21
to ansible...@googlegroups.com
On 2/17/21 4:45 PM, Jeremey Wise wrote:
>
> My issue is not getting the variable set of "storage_ip"   
>
> But that I have to define variables in the global inventory file.. That are unique to each host.
>
> And when I run a playbook and it needs those variables..  how do I get them.
>
> Ex:
>
> When I want to   run a playbook for group "hci_cluster"   which then runs on three hosts..
>
> First host is "thor"
> It has its 10Gb storage NIC  as enp8s0f1
>
> so when the playbook is running. use variable   "hci_cluster-> thor->storage_nic"  to know to bind ip to enp8s0f1
>
> But how do I use a nested variable ?

You don't need it. It should be present as "storage_nic" variable given your inventory:

hosts:
thor:
vars:
mgmt_nic: enp8s0f0 # Set in Kickstart OS install
storage_nic: ens15f0
ovs_nic: enp8s0f1

So please try to use {{ storage_nic }}.

Regards
Racke
> <https://groups.google.com/d/msgid/ansible-project/029deda6-f9e9-46e3-9267-1c7d48369b68n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/029deda6-f9e9-46e3-9267-1c7d48369b68n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/de027285-7089-4bdb-bd11-24f516a9a7d1n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/de027285-7089-4bdb-bd11-24f516a9a7d1n%40googlegroups.com?utm_medium=email&utm_source=footer>.
OpenPGP_signature

Jeremey Wise

unread,
Feb 17, 2021, 1:03:53 PM2/17/21
to Ansible Project
I 100% agree with you. If I set a host variable ... that should be read and take precedence from what I am reading.

....but that in lies the issue.. it does not work....


##########################################################
### Inventory structure: /hosts.yml

all:
  children:
###### Physical HyperConverge Server Devices for environment ###########
    hci_hosts: # Nodes for hosting VMs
      hosts:
        thor:
          vars:
            mgmt_nic: enp8s0f0 # Set in Kickstart OS install
            storage_nic: ens15f0
            ovs_nic: enp8s0f1
            storage_ip: 172.16.101.101
            ovirt_disk: ata-Samsung_SSD_850_PRO_512GB_S250NXAGA15787L # ls -al /dev/disk/by-id/ |grep sdb 
            data00_disk: ata-WDC_WDS100T2B0B-00YS70_192490801828 # ls -al /dev/disk/by-id/ |grep sdc
            data01_disk: ata-WDC_WDS100T2B0B-00YS70_19106A802926 # ls -al /dev/disk/by-id/ |grep sdd
        odin:
          vars:
            mgmt_nic: enp8s0f0 # Set in Kickstart OS install
            storage_nic: enp7s0f1
            ovs_nic: enp8s0f1
            storage_ip: 172.16.101.102
            ovirt_disk: ata-Micron_1100_MTFDDAV512TBN_17401F699137 # ls -al /dev/disk/by-id/ |grep sdb 
            data00_disk: ata-WDC_WDS100T2B0B-00YS70_183533804564 # ls -al /dev/disk/by-id/ |grep sdc
            data01_disk: nvme-nvme.126f-4141303030303030303030303030303032343538-53504343204d2e32205043496520535344-00000001 # ls -al /dev/disk/by-id/ |grep nvme0n1
        medusa:
          vars:
            mgmt_nic: enp7s0 # Set in Kickstart OS install
            storage_nic: enp3s0f0
            ovs_nic: enp3s0f2
            storage_ip: 172.16.101.102
            ovirt_disk: ata-SAMSUNG_SSD_PM851_mSATA_512GB_S1EWNYAF609306 # ls -al /dev/disk/by-id/ |grep sdb 
            data00_disk: ata-WDC_WDS100T2B0B-00YS70_19106A800900 # ls -al /dev/disk/by-id/ |grep sdc
            data01_disk: ata-WDC_WDS100T2B0B_2013EP442601 # ls -al /dev/disk/by-id/ |grep sdd
        #eir:
      vars:
        ansible_ssh_pass: "{{ vault_ansible_sudo_password }}"
        thor_storage_nic: ens15f0
<snip>

############ task /roles/task_network_hosts.yml
#############
- debug:  # this works to set variable for storage interface https://docs.ansible.com/ansible/latest/collections/community/general/nmcli_module.html
    msg: "{{ inventory_hostname }}s this should be hostname with s added such as thors"

- debug: 
    msg: "{{ thor_storage_nic }}  this should be hostname response of 172.16.100.101"
# - debug: 
#     msg: "{{ inventory_hostname.storage_nic }} this should be response of ens15f0"
# - debug: 
#     msg: "{{ ansible_facts.storage_nic }} I guess if ansible_fact is a special ansible variable...this should be hostname response of ens15f0"
# - debug:
#     msg: "{{ ansible_default_ipv4.gateway }} this should be gateway this shoudld be response of 172.16.100.1"
# - debug:
#     msg: "{{ inventory_hostname[{{ storage_nic }}] }} this should be NIC of thor for storage"
- debug:
    msg: "{{ inventory_hostname.{{ storage_nic }} }} this should be NIC of thor for storage"
# - debug:
#     msg: "{{ inventory_hostname[storage_nic] }} this should be NIC of thor for storage"
- debug:
    msg: "{{ storage_nic }} this should be NIC of thor for storage"
# - debug:
#     msg: "{{ ovirt_disk }} this likely will fail as it should be host ovirtdisk"


#### Command and Result:  
cluster_devops$ ansible-playbook hci_deploy.yml --limit thor

PLAY [Ansible Pinging Host which validates SSH passwordless login] *****************************************************************************************************************************************************************TASK [Gathering Facts] *************************************************************************************************************************************************************************************************************ok: [thor]                                                                                                      **********************************************************

TASK [hci_cluster : debug] *********************************************************************************************************************************************************************************************************ok: [thor] =>                                                                                                   **********************************************************
  msg: thors this should be hostname with s added such as thors

TASK [hci_cluster : debug] *********************************************************************************************************************************************************************************************************ok: [thor] =>                                                                                                   **********************************************************
  msg: ens15f0  this should be hostname response of 172.16.100.101

TASK [hci_cluster : debug] *********************************************************************************************************************************************************************************************************fatal: [thor]: FAILED! =>                                                                                       **********************************************************
  msg: 'template error while templating string: expected name or number. String: {{ inventory_hostname.{{ storage_nic }} }} this should be NIC of thor for storage'       

PLAY RECAP *************************************************************************************************************************************************************************************************************************thor                       : ok=3    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored**********************************************************=0

Stefan Hornburg (Racke)

unread,
Feb 17, 2021, 1:11:24 PM2/17/21
to ansible...@googlegroups.com
On 2/17/21 7:03 PM, Jeremey Wise wrote:
> I 100% agree with you. If I set a host variable ... that should be read and take precedence from what I am reading.
>
> ....but that in lies the issue.. it does not work....
>

This causes the error:

- debug:
msg: "{{ inventory_hostname.{{ storage_nic }} }} this should be NIC of thor for storage"

So you never reached:

- debug:
msg: "{{ storage_nic }} this should be NIC of thor for storage"

You really need to try to understand what the error message clearly tells you.

Regards
Racke
> <https://groups.google.com/d/msgid/ansible-project/de027285-7089-4bdb-bd11-24f516a9a7d1n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/de027285-7089-4bdb-bd11-24f516a9a7d1n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/a9f0a848-1d7d-4da6-bcf8-8107c7929cd1n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/a9f0a848-1d7d-4da6-bcf8-8107c7929cd1n%40googlegroups.com?utm_medium=email&utm_source=footer>.
OpenPGP_signature

Jeremey Wise

unread,
Feb 17, 2021, 1:15:38 PM2/17/21
to Ansible Project
Ok..  same inventory file:

## one task..
- debug:
    msg: "{{ storage_nic }} this should be NIC of thor for storage"


## output
cluster_devops$ ansible-playbook hci_deploy.yml --limit thor

PLAY [Ansible Pinging Host which validates SSH passwordless login] *******************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************ok: [thor]

TASK [hci_cluster : debug] ***********************************************************************************************************************************************fatal: [thor]: FAILED! => 
  msg: |-
    The task includes an option with an undefined variable. The error was: 'storage_nic' is undefined
  
    The error appears to be in '/mnt/c/GitHub/penguinpages_cluster_devops/cluster_devops/roles/task_network_hosts.yml': line 78, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.
  
    The offending line appears to be:
  
    #     msg: "{{ inventory_hostname[storage_nic] }} this should be NIC of thor for storage"
    - debug:
      ^ here

PLAY RECAP ***************************************************************************************************************************************************************thor                       : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0


##

Ansible is the one adding in {{ inventory_hostname[storage_nic] }}   .. which implies it is parsing the variable of the "host specific" section.

Stefan Hornburg (Racke)

unread,
Feb 17, 2021, 2:32:09 PM2/17/21
to ansible...@googlegroups.com
On 2/17/21 7:15 PM, Jeremey Wise wrote:
> Ok..  same inventory file:
>
> ## one task..
> - debug:
>     msg: "{{ storage_nic }} this should be NIC of thor for storage"
>
>

Please remove vars: from your inventory and run your task again.

hci_hosts: # Nodes for hosting VMs
hosts:
thor:
mgmt_nic: enp8s0f0 # Set in Kickstart OS install
storage_nic: ens15f0

Regards
Racke
> <https://groups.google.com/d/msgid/ansible-project/a9f0a848-1d7d-4da6-bcf8-8107c7929cd1n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/a9f0a848-1d7d-4da6-bcf8-8107c7929cd1n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/8be655df-9707-4066-a81f-24cd7391b04bn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/8be655df-9707-4066-a81f-24cd7391b04bn%40googlegroups.com?utm_medium=email&utm_source=footer>.
OpenPGP_signature

Jeremey Wise

unread,
Feb 17, 2021, 4:01:55 PM2/17/21
to Ansible Project


That was it!!!!!

<reaches for stick to beat something>

Root cause:

Stanza of "var:"  though valid.. and used by some in examples.. is NOT valid.



######Good:   no "var" for hosts section but must have var for group...   
all:
  children:
###### Physical HyperConverge Server Devices for environment ###########
    hci_hosts: # Nodes for hosting VMs
      hosts:
        thor:
          mgmt_nic: enp8s0f0 # Set in Kickstart OS install
          storage_nic: ens15f0
          ovs_nic: enp8s0f1
        odin:
          mgmt_nic: enp8s0f0 # Set in Kickstart OS install
          storage_nic: enp7s0f1
      vars:
        ansible_ssh_pass: "{{ vault_ansible_sudo_password }}"
        thor_storage_nic: ens15f0

###### bad use of var:  under host
    hci_hosts: # Nodes for hosting VMs
      hosts:
        thor:
          var
            mgmt_nic: enp8s0f0 # Set in Kickstart OS install
            storage_nic: ens15f0
            ovs_nic: enp8s0f1
        odin:
          var:
            mgmt_nic: enp8s0f0 # Set in Kickstart OS install
            storage_nic: enp7s0f1
      vars:
        ansible_ssh_pass: "{{ vault_ansible_sudo_password }}"
        thor_storage_nic: ens15f0


###############  BAD removal of var:  from hci_cluster group

    hci_hosts: # Nodes for hosting VMs
      hosts:
        thor:
          mgmt_nic: enp8s0f0 # Set in Kickstart OS install
          storage_nic: ens15f0
          ovs_nic: enp8s0f1
        odin:
          mgmt_nic: enp8s0f0 # Set in Kickstart OS install
          storage_nic: enp7s0f1
        ansible_ssh_pass: "{{ vault_ansible_sudo_password }}"
        thor_storage_nic: ens15f0



Meh...  it works... don't ask me :P

Thanks for postings.
Reply all
Reply to author
Forward
0 new messages