`apt update`コマンドの実行回数を減らす

This commit is contained in:
Kazuhiro MUSASHI 2022-08-11 12:21:34 +09:00
parent 48d0e3be76
commit bc2f8128ff
5 changed files with 15 additions and 5 deletions

View File

@ -15,6 +15,8 @@ template '/etc/apt/sources.list.d/hashicorp.list' do
variables(distribution: DIST) variables(distribution: DIST)
end end
execute 'apt update' execute 'apt update' do
not_if 'which consul'
end
package 'consul' package 'consul'

View File

@ -10,7 +10,9 @@ execute 'curl https://packages.grafana.com/gpg.key | apt-key add -' do
not_if 'apt-key list | grep grafana' not_if 'apt-key list | grep grafana'
end end
execute 'apt update' execute 'apt update' do
not_if 'which grafana-server'
end
package 'grafana' do package 'grafana' do
action :install action :install

View File

@ -15,6 +15,8 @@ template '/etc/apt/sources.list.d/hashicorp.list' do
variables(distribution: DIST) variables(distribution: DIST)
end end
execute 'apt update' execute 'apt update' do
not_if 'which nomad'
end
package 'nomad' package 'nomad'

View File

@ -15,6 +15,8 @@ template '/etc/apt/sources.list.d/hashicorp.list' do
variables(distribution: DIST) variables(distribution: DIST)
end end
execute 'apt update' execute 'apt update' do
not_if 'which vault'
end
package 'vault' package 'vault'

View File

@ -17,6 +17,8 @@ template '/etc/apt/sources.list.d/timber-vector.list' do
variables(distribution: DIST) variables(distribution: DIST)
end end
execute 'apt update' execute 'apt update' do
not_if 'which vector'
end
package 'vector' package 'vector'