---
# some variables are set during execution
venom_local_vars:
  - name: 'pfserver_mgmt_ip'
    value: "{{ packetfence_install__mgmt_interface['ip'] }}"

  - name: 'pfserver_mgmt_netmask'
    value: "{{ packetfence_install__mgmt_interface['mask'] }}"

  # inventory_hostname is a special Ansible variable
  - name: 'configurator.interfaces.reg.ip'
    value: "{{ users_vars[dict_name]['vms'][inventory_hostname]['ip_reg'] }}"

  # get netmask based on CIDR
  - name: 'configurator.interfaces.reg.netmask'
    value: "{{ users_vars[dict_name]['networks'][1]['subnet'] | ansible.netcommon.ipaddr('netmask') }}"

  # inventory_hostname is a special Ansible variable
  - name: 'configurator.interfaces.iso.ip'
    value: "{{ users_vars[dict_name]['vms'][inventory_hostname]['ip_iso'] }}"

  # get netmask based on CIDR
  - name: 'configurator.interfaces.iso.netmask'
    value: "{{ users_vars[dict_name]['networks'][2]['subnet'] | ansible.netcommon.ipaddr('netmask') }}"

  - name: 'smtp_server'
    value: "{{ packetfence_install__mgmt_interface['ip'] }}"

  - name: 'smtp_port'
    value: '{{ mailhog__smtp_port }}'

  - name: 'smtp_api_port'
    value: '{{ mailhog__api_port }}'

  - name: 'internet_int_ip'
    value: "{{ ansible_default_ipv4.address }}"

  - name: 'internet_int_netmask'
    value: "{{ ansible_default_ipv4.netmask }}"
  
  - name: 'timezone'
    value: "{{ ansible_date_time['tz'] }}"

  - name: 'mariadb_socket'
    value: "{{ mariadb_socket }}"

  - name: 'ad_mgmt_ip'
    value: "{{ users_vars[dict_name]['vms']['ad']['ip'] }}"

  - name: 'switch01_mgmt_ip'
    value: "{{ users_vars[dict_name]['vms']['switch01']['ip'] }}"

  - name: 'node01_mgmt_ip'
    value: "{{ users_vars[dict_name]['vms']['node01']['ip'] }}"

  - name: 'node02_mgmt_ip'
    value: "{{ users_vars[dict_name]['vms']['node02']['ip'] }}"

  - name: 'wireless01_mgmt_ip'
    value: "{{ users_vars[dict_name]['vms']['wireless01']['ip'] }}"

  - name: 'linux01_mgmt_ip'
    value: "{{ users_vars[dict_name]['vms']['linux01']['ip'] }}"

  - name: 'linux02_mgmt_ip'
    value: "{{ users_vars[dict_name]['vms']['linux02']['ip'] }}"

  - name: 'fingerbank_api_key.secret_id'
    value: "{{ users_vars[dict_name]['vars']['fingerbank_api_key']['secret_id'] }}"

  - name: 'fingerbank_api_key.email'
    value: "{{ users_vars[dict_name]['vars']['fingerbank_api_key']['email'] }}"
