CentOS 7に基づいてpppetを設置する。

2836 ワード


1準備
  • 台のセンター7(マスター:192.168.103 client:192.168.106)
  • は、それぞれrpm -i http://yum.puppetlabs.com/el/7/products/x86_64/puppetlabs-release-7-11.noarch.rpm
  • を実行する。
    2マスター
    hostnameを設置するnmtui->set system hostname->puppet.example.netホームを設けるvi /etc/hosts増加192.168.1.103 puppet.example.netpppet serverをインストールしますyum -y install puppet puppet-serverpppet materの設定/etc/puppet/puppet.conf 追加
    [master]
    certname = puppet.example.net
    
    pppetmasterを起動しますsystemctl start puppetmastersystemctl enable puppetmaster3 Client
    hostnameを設置するnmtui->set system hostname->agent1.example.netホームを設けるvi /etc/hosts増加
    192.168.1.106 agent1.example.net
    192.168.1.103 puppet.example.net
    
    pppet agentをインストールするyum -y install puppet puppet-server4テスト
    client実行:puppet agent --test出力
    Info: Creating a new SSL key for agent1.example.net
    Info: Caching certificate for ca
    Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
    Info: Creating a new SSL certificate request for agent1.example.net
    Info: Certificate Request fingerprint (SHA256): DB:21:15:C8:90:E4:2D:54:53:4C:A5:9A:4A:00:50:E7:99:5B:73:EE:0C:23:F9:7B:36:99:34:CD:FE:E6:DF:DA
    Info: Caching certificate for ca
    Exiting; no certificate found and waitforcert is disabled
    
    
    最後の行はエラーではありません。
    マスター実行:
  • puppet cert list 出力:
  • "agent1.example.net" (SHA256) 14:7D:AA:34:C8:F1:70:28:B9:51:A6:7D:94:3F:69:92:8F:61:94:17:7D:4A:EF:F2:44:CC:4A:BC:6B:D5:C3:EC
    
  • puppet cert sign agent1.example.netまたはpuppet cert sign --all出力:
  • Notice: Signed certificate request for agent1.example.net
    Notice: Removing file Puppet::SSL::CertificateRequest agent1.example.net at '/var/lib/puppet/ssl/ca/requests/agent1.example.net.pem'
    
    クリーン再実行puppet agent --test出力:
    Info: Caching certificate for agent1.example.net
    Info: Caching certificate_revocation_list for ca
    Info: Caching certificate for agent1.example.net
    Info: Retrieving pluginfacts
    Info: Retrieving plugin
    Info: Caching catalog for agent1.example.net
    Info: Applying configuration version '1428474782'
    Info: Creating state file /var/lib/puppet/state/state.yaml
    Notice: Finished catalog run in 0.05 seconds
    
    
    ウェブページのフォーマットに問題があれば、アクセスしてください。
    142