Modify kazu634
cookbook for LXC containers.
This commit is contained in:
parent
6b53c30a77
commit
c1cc2589c4
12
cookbooks/kazu634/attributes.rb
Normal file
12
cookbooks/kazu634/attributes.rb
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# If it is a VM, use `zsh`. Otherwise, `bash`:
|
||||||
|
unless node['base']['lxc']
|
||||||
|
SHELL = '/usr/bin/zsh'
|
||||||
|
else
|
||||||
|
SHELL = '/usr/bin/bash'
|
||||||
|
end
|
||||||
|
|
||||||
|
node.reverse_merge!({
|
||||||
|
'kazu634' => {
|
||||||
|
'shell' => SHELL
|
||||||
|
}
|
||||||
|
})
|
@ -1,9 +1,14 @@
|
|||||||
|
include_recipe './attributes.rb'
|
||||||
|
|
||||||
include_recipe './kazu634.rb'
|
include_recipe './kazu634.rb'
|
||||||
|
|
||||||
include_recipe './ssh.rb'
|
include_recipe './ssh.rb'
|
||||||
|
|
||||||
|
# if it is inside a VM, do the followings:
|
||||||
|
unless node['base']['lxc']
|
||||||
include_recipe './vim.rb'
|
include_recipe './vim.rb'
|
||||||
|
|
||||||
include_recipe './mc.rb'
|
include_recipe './mc.rb'
|
||||||
|
|
||||||
include_recipe './mise.rb'
|
include_recipe './mise.rb'
|
||||||
|
end
|
||||||
|
@ -7,9 +7,18 @@ user 'kazu634' do
|
|||||||
create_home true
|
create_home true
|
||||||
home HOME
|
home HOME
|
||||||
|
|
||||||
shell '/usr/bin/zsh'
|
shell node['kazu634']['shell']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# sudoers
|
||||||
|
remote_file '/etc/sudoers.d/kazu634' do
|
||||||
|
owner 'root'
|
||||||
|
group 'root'
|
||||||
|
mode '440'
|
||||||
|
end
|
||||||
|
|
||||||
|
# if it is inside a VM, do the followings:
|
||||||
|
unless node['base']['lxc']
|
||||||
# Create directories:
|
# Create directories:
|
||||||
%w( repo src tmp works .cache ).each do |d|
|
%w( repo src tmp works .cache ).each do |d|
|
||||||
directory "#{HOME}/#{d}" do
|
directory "#{HOME}/#{d}" do
|
||||||
@ -66,13 +75,6 @@ remote_file '/home/kazu634/.config/starship.toml' do
|
|||||||
mode '0640'
|
mode '0640'
|
||||||
end
|
end
|
||||||
|
|
||||||
# sudoers
|
|
||||||
remote_file '/etc/sudoers.d/kazu634' do
|
|
||||||
owner 'root'
|
|
||||||
group 'root'
|
|
||||||
mode '440'
|
|
||||||
end
|
|
||||||
|
|
||||||
# automatically delete the /home/kazu634/tmp directory:
|
# automatically delete the /home/kazu634/tmp directory:
|
||||||
remote_file '/etc/cron.d/remove_tmp' do
|
remote_file '/etc/cron.d/remove_tmp' do
|
||||||
owner 'root'
|
owner 'root'
|
||||||
@ -88,3 +90,4 @@ end
|
|||||||
mode '755'
|
mode '755'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user