update snippet to support 14.04 version

Change-Id: I81b9ae9d51ad1930256110c31a70cf756e4f6f8a
This commit is contained in:
xiaodongwang 2014-05-24 12:19:45 -07:00
parent c4f81a709e
commit 0e1a88bb87
12 changed files with 48 additions and 18 deletions

View File

@ -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

View File

@ -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

View File

@ -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'] %>
#

View File

@ -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

View File

@ -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

View File

@ -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')

View File

@ -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; \

View File

@ -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}

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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", "") != ""