diff --git a/chef/cookbooks/apache2/attributes/default.rb b/chef/cookbooks/apache2/attributes/default.rb index 2fed820..770863a 100644 --- a/chef/cookbooks/apache2/attributes/default.rb +++ b/chef/cookbooks/apache2/attributes/default.rb @@ -55,7 +55,11 @@ when "debian", "ubuntu" default['apache']['cgibin_dir'] = "/usr/lib/cgi-bin" default['apache']['icondir'] = "/usr/share/apache2/icons" default['apache']['cache_dir'] = "/var/cache/apache2" - default['apache']['pid_file'] = "/var/run/apache2.pid" + if node['platform_version'].to_f >= 14 then + default['apache']['pid_file'] = "/var/run/apache2/apache2.pid" + else + default['apache']['pid_file'] = "/var/run/apache2.pid" + end default['apache']['lib_dir'] = "/usr/lib/apache2" default['apache']['libexecdir'] = "#{node['apache']['lib_dir']}/modules" default['apache']['default_site_enabled'] = false diff --git a/chef/cookbooks/apache2/recipes/mod_authz_default.rb b/chef/cookbooks/apache2/recipes/mod_authz_default.rb index 123536d..849861d 100644 --- a/chef/cookbooks/apache2/recipes/mod_authz_default.rb +++ b/chef/cookbooks/apache2/recipes/mod_authz_default.rb @@ -17,4 +17,9 @@ # limitations under the License. # -apache_module "authz_default" +unless %w{debian}.include?(node['platform_family']) && node['platform_version'].to_f >= 14 then + print "load authz_default module" + apache_module "authz_default" +else + print "do not load authz_default module" +end diff --git a/chef/cookbooks/apache2/templates/default/apache2.conf.erb b/chef/cookbooks/apache2/templates/default/apache2.conf.erb index bea4993..668ee02 100644 --- a/chef/cookbooks/apache2/templates/default/apache2.conf.erb +++ b/chef/cookbooks/apache2/templates/default/apache2.conf.erb @@ -9,7 +9,11 @@ ServerRoot "<%= node['apache']['dir'] %>" # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. # <% if %w{debian}.include?(node['platform_family']) -%> + <% if node['platform_version'].to_f >= 14 -%> +Mutex file:/var/lock/apache2 default + <% else %> LockFile /var/lock/apache2/accept.lock + <% end -%> <% elsif %w{freebsd}.include?(node['platform_family']) -%> LockFile /var/log/accept.lock <% else %> @@ -20,6 +24,7 @@ LockFile logs/accept.lock # PidFile: The file in which the server should record its process # identification number when it starts. # + PidFile <%= node['apache']['pid_file'] %> # diff --git a/chef/cookbooks/apache2/templates/default/mods/ssl.conf.erb b/chef/cookbooks/apache2/templates/default/mods/ssl.conf.erb index 2582f30..f98c621 100644 --- a/chef/cookbooks/apache2/templates/default/mods/ssl.conf.erb +++ b/chef/cookbooks/apache2/templates/default/mods/ssl.conf.erb @@ -51,7 +51,13 @@ SSLSessionCacheTimeout 300 # Semaphore: # Configure the path to the mutual exclusion semaphore the # SSL engine uses internally for inter-process synchronization. -<% if %w{ rhel fedora suse }.include?(node['platform_family']) -%> +<% if %w{debian}.include?(node['platform_family']) -%> + <% if node['platform_version'].to_f >= 14 -%> +Mutex file:/var/run/apache2 default + <% else %> +SSLMutex file:/var/run/apache2/ssl_mutex + <% end -%> +<% elsif %w{ rhel fedora suse }.include?(node['platform_family']) -%> SSLMutex default <% elsif %w{ freebsd }.include?(node['platform_family']) -%> SSLMutex file:/var/run/ssl_mutex diff --git a/chef/cookbooks/openstack-dashboard/spec/server_spec.rb b/chef/cookbooks/openstack-dashboard/spec/server_spec.rb index 304b20b..b660cb6 100644 --- a/chef/cookbooks/openstack-dashboard/spec/server_spec.rb +++ b/chef/cookbooks/openstack-dashboard/spec/server_spec.rb @@ -154,7 +154,7 @@ describe "openstack-dashboard::server" do describe "openstack-dashboard virtual host" do before do - f = "/etc/apache2/sites-available/openstack-dashboard" + f = "/etc/apache2/sites-available/openstack-dashboard.conf" @file = @chef_run.template f end diff --git a/cobbler/kickstarts/default.ks b/cobbler/kickstarts/default.ks index 4d37231..7d9d096 100644 --- a/cobbler/kickstarts/default.ks +++ b/cobbler/kickstarts/default.ks @@ -99,8 +99,9 @@ $SNIPPET('kickstart_ntp') $SNIPPET('kickstart_limits.conf') $SNIPPET('kickstart_sysctl.conf') $SNIPPET('kickstart_rsyslog.conf') -#set $kickstart_tool = "kickstart_%s" % $tool +#if $getVar('tool', '') != '' + #set $kickstart_tool = "kickstart_%s" % $tool $SNIPPET($kickstart_tool) - +#end if $SNIPPET('kickstart_post_anamon') $SNIPPET('kickstart_done') diff --git a/cobbler/kickstarts/default.seed b/cobbler/kickstarts/default.seed index dd1031c..0ef43b8 100644 --- a/cobbler/kickstarts/default.seed +++ b/cobbler/kickstarts/default.seed @@ -52,9 +52,7 @@ d-i clock-setup/ntp-server string ntp.ubuntu.com d-i mirror/country string manual d-i mirror/http/hostname string $http_server d-i mirror/http/directory string $install_source_directory -#if $getVar('proxy', '') != "" -d-i mirror/http/proxy string $proxy -#end if +d-i mirror/http/proxy string #set $os_v = $getVar('os_version','') #if $os_v and $os_v.lower()[0] > 'p' @@ -104,8 +102,10 @@ $SNIPPET('preseed_post_install_network_config') echo "processed preseed_post_ins $SNIPPET('preseed_ssh') echo "processed preseed_ssh" >> /tmp/preseed.log; \ $SNIPPET('preseed_ntp') echo "processed preseed_ntp" >> /tmp/preseed.log; \ $SNIPPET('preseed_post_apt_repo_config') echo "processed preseed_post_apt_repo_config" >> /tmp/preseed.log; \ -#set $preseed_tool = "preseed_%s" % $tool +#if $getVar('tool', '') != '' + #set $preseed_tool = "preseed_%s" % $tool $SNIPPET($preseed_tool) echo "processed $preseed_tool" >> /tmp/preseed.log; \ +#end if $SNIPPET('preseed_limits.conf') echo "processed preseed_limits.conf" >> /tmp/preseed.log; \ $SNIPPET('preseed_sysctl.conf') echo "processed preseed_sysctl.conf" >> /tmp/preseed.log; \ $SNIPPET('preseed_rsyslog.conf') echo "processed preseed_rsyslog.conf" >> /tmp/preseed.log; \ diff --git a/cobbler/snippets/preseed_apt_repo_config b/cobbler/snippets/preseed_apt_repo_config index 28c0070..3b9b8d2 100644 --- a/cobbler/snippets/preseed_apt_repo_config +++ b/cobbler/snippets/preseed_apt_repo_config @@ -9,9 +9,9 @@ d-i apt-setup/use_mirror boolean false #set $comps = " ".join($repo.apt_components) d-i apt-setup/local${cur}/repository string \ #if $repo.mirror_locally - http://$http_server/cobbler/repo_mirror/${repo.name} $dist $comps +deb http://$http_server/cobbler/repo_mirror/${repo.name} $dist $comps #else - ${repo.mirror} $dist $comps +deb ${repo.mirror} $dist $comps #end if #if $repo.comment != "" d-i apt-setup/local${cur}/comment string ${repo.comment} diff --git a/cobbler/snippets/preseed_network_config b/cobbler/snippets/preseed_network_config index f02be37..651467a 100644 --- a/cobbler/snippets/preseed_network_config +++ b/cobbler/snippets/preseed_network_config @@ -2,8 +2,10 @@ d-i netcfg/link_detection_timeout string 0 d-i netcfg/dhcp_timeout string 0 d-i netcfg/dhcpv6_timeout string 0 -d-i netcfg/enable boolean true +d-i netcfg/enable boolean false d-i netcfg/disable_autoconfig boolean true +d-i netcfg/use_autoconfig boolean false +d-i netcfg/disable_dhcp boolean true d-i netcfg/dhcp_failed note d-i netcfg/dhcp_options select Configure network manually d-i hw-detect/load_firmware boolean true diff --git a/cobbler/snippets/preseed_post_apt_repo_config b/cobbler/snippets/preseed_post_apt_repo_config index 3f8f002..9763eb4 100644 --- a/cobbler/snippets/preseed_post_apt_repo_config +++ b/cobbler/snippets/preseed_post_apt_repo_config @@ -1,8 +1,13 @@ -echo "deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse" > /target/etc/apt/sources.list; \ -echo "deb http://archive.ubuntu.com/ubuntu/ raring-security main restricted universe multiverse" >> /target/etc/apt/sources.list; \ -echo "deb http://archive.ubuntu.com/ubuntu/ raring-updates main restricted universe multiverse" >> /target/etc/apt/sources.list; \ -echo "deb http://archive.ubuntu.com/ubuntu/ raring-proposed main restricted universe multiverse" >> /target/etc/apt/sources.list; \ -echo "deb http://archive.ubuntu.com/ubuntu/ raring-backports main restricted universe multiverse" >> /target/etc/apt/sources.list; \ +#if $getVar('proxy', '') != '' +echo "Acquire::http::Proxy \"$proxy\";" > /target/etc/apt/apt.conf; \ +#end if +#if $getVar('os_version', '') != '' +echo "deb http://archive.ubuntu.com/ubuntu/ $os_version main restricted universe multiverse" > /target/etc/apt/sources.list; \ +echo "deb http://archive.ubuntu.com/ubuntu/ ${os_version}-security main restricted universe multiverse" >> /target/etc/apt/sources.list; \ +echo "deb http://archive.ubuntu.com/ubuntu/ ${os_version}-updates main restricted universe multiverse" >> /target/etc/apt/sources.list; \ +echo "deb http://archive.ubuntu.com/ubuntu/ ${os_version}-proposed main restricted universe multiverse" >> /target/etc/apt/sources.list; \ +echo "deb http://archive.ubuntu.com/ubuntu/ ${os_version}-backports main restricted universe multiverse" >> /target/etc/apt/sources.list; \ +#end if #set $repo_data = $getVar("repo_data",[]) #for $repo in $repo_data #for $dist in $repo.apt_dists diff --git a/cobbler/snippets/preseed_post_install_network_config b/cobbler/snippets/preseed_post_install_network_config index fd7812f..7552798 100644 --- a/cobbler/snippets/preseed_post_install_network_config +++ b/cobbler/snippets/preseed_post_install_network_config @@ -199,6 +199,7 @@ echo "" >> /target/etc/network/interfaces; \ ## Done with this interface ## =================================================================== #end for +cp /target/etc/network/interfaces /etc/network/interfaces; \ ## ============================================================================= ## Configure the system's primary hostname. This is also passed to anaconda, but ## anaconda doesn't seem to honour it in DHCP-setups. diff --git a/cobbler/snippets/preseed_ssh b/cobbler/snippets/preseed_ssh index 3d10eaf..7ce2926 100644 --- a/cobbler/snippets/preseed_ssh +++ b/cobbler/snippets/preseed_ssh @@ -1,3 +1,4 @@ +sed -i 's/PermitRootLogin.*/PermitRootLogin yes/g' /target/etc/ssh/sshd_config; \ mkdir -p /target/root/.ssh; \ chmod 700 -R /target/root/.ssh; \ #if $getVar("push_ssh_keys", "") != ""