Skip to content

Commit

Permalink
slight fixes and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Hendren committed Feb 13, 2016
1 parent fa37edf commit f7dcac4
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ This file is used to list changes made in each version of the amzapache cookbook
0.1.1
-----
- [phendren] - 12.08.2014 - Released with basic fixes

0.1.2
-----
- [phendren] - 02.13.2016 - small fixes to format and adding test kitchen


- - -
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
license 'Apache License 2.0'
description 'Installs/Configures default apache httpd package on Amazon Linux'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.1'
version '0.1.2'
52 changes: 25 additions & 27 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
# Apache 2.0 - phendren - originally for Sounds True
#


package 'httpd' do
package_name 'httpd'
package_name 'httpd'
action :install
end

package 'mod_ssl' do
package_name 'mod_ssl'
action :install
package_name 'mod_ssl'
action :install
end

cookbook_file "/etc/httpd/conf.d/ssl.conf" do
Expand All @@ -32,23 +31,23 @@
group 'root'
mode '0755'
action :create
end
end

# This is some simple bash-fu for creating a module listing
bash "module-listing" do
cwd "/etc/httpd"
user "root"
code <<-EOH
build="# dynamic module listing\n"
echo $build > /tmp/modules.txt.erb
cd /etc/httpd/modules;
for list in $(ls); do
base=$(basename $list .so)
name=$(echo $base | sed -r 's/^.{4}//')
part="_module"
echo "LoadModule $name$part modules/$list" >> /tmp/modules.txt.erb
done
EOH
cwd "/etc/httpd"
user "root"
code <<-EOH
build="# dynamic module listing\n"
echo $build > /tmp/modules.txt.erb
cd /etc/httpd/modules;
for list in $(ls); do
base=$(basename $list .so
name=$(echo $base | sed -r 's/^.{4}//')
part="_module"
echo "LoadModule $name$part modules/$list" >> /tmp/modules.txt.erb
done
EOH
end

template 'httpd.conf' do
Expand All @@ -60,16 +59,15 @@
end

cookbook_file "/var/www/html/index.html" do
source "index.html.txt"
mode "0644"
owner 'apache'
group 'apache'
source "index.html.txt"
mode "0644"
owner 'apache'
group 'apache'
end

service "httpd" do
stop_command "/etc/init.d/httpd stop"
start_command "/etc/init.d/httpd start"
restart_command "/etc/init.d/httpd restart"
action :restart
stop_command "/etc/init.d/httpd stop"
start_command "/etc/init.d/httpd start"
restart_command "/etc/init.d/httpd restart"
action :restart
end

0 comments on commit f7dcac4

Please sign in to comment.