diff --git a/cookbooks/nomad/attributes.rb b/cookbooks/nomad/attributes.rb index e366ebf..7f51ab1 100644 --- a/cookbooks/nomad/attributes.rb +++ b/cookbooks/nomad/attributes.rb @@ -5,6 +5,7 @@ node.reverse_merge!({ 'nomad' => { 'manager' => false, 'client' => false, + 'consul_token' => "f1d577dc-9216-d72a-cc09-1962b1009273", 'lokiendpoint' => 'loki.service.consul:3100', 'synology' => '192.168.10.200' } diff --git a/cookbooks/nomad/setup.rb b/cookbooks/nomad/setup.rb index 4aff591..0f8ceb0 100644 --- a/cookbooks/nomad/setup.rb +++ b/cookbooks/nomad/setup.rb @@ -43,7 +43,7 @@ if node['nomad']['client'] group 'nomad' mode '664' - variables(consul-token: node['nomad']['consul-token']) + variables(consul_token: node['nomad']['consul_token']) notifies :restart, 'service[nomad]' end diff --git a/cookbooks/nomad/files/etc/nomad.d/client.hcl b/cookbooks/nomad/templates/etc/nomad.d/client.hcl similarity index 55% rename from cookbooks/nomad/files/etc/nomad.d/client.hcl rename to cookbooks/nomad/templates/etc/nomad.d/client.hcl index dd7b407..cb39006 100644 --- a/cookbooks/nomad/files/etc/nomad.d/client.hcl +++ b/cookbooks/nomad/templates/etc/nomad.d/client.hcl @@ -6,6 +6,6 @@ client { } } -# consul { -# token = "11800359-1330-fe54-d858-44e8de9a14f6" -# } +consul { + token = "<%= @consul_token %>" +}