You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having issues setting up consul on ipv6-only hosts.
TASK [ansible-consul : Expose advertise_address(_wan) datacenter and node_role as facts] **********************************************************************************
fatal: [dfw-master-2]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ consul_bind_address }}: {% if ansible_system == 'FreeBSD' %}{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_'+ consul_iface ]['ipv4'][0]['address'], true) }}{% elif ansible_os_family == 'Windows' %}{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_ip_addresses'][0], true) }}{% else %}{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_'+ consul_iface | replace('-', '_')]['ipv4']['address'], true) }}{% endif %}: 'dict object' has no attribute 'ipv4'\n\nThe error appears to be in '/home/jcde/teardrop/provisioning/ansible/roles/ansible-consul/tasks/nix.yml': line 14, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Expose advertise_address(_wan) datacenter and node_role as facts\n ^ here\n"}
fatal: [dfw-master-0]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ consul_bind_address }}: {% if ansible_system == 'FreeBSD' %}{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_'+ consul_iface ]['ipv4'][0]['address'], true) }}{% elif ansible_os_family == 'Windows' %}{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_ip_addresses'][0], true) }}{% else %}{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_'+ consul_iface | replace('-', '_')]['ipv4']['address'], true) }}{% endif %}: 'dict object' has no attribute 'ipv4'\n\nThe error appears to be in '/home/jcde/teardrop/provisioning/ansible/roles/ansible-consul/tasks/nix.yml': line 14, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Expose advertise_address(_wan) datacenter and node_role as facts\n ^ here\n"}
fatal: [dfw-master-1]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: {{ consul_bind_address }}: {% if ansible_system == 'FreeBSD' %}{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_'+ consul_iface ]['ipv4'][0]['address'], true) }}{% elif ansible_os_family == 'Windows' %}{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_ip_addresses'][0], true) }}{% else %}{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_'+ consul_iface | replace('-', '_')]['ipv4']['address'], true) }}{% endif %}: 'dict object' has no attribute 'ipv4'\n\nThe error appears to be in '/home/jcde/teardrop/provisioning/ansible/roles/ansible-consul/tasks/nix.yml': line 14, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Expose advertise_address(_wan) datacenter and node_role as facts\n ^ here\n"}```
I've specified consul_iface in the playbook, but it doesn't seem to work for some reason.
---
# File: site.yml - Example nomad site playbook
- name: Assemble Consul cluster
hosts: masters
any_errors_fatal: true
become: true
become_user: root
roles:
- ansible-consul
vars:
consul_group_name: masters
consul_iface: eth0
consul_node_role: server
consul_bootstrap_expect: true
I'm very new to ansible, so it might be something I did wrong.
The text was updated successfully, but these errors were encountered:
I'm having issues setting up consul on ipv6-only hosts.
I've specified
consul_iface
in the playbook, but it doesn't seem to work for some reason.I'm very new to ansible, so it might be something I did wrong.
The text was updated successfully, but these errors were encountered: