Skip to content

Instantly share code, notes, and snippets.

@three18ti
Created May 22, 2012 16:59
Show Gist options
  • Save three18ti/2770268 to your computer and use it in GitHub Desktop.
Save three18ti/2770268 to your computer and use it in GitHub Desktop.
[root@sidious ~]# puppet agent --test
info: Caching catalog for sidious
info: Applying configuration version '1337705421'
notice: /Stage[main]/Cpanel/Exec[disable_selinux]/returns: executed successfully
notice: /Stage[main]/Cpanel/Exec[download_cpanel]/returns: executed successfully
err: /Stage[main]/Cpanel/Exec[install_cpanel]/returns: change from notrun to 0 failed: sh /root/install_cpanel.sh returned 2 instead of one of [0] at /etc/puppet/modules/cpanel/manifests/init.pp:52
notice: Finished catalog run in 1.26 seconds
# File: cpanel/manifests/init.pp
# Class: cpanel
#
# This module manages cPanel
#
# Parameters:
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# [Remember: No empty lines between comments and class definition]
class cpanel {
# execute this first
# file { 'config':
# path => '/etc/selinux/config',
# ensure => file,
# content => template("cpanel/selinux.config.erb"),
# }
exec { 'disable_selinux':
command => 'setenforce 0',
path => "/usr/sbin/",
}
if ! $cpanel_server {
package {
["mail-server", "ftp-server", "kde-desktop",
"legacy-x", "web-server", "web-servlet",
"system-management-wbem", "x11" ]:
ensure => absent,
}
# disable firewall
service { 'iptables':
ensure => stopped,
enable => false,
}
# Download cPanel install script
exec { "download_cpanel":
command => "wget http://httpupdate.cpanel.net/latest -O /root/install_cpanel.sh",
path => "/usr/bin/",
}
exec { "install_cpanel":
command => "sh /root/install_cpanel.sh",
path => "/bin/",
require => Exec['download_cpanel'],
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment