diff --git a/cookbooks/consul/install.rb b/cookbooks/consul/install.rb index 6e8adec..ebfac5e 100644 --- a/cookbooks/consul/install.rb +++ b/cookbooks/consul/install.rb @@ -15,6 +15,8 @@ template '/etc/apt/sources.list.d/hashicorp.list' do variables(distribution: DIST) end -execute 'apt update' +execute 'apt update' do + not_if 'which consul' +end package 'consul' diff --git a/cookbooks/grafana/install.rb b/cookbooks/grafana/install.rb index 91eb4a9..5561cfb 100644 --- a/cookbooks/grafana/install.rb +++ b/cookbooks/grafana/install.rb @@ -10,7 +10,9 @@ execute 'curl https://packages.grafana.com/gpg.key | apt-key add -' do not_if 'apt-key list | grep grafana' end -execute 'apt update' +execute 'apt update' do + not_if 'which grafana-server' +end package 'grafana' do action :install diff --git a/cookbooks/nomad/install.rb b/cookbooks/nomad/install.rb index 74adaea..69a72b2 100644 --- a/cookbooks/nomad/install.rb +++ b/cookbooks/nomad/install.rb @@ -15,6 +15,8 @@ template '/etc/apt/sources.list.d/hashicorp.list' do variables(distribution: DIST) end -execute 'apt update' +execute 'apt update' do + not_if 'which nomad' +end package 'nomad' diff --git a/cookbooks/vault/install.rb b/cookbooks/vault/install.rb index b93c132..3430e90 100644 --- a/cookbooks/vault/install.rb +++ b/cookbooks/vault/install.rb @@ -15,6 +15,8 @@ template '/etc/apt/sources.list.d/hashicorp.list' do variables(distribution: DIST) end -execute 'apt update' +execute 'apt update' do + not_if 'which vault' +end package 'vault' diff --git a/cookbooks/vector/install.rb b/cookbooks/vector/install.rb index b6424b3..8d1b39f 100644 --- a/cookbooks/vector/install.rb +++ b/cookbooks/vector/install.rb @@ -17,6 +17,8 @@ template '/etc/apt/sources.list.d/timber-vector.list' do variables(distribution: DIST) end -execute 'apt update' +execute 'apt update' do + not_if 'which vector' +end package 'vector'