diff --git a/roles/nomad/defaults/main.yml b/roles/nomad/defaults/main.yml index 16e75aa..7ebc833 100644 --- a/roles/nomad/defaults/main.yml +++ b/roles/nomad/defaults/main.yml @@ -50,7 +50,7 @@ nomad_base_conf: # The default is to act as a client if the hostname is not listed in nomad servers client: # Should client be enabled - enabled: "{{ (inventory_hostname in nomad_servers) | ternary(False, True) }}" + enabled: "{{ (inventory_hostname in nomad_servers | map('regex_replace', ':\\d+$', '')) | ternary(False, True) }}" # host_volumes: # - name: mysql # path: /data/mysql @@ -103,7 +103,7 @@ nomad_base_conf: server: # Should server be enabled # The default is to act as a server if the hostname is listed in nomad_servers - enabled: "{{ (inventory_hostname in nomad_servers) | ternary(True, False) }}" + enabled: "{{ (inventory_hostname in nomad_servers | map('regex_replace', ':\\d+$', '')) | ternary(True, False) }}" # Expected number of servers to bootstrap the cluster. The default is to wait for all the servers # listed in nomad_servers to be ready, and then to do the bootstrap @@ -121,7 +121,7 @@ nomad_base_conf: # UI related settings ui: # Default is to enable the UI on server only - enabled: "{{ (inventory_hostname in nomad_servers) | ternary(True, False) }}" + enabled: "{{ (inventory_hostname in nomad_servers | map('regex_replace', ':\\d+$', '')) | ternary(True, False) }}" # Consul and vault optional URL. This is just to add a shortcut in Nomad's UI # consul_ui: https://consul.example.org # vault_ui: https://vault.example.org