puppet连载七:linux基础组件安装模块

简介: linux基础组件安装模块linuxbaseinstall更换源,安装gcc gcc-c++ glibc-devel make ncurses-devel openssl-devel autoconf gitmkdir -p /etc/puppet...

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"

目录
相关文章
|
3天前
|
关系型数据库 MySQL Linux
【MySQL】如何在Linux上安装MySQL
【MySQL】如何在Linux上安装MySQL
30 1
|
6天前
|
Linux 测试技术 开发工具
Linux系统之advcpmv工具的安装和基本使用
【5月更文挑战第21天】Linux系统之advcpmv工具的安装和基本使用
16 2
|
7天前
|
NoSQL Linux 测试技术
如何在Linux环境下安装Redis呢?
如何在Linux环境下安装Redis呢?
|
9天前
|
关系型数据库 MySQL Linux
在Linux系统中安装MySQL数据库
在Linux系统中安装MySQL数据库
55 3
|
10天前
|
Ubuntu 关系型数据库 MySQL
|
10天前
|
Kubernetes Linux KVM
|
10天前
|
运维 Java Linux
Linux安装Maven_linux安装maven4
Linux安装Maven_linux安装maven4
Linux安装Maven_linux安装maven4
|
10天前
|
运维 Java 关系型数据库
Linux安装Maven_linux安装maven4(1)
Linux安装Maven_linux安装maven4(1)
Linux安装Maven_linux安装maven4(1)
|
10天前
|
Linux Docker 容器
最全树莓派4B安装docker-compose(64位Linux)(1),2024年最新一文说清
最全树莓派4B安装docker-compose(64位Linux)(1),2024年最新一文说清
|
10天前
|
运维 Linux 程序员
最全树莓派4B安装64位Linux(不用显示器键盘鼠标),Linux运维面试送分题
最全树莓派4B安装64位Linux(不用显示器键盘鼠标),Linux运维面试送分题
最全树莓派4B安装64位Linux(不用显示器键盘鼠标),Linux运维面试送分题