some fixes in cookbooks
This commit is contained in:
parent
9155d67014
commit
6ea8cec81e
@ -21,7 +21,7 @@ end
|
||||
template "/etc/cobbler/modules.conf" do
|
||||
source "modules.conf.erb"
|
||||
mode 0644
|
||||
notifies :restart, "service[cobbler]", :immediately
|
||||
notifies :restart, "service[cobbler]"
|
||||
end
|
||||
|
||||
template "/etc/cobbler/settings" do
|
||||
@ -31,7 +31,7 @@ template "/etc/cobbler/settings" do
|
||||
:next_server => node["cobbler"]["next_server"],
|
||||
:cobbler_server => node["cobbler"]["cobbler_server"]
|
||||
)
|
||||
notifies :restart, "service[cobbler]", :immediately
|
||||
notifies :restart, "service[cobbler]"
|
||||
end
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ template "/etc/cobbler/dnsmasq.template" do
|
||||
:dhcp_range => node["cobbler"]["dhcp_range"],
|
||||
:gateway => node["cobbler"]["gateway"]
|
||||
)
|
||||
notifies :run, "execute[cobbler_sync]", :immediately
|
||||
notifies :run, "execute[cobbler_sync]"
|
||||
end
|
||||
|
||||
template "/etc/cobbler/pxe/pxedefault.template" do
|
||||
@ -57,7 +57,7 @@ template "/etc/cobbler/pxe/pxedefault.template" do
|
||||
variables(
|
||||
:pxetimeout => node["cobbler"]["pxetimeout"]
|
||||
)
|
||||
notifies :run, "execute[cobbler_sync]", :immediately
|
||||
notifies :run, "execute[cobbler_sync]"
|
||||
end
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ file "/etc/dnsmasq.d/mirantis.net.conf" do
|
||||
action :create
|
||||
content "server=/mirantis.net/#{node["cobbler"]["updns"]}"
|
||||
mode 0644
|
||||
notifies :restart, "service[dnsmasq]", :immediately
|
||||
notifies :restart, "service[dnsmasq]"
|
||||
end
|
||||
|
||||
link "#{node["cobbler"]["bootstrap_ks_mirror_dir"]}/linux" do
|
||||
|
@ -18,43 +18,51 @@ user node.nailgun.user do
|
||||
end
|
||||
|
||||
file "#{node[:nailgun][:root]}/nailgun/venv.py" do
|
||||
content "VENV = #{node.nailgun.venv}/local/lib/python2.7/site-packages"
|
||||
content "VENV = '#{node[:nailgun][:venv]}/local/lib/python2.7/site-packages'
|
||||
"
|
||||
owner node.nailgun.user
|
||||
group node.nailgun.group
|
||||
mode 644
|
||||
end
|
||||
|
||||
# it is assumed that nailgun files already installed into nailgun.root
|
||||
execute 'chown #{node[:nailgun][:root]}' do
|
||||
command "chown -R #{node.nailgun.user}:#{node.nailgun.group} #{node.nailgun.root}"
|
||||
execute 'chown nailgun root' do
|
||||
command "chown -R #{node[:nailgun][:user]}:#{node[:nailgun][:group]} #{node[:nailgun][:root]}"
|
||||
end
|
||||
|
||||
execute 'chmod #{node[:nailgun][:root]}' do
|
||||
command "chmod -R u+w #{node.nailgun.root}"
|
||||
execute 'chmod nailgun root' do
|
||||
command "chmod -R u+w #{node[:nailgun][:root]}"
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
execute 'Preseed Nailgun database' do
|
||||
command '#{node.nailgun.python} manage.py loaddata nailgun/fixtures/default_env.json'
|
||||
command "#{node[:nailgun][:python]} manage.py loaddata nailgun/fixtures/default_env.json"
|
||||
cwd node.nailgun.root
|
||||
user node.nailgun.user
|
||||
action :nothing
|
||||
end
|
||||
|
||||
execute 'Sync Nailgun database' do
|
||||
command '#{node.nailgun.python} manage.py syncdb --noinput'
|
||||
command "#{node[:nailgun][:python]} manage.py syncdb --noinput"
|
||||
cwd node.nailgun.root
|
||||
user node.nailgun.user
|
||||
notifies :run, resources('execute[Preseed Nailgun database]')
|
||||
not_if "test -e #{node.nailgun.root}/nailgun.sqlite"
|
||||
not_if "test -e #{node[:nailgun][:root]}/nailgun.sqlite"
|
||||
end
|
||||
|
||||
execute 'Sync Nailgun database2' do
|
||||
command "echo #{node[:nailgun][:python]} manage.py syncdb --noinput > /root/2"
|
||||
not_if "test -e #{node[:nailgun][:root]}/nailgun.sqlite"
|
||||
end
|
||||
|
||||
execute 'Sync Nailgun database3' do
|
||||
command "echo #{node[:nailgun][:python]} manage.py syncdb --noinput > /root/3"
|
||||
end
|
||||
|
||||
|
||||
redis_instance 'nailgun'
|
||||
|
||||
celery_instance 'nailgun-jobserver' do
|
||||
command '#{node.nailgun.python} manage.py celeryd_multi'
|
||||
command "#{node[:nailgun][:python]} manage.py celeryd_multi"
|
||||
cwd node.nailgun.root
|
||||
events true
|
||||
user node.nailgun.user
|
||||
|
Loading…
Reference in New Issue
Block a user