Merge pull request '`apt update`コマンドの実行回数を減らす' (#20) from reduce-apt-update-execution into master

Reviewed-on: #20
This commit is contained in:
Kazuhiro MUSASHI 2022-08-11 03:24:45 +00:00
commit 130c6046e3
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)
end
execute 'apt update'
execute 'apt update' do
not_if 'which consul'
end
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'
end
execute 'apt update'
execute 'apt update' do
not_if 'which grafana-server'
end
package 'grafana' do
action :install

View File

@ -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'

View File

@ -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'

View File

@ -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'