Ensure to satisfy the prerequisites.

This commit is contained in:
Kazuhiro MUSASHI 2021-04-25 19:37:45 +09:00
parent 380b464d42
commit 70c90a18e2
3 changed files with 23 additions and 15 deletions

View File

@ -0,0 +1,3 @@
{
"insecure-registries" : ["reg.kazu634.com"]
}

View File

@ -19,4 +19,10 @@ execute 'apt-get update' do
not_if 'which docker' not_if 'which docker'
end end
package 'docker-ce' %w(docker-ce docker-ce-cli containerd.io).each do |p|
package p
end
service 'docker' do
action :nothing
end

View File

@ -1,7 +1,16 @@
# Ignore the certificate
remote_file '/etc/docker/daemon.json' do
owner 'root'
group 'root'
mode '0600'
notifies :restart, 'service[docker]'
end
# install `cifs-utils` # install `cifs-utils`
package 'cifs-utils' package 'cifs-utils'
%w( /mnt/backup /var/spool/apt-mirror ).each do |d| %w( /mnt/shared /var/spool/apt-mirror ).each do |d|
directory d do directory d do
owner 'root' owner 'root'
group 'root' group 'root'
@ -13,23 +22,13 @@ file '/etc/fstab' do
action :edit action :edit
block do |content| block do |content|
content << "//192.168.10.200/Shared/AppData /mnt/backup cifs username=admin,password=Holiday88,uid=root,gid=root,file_mode=0777,dir_mode=0777,vers=3.0,_netdev 0 0\n" content << "//192.168.10.200/Shared/AppData /mnt/shared cifs username=admin,password=Holiday88,uid=root,gid=root,file_mode=0777,dir_mode=0777,vers=3.0,_netdev 0 0\n"
end end
not_if 'grep backup /etc/fstab' not_if 'grep shared /etc/fstab'
end end
file '/etc/fstab' do execute 'mount -a || true'
action :edit
block do |content|
content << "//192.168.10.200/Shared/PXEBoot/www/ubuntu/apt-mirror /var/spool/apt-mirror cifs username=admin,password=Holiday88,uid=root,gid=root,file_mode=0777,dir_mode=0777,vers=3.0,_netdev 0 0\n"
end
not_if 'grep apt-mirror /etc/fstab'
end
execute 'mount -a'
# Deploy the cron.d file: # Deploy the cron.d file:
remote_file '/etc/cron.d/docker-housekeep' do remote_file '/etc/cron.d/docker-housekeep' do