'Puppet'에 해당되는 글 2건

  1. 2014.05.19 puppet Resource
  2. 2014.05.14 [puppet] puppet 설치

puppet Resource

나만의 Cloud 2014. 5. 19. 14:17

Resource : Imagine a system’s configuration as a collection of many independent atomic units; call them“resources.”

- 한글로 번역하려니 .. 뜻이 애매..........

user account/file/directory/package/service/cron_job 등등...chef의 resource와 비슷한 개념인것 같다.

 

puppet의 resource는 resource type / title / attributes / value 4가지로 구성 

실 예로)

#puppet resource service

service { 'sshd':
  ensure => 'running',
  enable => 'true',
}
service { 'start-ttys':
  ensure => 'stopped',
  enable => 'true',
}

$puppet resource user

user { 'puppet':
  ensure           => 'present',
  comment          => 'Puppet',
  gid              => '52',
  home             => '/var/lib/puppet',
  password         => '!!',
  password_max_age => '-1',
  password_min_age => '-1',
  shell            => '/sbin/nologin',
  uid              => '52',
}

'나만의 Cloud' 카테고리의 다른 글

ansible 설치 및 기본 구성  (0) 2015.08.21
Virtual box Vagrant  (0) 2015.07.09
[puppet] puppet 설치  (0) 2014.05.14
[chef] chef 참고자료  (0) 2014.04.28
[git] git란?  (0) 2014.04.23
Posted by 뭉탁거림
,

puppet 설치 (CentOS6.3 기준)


0. Pre OS setting
FQDN 방식으로 hostname 설정
DNS 서버가 없기 때문에 hosts파일에 서버 등록

1. puppet labs repository 추가

sudo rpm -ivh http://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm


2. puppet labs repository Enable
fter installing the repos, open your /etc/yum.repos.d/puppetlabs.repo file for editing. Locate the[puppetlabs-devel] stanza, and change the value of the enabled key from 0 to 1:

3. Puppet Master server 설치
yum intstall ruby
yum install puppet-server

puppet.conf 파일에 아래 내용 추가

Config Sections

[main]
    certname = puppetmaster01.example.com


sudo puppet master --verbose --no-daemonize
puppet cert --all and --list

4. Puppet agent 설치

yum intstall ruby
yum install puppet
puppet agent --server mjstest.wlstn.com --no-daemonize --verbose

Config Sections

[agent]
    certname = puppetclient1.example.com


Master to Agent 연동  

 

     Master 와 각 Agent는 SSL 통신을 합니다. Master 입장에서는 승인된 Agent정보가 필요하며, 
     반대로 Agent도 승인된 Master가 필요 합니다. 즉 쌍뱡향 SSL 승인절차를 필요 합니다.
     서로 같에 SSL 승인이 되지 않으면 연동 자체가 불가 합니다.
     Puppet 같은 경우는 자체 CA (certificate authority) 인증 기관이 있고,  SSL 인증을 최적화
     되어 있습니다. 
     이유는 공인인증서를 발급하면 비용이 들어가는데, 만약 Agent가 100대 이상이면 
     비용이 만만치 않습니다. 
     그래서 공인인증 수준의 SSL 인증 발급을 쉽게 할수 있도록 지원을 합니다.
     Puppet은 큰 특징 중 하나가 바로 SSL 인증 발급을 하는 것입니다. 
     또한 Customize 할수 있는 기능도 제공 합니다.
     

     인증서 발급 FLOW는 아래와 같습니다.


               

 

     (1) Master 서버가 기동을 해서 Agent를 리스닝 합니다.

     (2) Agent는 서버에 접속을 합니다. 
     (3) Master는 Agent의 도메인 정보를 얻은 후 SSL을 발급 합니다.
     (4) 발급된 ".pem" 파일을 Agent에 전송 합니다.

     (5) Agent는 "/etc/puppet/ssl" 폴더에 서버 와 본인 인증서를 저장 합니다.
     (6) 이후 부터는 인증서를 통해서 ssl 통신을 합니다.


  • Master 기동

 

     puppet master --no-daemonize -d -v

 

  • Agent 기동

 

     puppet agent --server [서버 도메인] --no-daemonize --verbose         

 

  • puppet.conf 조회


     vi /etc/puppet/puppet.conf

  • 인증서 조회

 

     puppet cert --all and --list

 

  • 인증서 추가


     puppet cert --sign [Agent 도메인]

 

  • 인증서 삭제

 

     puppet  cert --clean [Agent 도메인]

 

  • 인증서 재발급 방법

 

     agent의 "/etc/puppet/ssl" 하위 디렉토리 및 파일 삭제

     master에서 "puppet  cert --clean"를 통한 도메인 삭제
      master에서   "puppet cert --sign" 재등록


출처) http://beyondj2ee.pbworks.com/w/page/51641649/BeyondJ2EE-Puppet%20%EC%84%A4%EC%B9%98

'나만의 Cloud' 카테고리의 다른 글

Virtual box Vagrant  (0) 2015.07.09
puppet Resource  (0) 2014.05.19
[chef] chef 참고자료  (0) 2014.04.28
[git] git란?  (0) 2014.04.23
[chef] chef 서버가 IP가 변경 시  (0) 2014.02.13
Posted by 뭉탁거림
,