Build Puppet Clusters with Vagrant
$ cd ~/docs/propuppetex/chapter3
$ cat Vagrantfile
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "centos64"
config.vm.define "ppt" do |ppt|
ppt.vm.hostname = "puppet.boco.com.cn"
ppt.vm.network "private_network", ip: "192.168.50.3",
virtualbox__intnet: "gcptest-network"
ppt.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--natnet1", "10.3/16"]
end
ppt.vm.provision :shell, path: "master.sh"
end
config.vm.define "web" do |web|
web.vm.hostname = "web.boco.com.cn"
web.vm.network "private_network", ip: "192.168.50.4",
virtualbox__intnet: "gcptest-network"
web.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--natnet1", "10.3/16"]
end
web.vm.provision :shell, path: "web.sh"
end
end
$ cat master.sh
echo '*' > /etc/puppet/autosign.conf
sed -i '/[.*]/ a \ autosign = true' /etc/puppet/puppet.conf # add "autosign = true" in [main] and [agent]
echo "192.168.50.3 puppet.boco.com.cn puppet" >> /etc/hosts
echo "192.168.50.4 web.boco.com.cn web" >> /etc/hosts
mkdir /etc/puppet/manifests
cat > /etc/puppet/manifests/site.pp <<-EOF
node 'web' {
file { '/home/vagrant/aaa.conf':
content => 'this is made by puppet master!',
}
}
EOF
service iptables stop
$ cat web.sh
sed -i '1 a \ master = puppet' /etc/puppet/puppet.conf # add "master = puppet" after the line [main]
echo "192.168.50.3 puppet.boco.com.cn puppet" >> /etc/hosts
echo "192.168.50.4 web.boco.com.cn web" >> /etc/hosts
echo "proxy=http://10.21.3.31:8888" >> /etc/yum.conf
service iptables stop
Now run "puppet master --no-daemonize --verbose" on ppt, run "puppet agent --test" on web, you can file the file "aaa.conf" at /home/vagrant.
Build Puppet Clusters with Vagrant的更多相关文章
- 让 VAGRANT 启动并运行起来
这是一个帮助你快速入门Vagrant的初级教程.官方文档也可以很好的帮助你入门,但是本文更针对完全零基础的初学者并且会对某些问题直接切入正题. 本文在任何方面都不会取代官方文档,而且我建议读完本文的人 ...
- Create Virtual Machines with Vagrant and Puppet
Create the following puppet manifest and start VM with vagrant, you get a base production environmen ...
- vagrant
puppet chef ansible salt docker https://github.com/ansible/ansiblehttps://github.com/saltstack/salth ...
- Vagrant 快速入门
1. Vagrant功能: Vagrant uses Oracle’s VirtualBox to build configurable, lightweight, and portable virt ...
- Vagrant入门[转]
Vagrant是一个简单易用的部署工具,用英文说应该是orchestration tool.它能帮助开发人员迅速的构建一个开发环境,帮助测试人员构建测试环境. Vagrant的基本工作原理大致如下: ...
- vagrant打造自己的开发环境
vagrant打造自己的开发环境 缘由: 在网上看到斌哥,爽神都写了关于vagrant的博客,都在说很强大,所以很好奇这玩意怎么个强大,然后也就自己来一发玩玩看看. 真实缘由: 说实话是电脑配置太低, ...
- 使用 Vagrant 构建开发环境
使用 Vagrant 构建开发环境 摘要:本文描述了如使用 Vagrant 构建统一的开发环境. 问题 作为开发人员,我们通常面临的问题有: 开发环境需要手工安装配置,这包括操作系统(CentOS.U ...
- 使用 Vagrant + VirtualBox 快速构建 CentOS 下的 Docker 环境
Vagrant - 基础概念: Vagrant 是什么? Vagrant是一款用于在单个工作流程中构建和管理虚拟机环境的工具.凭借易于使用的工作流程和专注于自动化,Vagrant降低了开发环境设置时间 ...
- 超详细的 Vagrant 上手指南
搭建 Linux 虚拟机,别再用 VirtualBox 从 .iso 文件安装了. 概述 2020 年了,也许你已经习惯了 docker,习惯了在 XX 云上快速创建云主机,但是如果你想在个人电脑上安 ...
随机推荐
- docker安装和配置nginx
配置nginx docker配置nginx 本机ip是192.168.0.200 docker pull nginx 配置nginx主机 vi /root/docker/nginx/nginx01.c ...
- [小技巧] Notepad++关闭拼写检查
From : http://blog.csdn.net/xuefeng0707/article/details/18272989 把[插件]-[DSpellCheck]-[Spell Check Do ...
- Leetcode No.35 Search Insert Position(c++实现)
1. 题目 1.1 英文题目 Given a sorted array of distinct integers and a target value, return the index if the ...
- gitlab用户,组,项目权限管控
前言:gitlab上的权限管控是非常重要的,尤其是很多研发人员开发一个项目.这个是我总结的权限管控. 1.这个是创建项目时开放权限设置 2.这个创建用户设置的权限 3.用户权限,5种类型用户是 ...
- python django与celery的集成
一.celery与django 关于celery介绍和使用可以查看上篇Python中任务队列-芹菜celery的使用 关于django的介绍和使用可查看python django框架+vue.js前后 ...
- Linux sudo命令——sudoers文件的配置
Linux sudo命令与其配置文件/etc/sudoers 对linux有一定了解的人多少也会知道点关于sudo命令.sudo命令核心思想是权限的赋予 ,即某个命令的所属用户不是你自己,而你却有 ...
- shell脚本编写规范和相关变量类型
shell编程规范与变量 一.shell脚本概述 ① 什么是shell? Linux中有哪些shell? ② shell的作用 ③ 用户的登录shell ④ shell脚本 ...
- python 得到变量名的结果为名的变量的值locals()
>>> a="1">>> b="a">>> print(a,b)1 a>>> print ...
- 高校表白App-团队冲刺第四天
今天要做什么 就如昨天所说,今天继续进行引导页制作的学习.并开始通过ViewPager做简单的布局与Activity. 遇到的问题 本来以为只是使用一个ViewPager控件就可以搞定,原来还是需要配 ...
- CF1330B题解
题意: 给定一个长为 \(n\) 序列 \(a\) ,问是否能分成两个排列,并输出方案 (排列:从 \(1-n\) 中选取不同的 \(n\) 个元素组成的序列) 思路: 观察数据范围可以猜出,这题 \ ...