puppet-노트 1

2102 단어 필기puppetansible
master--------------에이전트 인증서 암호화
192.168.2.130   puppet.hequan.lol  puppet
192.168.2.131   station.hequan.lol  station


  
master:  yum install  puppet.noarch          puppet-server.noarch
agent:   yum install  puppet.noarch


[root@puppet puppet]# ls
auth.conf  fileserver.conf  manifests  modules  puppet.conf
vim puppet.conf
  1 [master]
  2         certname=puppet.hequan.lol
[root@puppet puppet]# puppet master
[root@puppet puppet]# netstat -lntup | grep 8140
tcp        0      0 0.0.0.0:8140            0.0.0.0:*               LISTEN      2580/ruby           
[root@station ~]# puppet agent      --server=puppet.hequan.lol   --no-daemonize    --verbose  --onetime ##    puppet
[root@puppet puppet]# ll /var/lib/puppet/ssl/ca/requests/  
-rw-r--r-- 1 puppet puppet 1598 8   31 20:38 station.hequan.lol.pem
[root@puppet puppet]# puppet cert --list
  "station.hequan.lol" (SHA256) 35:BD:28:6C:18:5D:58:3F:EF:60:F6:2D:6E:5D:5A:B7:16:02:36:84:48:08:31:32:28:DF:C7:BD:A6:65:9F:E9
  
  
puppet cert --sign  station.hequan.lol     ##all             


[root@puppet puppet]# ll /var/lib/puppet/ssl/ca/signed/       ##    ,             
    8
-rw-r--r-- 1 puppet puppet 2009 8   31 20:34 puppet.hequan.lol.pem
-rw-r--r-- 1 puppet puppet 1960 8   31 20:41 station.hequan.lol.pem


/etc/puppet/manifests   ##       ,            ,   xxx.pp
[root@puppet manifests]# ll
-rw-r--r-- 1 root root 159 8   31 20:58 node.pp
-rw-r--r-- 1 root root  53 8   31 20:48 site.pp



[root@puppet manifests]# cat site.pp
$puppetserver="puppet.hequan.lol"
import   'node.pp'
[root@puppet manifests]# cat node.pp
node  'station.hequan.lol'  {
                #       :
                #    {'   ':  1=>' 1'}
                package{"system-config-date":ensure=>'present'}
}
package {'nginx':
        ensure  => present,
}
        file {"/root/aa1.txt":
          ensure=>"present",
          mode=>"0000"
}
[root@station puppet]# ll /root
    4
----------  1 root root   0 8   31 21:26 aa1.txt

좋은 웹페이지 즐겨찾기