linux基础组件安装模块linuxbaseinstall
更换源,安装gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf git
mkdir -p /etc/puppet/modules/linuxbaseinstall/{manifests,templates,files}
vi /etc/puppet/modules/linuxbaseinstall/manifests/init.pp
class linuxbaseinstall {
exec { "yumsofts":
command => "mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup&&cd /etc/yum.repos.d/&&wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo&&yum makecache",
path => ["/usr/bin","/usr/sbin","/bin","/sbin"],
require => Package["wget"],
unless => "grep 'mirrors.aliyun.com' /etc/yum.repos.d/CentOS-Base.repo ",
}
yumrepo { "repo163":
descr => "163 repo",
baseurl => "http://mirrors.163.com/centos/7/os/x86_64/",
gpgcheck => "0",
enabled => "1";
}
package {
"gcc":
ensure => installed,
require => Yumrepo["repo163"];
}
package {
"gcc-c++":
ensure => installed,
require => Yumrepo["repo163"];
}
package {
"glibc-devel":
ensure => installed,
require => Yumrepo["repo163"];
}
package {
"make":
ensure => installed,
require => Yumrepo["repo163"];
}
package {
"wget":
ensure => installed,
require => Yumrepo["repo163"];
}
package {
"git":
ensure => installed,
require => Yumrepo["repo163"];
}
package {
["openssl","openssl-devel","openssl-libs","openssl-perl","openssl-static",]:
ensure => installed,
require => Yumrepo["repo163"];
}
package {
["ncurses","ncurses-base","ncurses-devel","ncurses-libs","ncurses-static","ncurses-term",]:
ensure => installed,
require => Yumrepo["repo163"];
}
package {
"autoconf":
ensure => installed,
require => Yumrepo["repo163"];
}
package {
"telnet":
ensure => installed,
require => Yumrepo["repo163"];
}
}
vi /etc/puppet/manifests/nodes/huangat-test.pp
node 'huangat-test' {
include linuxbaseinstall
}
确保/etc/puppet/manifests/site.pp里有
import "nodes/*.pp"