Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Tutorial Puppet

Tutorial dos conceitos básicos de Puppet, uma ferramenta de gestão automática de configuração de servidores.

Essa apresentação está incompleta, pois foi parte de um curso básico sobre Puppet.

Related Books

Free with a 30 day trial from Scribd

See all
  • Be the first to comment

Tutorial Puppet

  1. 1. ExercícioDistribuir configuração de clientes Zabbix (monitoração)
  2. 2. ConceitosResource user { ze: ensure => present, Type gid => 1000, User, File, Package require => Group[ze], } Name Attributes Meta AttributesClassesDefinitionsModules
  3. 3. Exemplo Simples - LocalesConfigurar locales em um servidor Pacote locales Arquivo /etc/default/locale Arquivo /etc/locale.gen Executar /usr/sbin/locale.genCódigo fonte em: https://github.com/dcsobral/puppet-exemplo-locale
  4. 4. Experimentando com a linha de Comandoralsh puppet:~# ralsh user bob user { bob: ensure => absent } puppet:~# ralsh user bob ensure=present notice: /User[bob]/ensure: created user { bob: ensure => present } puppet:~# ralsh user bob ensure=absent notice: /User[bob]/ensure: removed user { bob: ensure => absent }
  5. 5. Experimentando com a linha de Comandopuppet describe dcs@puppet:~/exemplo$ puppet describe package -s package ======= descrição e funcionamento Parameters ---------- adminfile, allowcdrom, category, configfiles, description, ensure, flavor, instance, name, platform, responsefile, root, source, status, type, vendor Providers --------- aix, appdmg, apple, apt, aptitude, aptrpm, blastwave, darwinport, dpkg, fink, freebsd, gem, hpux, nim, openbsd, pkg, pkgdmg, portage, ports, portupgrade, rpm, rug, sun, sunfreeware, up2date, urpmi, yum, zypper
  6. 6. Criando Arquivospackage { locales: ensure => installed,}
  7. 7. Puppet Applypackage { locales: ensure => installed,}file { /etc/default/locale: ensure => present, content => LANG=pt_BR.UTF-8,}
  8. 8. Dependênciaspackage { locales: ensure => installed,}file { /etc/default/locale: ensure => present, content => LANG=pt_BR.UTF-8, require => Package[locales],}
  9. 9. Outros Atributospackage { locales: ensure => installed,}file { /etc/default/locale: ensure => present, content => LANG=pt_BR.UTF-8, require => Package[locales], owner => root, group => root, mode => 644,}
  10. 10. Enviando Arquivosfile { /etc/locale.gen: ensure => present, source => /root/exemplo/locale.gen, require => Package[locales], owner => root, group => root, mode => 644,}
  11. 11. Executando Processosexec { /usr/sbin/locale-gen:}
  12. 12. Múltiplas Dependênciasexec { /usr/sbin/locale-gen: require => [ Package[locales],File[/etc/locale.gen] ],}
  13. 13. Notificaçõesexec { /usr/sbin/locale-gen: subscribe => File[/etc/locale.gen], require => [ Package[locales],File[/etc/locale.gen] ],}
  14. 14. Refreshexec { /usr/sbin/locale-gen: subscribe => File[/etc/locale.gen], refreshonly => true, require => [ Package[locales],File[/etc/locale.gen] ],}
  15. 15. Classes e Nósclass locale { package { locales: ensure => installed, } file { /etc/default/locale: ensure => present, content => LANG=pt_BR.UTF-8, require => Package[locales], } file { /etc/locale.gen: ensure => present, source => /root/exemplo/locale.gen, require => Package[locales], } exec { /usr/sbin/locale-gen: subscribe => File[/etc/locale.gen], refreshonly => true, require => [ Package[locales], File[/etc/locale.gen] ], }}node default { include locale}

×