Puppet, Ansible, Salt: Maturidade, Simplicidade e Flexibilidade

42

Transcript of Puppet, Ansible, Salt: Maturidade, Simplicidade e Flexibilidade

PuppetMaster

PuppetDB

PuppetExplorer* Mcollective

Server

PuppetAgent

McollectiveClient

McollectiveServer

PuppetAgent

ArquiteturaPuppet

ControlMachine

AnsibleTower/Rundeck

PowershellRemoting

SSHServer

"Arquitetura"Ansible

ControlMachine

SaltMaster

Saltpad*

ArquiteturaSalt

salt-ssh SaltMinionZeroMQ

SaltMinionZeroMQ

SaltMinionSSH

package{'openssh-server':ensure=>installed,}

file{'/etc/ssh/sshd_config':source=>'file:///vagrant/puppet/sshd_config',owner=>'root',group=>'root',mode=>'0644',notify=>Service['ssh']#require=>Package['openssh-server'],}

service{'ssh':ensure=>running,enable=>true,}

-hosts:allname:InstallSSHServertasks:-package:name=openssh-serverstate=present-template:src:sshd_configdest:/etc/ssh/sshd_configowner:rootgroup:rootmode:0644notify:-restartssh-service:name=sshstate=startedhandlers:-name:restartsshservice:name=sshstate=restarted

openssh-server:pkg.installed:-name:openssh-serverservice.running:-name:ssh-enable:True

file.managed:-name:/etc/ssh/sshd_config-source:salt://sshd_config-user:root-group:root-mode:644-watch_in:-service:openssh-server

$binaries=["run","build","update","foo"]

$binaries.each|String$binary|{file{"/usr/local/bin/myapp-$binary":ensure=>link,target=>"/opt/myapp/bin/$binary",}}

-hosts:alltasks:-name:createsymlinksforourappfile:>state=linksrc=/opt/myapp/bin/{{item}}dest=/usr/local/bin/myapp-{{item}}force=yeswith_items:-run-build-update-foo

{%forbinaryin['run','build','update','foo']%}/usr/local/bin/myapp-{{binary}}:file.symlink:-target:/opt/myapp/bin/{{binary}}{%endfor%}