Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap_expect is wrong when using consul #132

Open
blmhemu opened this issue Jun 5, 2021 · 1 comment
Open

bootstrap_expect is wrong when using consul #132

blmhemu opened this issue Jun 5, 2021 · 1 comment

Comments

@blmhemu
Copy link
Contributor

blmhemu commented Jun 5, 2021

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.

nomad_servers: "\

@lsander22
Copy link

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 }}\ "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants