From bc2f8128ff76d79a7316aa70764c9e9cd2d4704a Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Thu, 11 Aug 2022 12:21:34 +0900 Subject: [PATCH] =?UTF-8?q?`apt=20update`=E3=82=B3=E3=83=9E=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=81=AE=E5=AE=9F=E8=A1=8C=E5=9B=9E=E6=95=B0=E3=82=92?= =?UTF-8?q?=E6=B8=9B=E3=82=89=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cookbooks/consul/install.rb | 4 +++- cookbooks/grafana/install.rb | 4 +++- cookbooks/nomad/install.rb | 4 +++- cookbooks/vault/install.rb | 4 +++- cookbooks/vector/install.rb | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) 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'