Slide 1

Slide 1 text

     -- We can do it. scott.liao  Mr. 

Slide 2

Slide 2 text

104   DevOps, AWS and more … • Blog Mr.  • Gitbook Puppet   • Github @shazi7804 • iT   Ops  - Puppet  

Slide 3

Slide 3 text

Puppet x 104

Slide 4

Slide 4 text

What’s Puppet

Slide 5

Slide 5 text

 x IaC x 

Slide 6

Slide 6 text

vs. vs.

Slide 7

Slide 7 text

Why Puppet

Slide 8

Slide 8 text

    "  Github  ! AWS 

Slide 9

Slide 9 text

*

Slide 10

Slide 10 text

 104  DevOps 

Slide 11

Slide 11 text

How To ….

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text



Slide 14

Slide 14 text

 DevOps

Slide 15

Slide 15 text

Who care

Slide 16

Slide 16 text

Who cares ⣐褕茒▁ U

Slide 17

Slide 17 text

     

Slide 18

Slide 18 text

       *

Slide 19

Slide 19 text

     * 

Slide 20

Slide 20 text

     *   

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

      1 2 3 PLANNING

Slide 23

Slide 23 text

      1 2 3 PLANNING • Users, Groups • SNMP • Hostname • Motd • Profile • NTP • Backup

Slide 24

Slide 24 text

      1 2 3 PLANNING • Users, Groups • SNMP • Hostname • Motd • Profile • NTP • Backup • Apache / Tomcat / Java • Apache / PHP • Nginx / NodeJS • Nginx / PHP • Nginx / Python

Slide 25

Slide 25 text

      1 2 3 PLANNING • Users, Groups • SNMP • Hostname • Motd • Profile • NTP • Backup • Apache / Tomcat / Java • Apache / PHP • Nginx / NodeJS • Nginx / PHP • Nginx / Python •   •   • All Server

Slide 26

Slide 26 text

Manifest node ^www\.104\.com\.tw$ { # manage basic configuration package { 'ntp': ensure => present } # manage users and groups group { 'devopsdays': ensure => present } user { 'scott.liao': ensure => present, comment => ’DevOpsDays Taipei 2018 speaker', home => '/104corp/scott.liao', groups => 'devopsdays', } # manage application package { 'apache2': ensure => present } package { 'php7.0': ensure => present } } •   •  Ansible  playbook • Puppet  Coding

Slide 27

Slide 27 text

Coding Module •   •  class basic { package { 'ntp': ensure => present } } class users { group { 'devopsdays': ensure => present } user { 'scott.liao': ensure => present, comment => 'DevOpsDays Taipei 2018 speaker', home => '/104corp/scott.liao', groups => 'devopsdays', } } class web { package { 'apache2': ensure => present } package { 'php7.0': ensure => present } }

Slide 28

Slide 28 text

Coding Role and Profile •  •   class role::web { include profile::basic include profile::users include profile::web } class profile::basic { … } class profile::users { … } class profile::web { … } node ^www\.104\.com\.tw$ { include role::web }

Slide 29

Slide 29 text

 CronJob 

Slide 30

Slide 30 text

Sync of puppet runinterval (default)

Slide 31

Slide 31 text

Sync of puppet fqdn_rand # When reboot after sync puppet @reboot /opt/puppetlabs/bin/puppet agent –t # Generates random time of sync puppet 2,12,22,32,42,52 * * * * sleep 12; /opt/puppetlabs/bin/puppet agent –t • Hash with fqdn • random and limit

Slide 32

Slide 32 text

 CI / CD  IaC

Slide 33

Slide 33 text

IaC with Puppet CI / CD •  •   •  •  hiera   •  |-- Gemfile |-- Puppetfile |-- Rakefile |-- autosign.conf |-- data |-- environments |-- dev |-- production |-- hiera.yaml |-- private |-- profile |-- role |-- spec # module manage # node auto sign # hiera data # manifests # hiera config # private module # profile # role # test case

Slide 34

Slide 34 text

IaC with Puppet Module manage • Framework • r10k • librarian-puppet • Module provider • Puppetlabs • voxpupuli (Github) • official

Slide 35

Slide 35 text

IaC with Puppet Test Framework • rspec-puppet (unit test) • puppet-lint (coding style) • puppetlabs_spec_helper (module testing) • beaker-rspec (acceptance test)

Slide 36

Slide 36 text

    facter 

Slide 37

Slide 37 text

Facter and Dashboard Node PuppetDB Dashboard • Dashboard • Puppet Enterprise • Puppetboard • Grafana with prometheus_reporter • Custom from Puppetdb

Slide 38

Slide 38 text

Puppet in 104 Corp 727 Population 118401 Resource 1Y7M Time 10 Module

Slide 39

Slide 39 text

We can do it.

Slide 40

Slide 40 text

Thank You

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content