Open blmhemu opened 3 years ago
I had the same problem as you. You can fix the problem by initializing the variable nomad_servers differently in defaults/main.yml.
nomad_servers: "\
{% set _nomad_servers = [] %}\
{% for host in groups[nomad_group_name] %}\
{% set _nomad_node_role = hostvars[host]['nomad_node_role'] | default('client', true) %}\
{% if ( _nomad_node_role == 'server' or _nomad_node_role == 'both') %}\
{% if _nomad_servers.append(host) %}{% endif %}\
{% endif %}\
{% endfor %}\
{{ _nomad_servers }}\ "
In the below line, we are checking if consul is NOT enabled. But when consul is enabled, the bootstrap_expect is wrongly being set to 3 whatever be the actual count. This is causing nomad to fail in some cases.
https://github.com/ansible-community/ansible-nomad/blob/a1853f1cf1051f72ca4b3fc672a56686b42efce6/defaults/main.yml#L129