Skip to content

Commit

Permalink
Add a warning useful for the initial install.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdkent committed Apr 21, 2011
1 parent 26ec760 commit 68d605b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apache2/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# A default CentOS install with the 'server' package option selected installs
# httpd and some other dependant packages - these get in the way. Bail out if a
# file from one of these installs is detected.
if platform?("centos", "redhat")
ruby_block "default_install_warning" do
block do
packages=`rpm -qa --filesbypkg | grep /etc/httpd/ | cut -d" " -f1 | sort | uniq | xargs`.chomp
Chef::Log.fatal("Found file at #{node[:apache][:dir]}/conf.d/ssl.conf - this normally " +
"shouldn't exist as we use a system in /etc/httpd/mods-{available/enabled}. " +
"Was httpd installed already? Please remove everything involved with httpd with " +
"'yum remove #{packages}' and run chef-client again so Chef can control the " +
"install of httpd and it's dependant modules. Aborting run.")
exit 0
end
only_if { File.exists?("#{node[:apache][:dir]}/conf.d/ssl.conf") }
action :create
end
end

package "apache2" do
package_name "httpd"
action :install
Expand Down

0 comments on commit 68d605b

Please sign in to comment.