itamae/cookbooks/docker/setup.rb

55 lines
1.2 KiB
Ruby
Raw Normal View History

2019-03-03 08:50:49 +00:00
# install `cifs-utils`
package 'cifs-utils'
%w( /mnt/backup /var/spool/apt-mirror ).each do |d|
directory d do
owner 'root'
group 'root'
end
2019-03-03 08:50:49 +00:00
end
# Add the fstab entry:
file '/etc/fstab' do
action :edit
block do |content|
2020-11-12 07:00:33 +00:00
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"
2019-03-03 08:50:49 +00:00
end
not_if 'grep backup /etc/fstab'
end
file '/etc/fstab' do
action :edit
block do |content|
2020-11-12 07:00:33 +00:00
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"
2019-03-03 08:50:49 +00:00
end
not_if 'grep apt-mirror /etc/fstab'
end
execute 'mount -a'
# Deploy the cron.d file:
remote_file '/etc/cron.d/docker-housekeep' do
owner 'root'
group 'root'
mode '644'
end
# Deploy config file for `vector`:
template '/etc/vector/docker.toml' do
owner 'root'
group 'root'
mode '644'
variables(LOKI: node['docker']['loki'],
HOSTNAME: node[:hostname]
)
source 'templates/etc/vector/docker.toml.erb'
notifies :restart, 'service[vector-docker]'
end