设为首页 收藏本站
查看: 1108|回复: 0

[经验分享] Puppet Installation Guide on Ubuntu12.04

[复制链接]

尚未签到

发表于 2015-11-26 14:57:37 | 显示全部楼层 |阅读模式
Pre-Install
OS/Ruby Version
·        See the supported
platforms
guide.
·        If your OS is older than the supported versions, you may still be able to run Puppet if you install an updated version of Ruby. See the list
of supported Ruby versions
.

Deployment Type
Decide on a deployment type before installing:



  • Agent/master
  
  Agent nodes pull their configurations from a puppet master server. Admins must manage node certificates, but will only have to maintain manifests and modules on the puppet master server(s), and can more easily take advantage
of features like reporting and external data sources.


You must decide in advance which server will be the master;install Puppet on it before installing on any agents. The master should be a dedicated machine with a fast processor, lots of RAM, and a fast
disk.




  • Standalone
  
  Every node compiles its own configuration from manifests. Admins must regularly sync Puppet manifests and modules to every node.
  



Network
In an agent/master deployment, you must prepare your network for Puppet’s traffic.



  •     Firewalls: The puppet master server must allow incoming connections on port 8140,
    and agent nodes must be able to connect to the master on that port.

  •     Name resolution: Every node must have a unique host name. Forward
    and reverse DNS
    must both be configured correctly. Instructions for configuring DNS are beyond the scope of this guide. If your site lacks DNS, you must write an /etc/hosts file
    on each node.

  
Note: The default master host name is puppet.
Your agent nodes will be ready sooner if this host name resolves to your puppet master.




Installing Puppet

1. Choose a Package Source
  Debian and Ubuntu systems can install Puppet from Puppet Labs’official repo, or from the OS vendor’s default repo.

UsingPuppet Labs’ Packages
  Puppet Labs provides an official package repo at apt.puppetlabs.com.It contains
up-to-date packages, and can install Puppet and its prerequisites without requiring any other external repositories.

  To use the Puppet Labs repo, follow
the instructions here
.

To enable the repository:
1.       Download the “puppet labs-release” package for your OS version.
You can see a full list of these packages on the front page of http://apt.puppetlabs.com/.
They are all named
puppetlabs-release-<CODE NAME>.deb.
2.      Install the package by running

dpkg -i <PACKAGENAME>

.  
For example, to enable the repository for Ubuntu 12.04 Precise Pangolin:


$ wget http://apt.puppetlabs.com/puppetlabs-release-precise.deb
$ sudo dpkg -i puppetlabs-release-precise.deb
$ sudo apt-get update


  

2. Install the Puppet Master
  Skip this step for a standalone deployment.
  On your puppet master node,run sudo apt-get install puppetmaster. This will install Puppet,
its prerequisites, and an init script (
/etc/init.d/puppetmaster) for running a test-quality puppet master server.

3. Install Puppet on Agent Nodes
  On your other nodes, run sudo apt-getinstall puppet. This will install Puppet and an init
script (
/etc/init.d/puppet) for running the puppet agent daemon.
  For a standalone deployment,run sudo apt-get install puppet-common on
all nodes instead. This will install Puppet without the agent init script.


Post-Install
  Perform the following tasks after you finish installing Puppet.

Configure Puppet
  Puppet’s main configuration file is found at /etc/puppet/puppet.conf. See Configuring
Puppet
for more details.
  Most users should specify the following settings:

On Agent Nodes
  Settings for agent nodes should go in the [agent] or [main] block
of
puppet.conf.
·        server:The
host name of your puppet master server. Defaults to
puppet.
·        report:Most
users should set this to
true.
·        pluginsync:
Most users should set this to
true.
·        certname:
The site wide unique identifier for this node. Defaults to the node’s fully qualified domain name, which is usually fine.


On Puppet Masters
  Settings for puppet master servers should go in the [master] or [main] block
of
puppet.conf.
  Note: puppet masters are usually also agent nodes; settings in [main] will
be available to both services, and settings in the
[master] and [agent] blocks
will override the settings in
[main].
·        dns_alt_names:A
list of valid host names for the master, which will be embedded in its certificate. Defaults to the puppet master’s
certname and puppet,
which is usually fine. If you are using a non-default setting, set it
before starting the puppet master for the first time.

OnStandalone Nodes
  Settings for standalone puppet nodes should go in the [main] block
of
puppet.conf.
  Puppet’s default settings are generally appropriate for standalone nodes. No additional configuration is necessary unless you intend to use centralized reporting or an external
node classifier
.



Startand Enable the Puppet Services

Sign Node Certificates
In an agent/master deployment, an admin must approve a certificate request for each agent node before that node can fetch configurations. Agent nodes will request certificates the first time they attempt
to run.

·        Periodically log into the puppet master server and run sudo puppet cert list to
view outstanding requests.

·        Agent node will request the ssl connection at the first try.



#puppet agent --no-daemonize --onetime --verbose --debug --server=master-server
  
·        Puppet master server has to sign the client ssl request and setup the connection.



#puppet agent cert –sign puppet-client
  
·        Run sudo puppet cert sign<NAME> to
sign a request, or
sudo puppet cert sign--all to sign all pending requests.
·        Check current client request status.



#puppet cert list –all

the request start with “&#43;” means signed SLL.  
An agent node whose request has been signed on the master will run normally on its next attempt.

Example: (Create a file at client server with “Hello Puppet!”content.)
1.   Create file at server side.



#vim /etc/puppet/manifests/site.pp

classtest_class {
file { &quot;/tmp/HelloPuppet.txt&quot;:
content => “Hello Puppet!”,
ensure => present,
mode  => 644,
owner => root,
group => root
}
}
# tellpuppet on which client to run the class
node  client {
include test_class
}


  
2.    On the client run the below cmd.



#puppet agent –test –server=master-server
  

The file with specified content has been created on client side.
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-143980-1-1.html 上篇帖子: Puppet 资料整理 下篇帖子: Puppet安装以及集成Dashboard手册
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表