2019-03-03 08:50:49 +00:00
|
|
|
package 'cifs-utils'
|
|
|
|
|
2020-11-21 09:05:44 +00:00
|
|
|
%w(shared tmp img backup).each do |d|
|
2019-03-03 08:50:49 +00:00
|
|
|
directory "/mnt/#{d}/" do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '777'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-10-10 13:08:16 +00:00
|
|
|
directory '/var/spool/apt-mirror' do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '777'
|
|
|
|
end
|
|
|
|
|
2019-03-03 08:50:49 +00:00
|
|
|
# Add the fstab entry:
|
|
|
|
file '/etc/fstab' do
|
|
|
|
action :edit
|
|
|
|
|
|
|
|
block do |content|
|
2020-10-10 13:08:16 +00:00
|
|
|
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"
|
2019-03-03 08:50:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
not_if 'grep shared /etc/fstab'
|
|
|
|
end
|
|
|
|
|
|
|
|
file '/etc/fstab' do
|
|
|
|
action :edit
|
|
|
|
|
|
|
|
block do |content|
|
2021-08-13 02:19:33 +00:00
|
|
|
content << "//192.168.10.200/homes/kazu634/Photos/Moments /mnt/img 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
|
|
|
|
|
2020-11-21 09:05:44 +00:00
|
|
|
not_if 'grep Moments /etc/fstab'
|
2019-03-03 08:50:49 +00:00
|
|
|
end
|
|
|
|
|
2020-10-10 13:08:16 +00:00
|
|
|
file '/etc/fstab' do
|
|
|
|
action :edit
|
|
|
|
|
|
|
|
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"
|
|
|
|
end
|
|
|
|
|
|
|
|
not_if 'grep backup /etc/fstab'
|
|
|
|
end
|
|
|
|
|
|
|
|
file '/etc/fstab' do
|
|
|
|
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
|
|
|
|
|
2021-06-19 11:12:22 +00:00
|
|
|
execute 'mount -a || true' do
|
2019-03-03 08:50:49 +00:00
|
|
|
not_if 'df -h | grep shared'
|
|
|
|
end
|