Tp install anything

Alessandro Franceschi
Alessandro FranceschiFounder @ Lab42
tp install anything [anywhere(*)]
by Alessandro Franceschi @alvagante

Founder and CTO @example42

at #cfgmgmtcamp 2017
1
Tiny Puppet needs Puppet 4 (**)
• If Puppet is not installed, just feel reckless and run:

wget -O - https://bit.ly/installpuppet |
sudo bash
• Script removes old versions, detects OS, installs official
Puppet repos and then Puppet 4 agent
• (**) tp is optimised for Puppet4 but has defines compatible with Puppet 3:
tp::install3, tp::conf3, tp::dir3
2
"Piping the internet to my shell !?!?!"
• The https://bit.ly/installpuppet URL
redirects to a script in example42 control-repo:



https://raw.githubusercontent.com/example42/control-
repo/production/bin/puppet_install.sh
• Take your time to review it or just fire and forget




.



3
Install Tiny Puppet
• Usage from shell

puppet module install example42/tp

puppet tp setup

tp

• In Puppetfile for usage in manifests:

mod "example42/tp"

mod "example42/tinydata"
4
Yet Another Universal Installer
• al@localhost$ [sudo] tp install app
• It supports any application

on any operating system (*)
• It manages package repositories and other
dependencies
5
(*) Any Opeating System?
• RedHat and Debian derivatives always supported
• Suse, Alpine and other Linux distros need more tiny data
• Solaris, BSD, Darwin support partial but possible (may
miss data, tests and some features)
• Windows: WIP. Currently not supported
6
Some supported apps
• tp install docker-engine
• tp install sysdig
• tp install gitlab-ce
• tp install gitlab-runner
• tp install zabbix-agent
• tp install virtualbox
• tp install puppetserver
• tp install puppetdb
• tp install awscli
• tp install elasticsearch
7
All the supported apps
• By default TP uses tinydata as source for data about
applications
• Missing support for apps or OS is just a matter of

missing data
• github.com/example42/tinydata/
• You can use your own data module
8
Usage on cli: tp test to show apps status
• al@localhost$ tp test [app]
• Show status of all the applications managed by tp
• Can be automated in CI and testing
• Custom checks can be easily created
• If any of the apps fails, the global exit code is 1

9
Usage on cli: tp log to show apps logs
• al@localhost$ tp log [app]
• tail -f the log[s] of all or the written application
• Useful for quick debugging when unaware of log paths
• Customisations:
tp::install { 'redis':
settings_hash => {

log_file_path => '/opt/redis/redis.logs',

log_dir_path => '/opt/redis'

},
}

10
Usage on cli: tp list - tp uninstall
• al@localhost$ tp uninstall <app>
• Removes package and eventually repo file of an app
• al@localhost$ tp list
• List all the applications tp can install



11
Usage on manifests: tp::install
• Different options for tp::install. Here shown default values.
tp::install { 'postgresql':
ensure => present,
repo => undef,
auto_repo => true,
auto_prerequisites => false,
auto_conf => true,
options_hash => {},
settings_hash => {},
cli_enable => true,
test_enable => false,
puppi_enable => false,
}
12
Usage on manifests: tp::conf
• Manage configuration files of an app
tp::conf { 'nginx::example.com.conf':
ensure => present,
base_dir => 'confd',
$source => undef,
$template => undef,
$epp => undef,
$content => undef,
$base_dir => 'config',
$base_file => 'config',
$path => undef,
$config_file_notify => true,
$config_file_require => true,
$options_hash => { },
$settings_hash => { },
$data_module => tinydata
}
13
Usage on manifests: Test installed apps
• Testing of application can be enable by either one of:
tp::test { 'redis': }

tp::install { 'redis':
test_enable => true,

test_template => 'site/test/nginx.erb',
}
• A custom test script is created in /etc/tp/test/$app

Default tests use data from /etc/tp/app/$app
14
Essential acceptance tests
• TP be able to test an app (alternatives)


git clone https://github.com/example42/tp-acceptance
cd tp-acceptance
r10k puppetfile install
vagrant status
# Test munin on all supported OS
bin/test_app.sh munin all acceptance
# Test all apps on a specific OS
bin/test_app.sh all Centos7 acceptance
# Test all appas on all supporte OS

bin/test_app.sh all all acceptance
Compatibility Matrix
15
It's all about Tiny Data
• Data to manage apps on different OS is on separated tinydata
module
• Currently 149 applications supported (ls -1 data/ | wc -l)
• For each application a data/$app/hiera.yaml file define the
hierarchy to use for data lookup (erm, no, Hiera is not actually used):


---
:hierarchy:
- "%{title}/operatingsystem/%{operatingsystem}-%{operatingsystemmajrelease}"
- "%{title}/operatingsystem/%{operatingsystem}"
- "%{title}/osfamily/%{osfamily}"
- "%{title}/default"
- default
16
It's all about Tiny Data
• Eash data file, in YAML format, contains the info tp uses
to manage applications:

---
redis::settings:
package_name: 'redis'
service_name: 'redis'
config_file_path: '/etc/redis/redis.conf'
config_dir_path: '/etc/redis'
tcp_port: '6379'
pid_file_path: '/var/run/redis.pid'
log_file_path: '/var/log/redis.log'
log_dir_path: ''
process_user: 'redis'
process_group: 'redis'
17
Use cases - In manifests
• In local site profiles, when we have to configure
applications we know how to configure
• In component modules, with local tiny data
• tp can replace or coexist with component modules
18
Use cases - On the command line
• Quickly install applications
• Check if installed apps are working correctly:

monitoring, CI, runtime tests.
• Troubleshoot locally problems by quickly accessing logs
19
Thank you
• http://www.tiny-puppet.com
• @alvagante @example42
• Slides published on http://slideshare.net/alvagante
20
1 of 20

Recommended

Puppet Continuous Integration with PE and GitLab by
Puppet Continuous Integration with PE and GitLabPuppet Continuous Integration with PE and GitLab
Puppet Continuous Integration with PE and GitLabAlessandro Franceschi
1.1K views11 slides
Essential applications management with Tiny Puppet by
Essential applications management with Tiny PuppetEssential applications management with Tiny Puppet
Essential applications management with Tiny PuppetAlessandro Franceschi
2.1K views15 slides
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ... by
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...Puppet
3K views32 slides
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf... by
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...
Continuous Infrastructure: Modern Puppet for the Jenkins Project - PuppetConf...Puppet
5K views51 slides
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014 by
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Puppet
3K views28 slides
Test Driven Development with Puppet - PuppetConf 2014 by
Test Driven Development with Puppet - PuppetConf 2014Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014Puppet
5.4K views128 slides

More Related Content

What's hot

Bootstrapping Puppet and Application Deployment - PuppetConf 2013 by
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Puppet
10.8K views30 slides
Portland PUG April 2014: Beaker 101: Acceptance Test Everything by
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPortland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPuppet
2.1K views19 slides
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki... by
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet
2.9K views51 slides
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo... by
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Puppet
4.6K views36 slides
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec by
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpecTest-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpecMartin Etmajer
43.3K views60 slides
Killer R10K Workflow - PuppetConf 2014 by
Killer R10K Workflow - PuppetConf 2014Killer R10K Workflow - PuppetConf 2014
Killer R10K Workflow - PuppetConf 2014Puppet
12.2K views74 slides

What's hot(20)

Bootstrapping Puppet and Application Deployment - PuppetConf 2013 by Puppet
Bootstrapping Puppet and Application Deployment - PuppetConf 2013Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Bootstrapping Puppet and Application Deployment - PuppetConf 2013
Puppet10.8K views
Portland PUG April 2014: Beaker 101: Acceptance Test Everything by Puppet
Portland PUG April 2014: Beaker 101: Acceptance Test EverythingPortland PUG April 2014: Beaker 101: Acceptance Test Everything
Portland PUG April 2014: Beaker 101: Acceptance Test Everything
Puppet2.1K views
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki... by Puppet
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet2.9K views
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo... by Puppet
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Puppet4.6K views
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec by Martin Etmajer
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpecTest-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
Martin Etmajer43.3K views
Killer R10K Workflow - PuppetConf 2014 by Puppet
Killer R10K Workflow - PuppetConf 2014Killer R10K Workflow - PuppetConf 2014
Killer R10K Workflow - PuppetConf 2014
Puppet12.2K views
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014 by Puppet
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet8.8K views
Perl Dist::Surveyor 2011 by Tim Bunce
Perl Dist::Surveyor 2011Perl Dist::Surveyor 2011
Perl Dist::Surveyor 2011
Tim Bunce2.7K views
Take control of your Jenkins jobs via job DSL. by Łukasz Proszek
Take control of your Jenkins jobs via job DSL.Take control of your Jenkins jobs via job DSL.
Take control of your Jenkins jobs via job DSL.
Łukasz Proszek3.4K views
Software development practices in python by Jimmy Lai
Software development practices in pythonSoftware development practices in python
Software development practices in python
Jimmy Lai1.3K views
Experiences from Running Masterless Puppet - PuppetConf 2014 by Puppet
Experiences from Running Masterless Puppet - PuppetConf 2014Experiences from Running Masterless Puppet - PuppetConf 2014
Experiences from Running Masterless Puppet - PuppetConf 2014
Puppet7.8K views
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008) by Tim Bunce
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Tim Bunce1K views
Steamlining your puppet development workflow by Tomas Doran
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
Tomas Doran4.5K views
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long by OpenCredo
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
OpenCredo4K views
The Puppet Master on the JVM - PuppetConf 2014 by Puppet
The Puppet Master on the JVM - PuppetConf 2014The Puppet Master on the JVM - PuppetConf 2014
The Puppet Master on the JVM - PuppetConf 2014
Puppet4.9K views
DCSF 19 eBPF Superpowers by Docker, Inc.
DCSF 19 eBPF SuperpowersDCSF 19 eBPF Superpowers
DCSF 19 eBPF Superpowers
Docker, Inc.822 views
Building a Drupal site with Git by dirtytactics
Building a Drupal site with GitBuilding a Drupal site with Git
Building a Drupal site with Git
dirtytactics4.7K views
Testing Your Automation Code (Docker Version) by Mischa Taylor
Testing Your Automation Code (Docker Version)Testing Your Automation Code (Docker Version)
Testing Your Automation Code (Docker Version)
Mischa Taylor4K views

Similar to Tp install anything

Tiny Puppet Can Install Everything. Prove me wrong! by
Tiny Puppet Can Install Everything. Prove me wrong!Tiny Puppet Can Install Everything. Prove me wrong!
Tiny Puppet Can Install Everything. Prove me wrong!Alessandro Franceschi
42 views20 slides
ScalaUA - distage: Staged Dependency Injection by
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection7mind
1.4K views29 slides
LISA15: systemd, the Next-Generation Linux System Manager by
LISA15: systemd, the Next-Generation Linux System Manager LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager Alison Chaiken
1.1K views72 slides
CentOS 6 to CentOS 7 Upgrade Procedure by
CentOS 6 to CentOS 7 Upgrade ProcedureCentOS 6 to CentOS 7 Upgrade Procedure
CentOS 6 to CentOS 7 Upgrade ProcedureVEXXHOST Private Cloud
18 views9 slides
Splunk: Forward me the REST of those shells by
Splunk: Forward me the REST of those shellsSplunk: Forward me the REST of those shells
Splunk: Forward me the REST of those shellsAnthony D Hendricks
222 views30 slides
Tizen Web Application Checker by
Tizen Web Application CheckerTizen Web Application Checker
Tizen Web Application CheckerRyo Jin
1.7K views20 slides

Similar to Tp install anything(20)

ScalaUA - distage: Staged Dependency Injection by 7mind
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection
7mind1.4K views
LISA15: systemd, the Next-Generation Linux System Manager by Alison Chaiken
LISA15: systemd, the Next-Generation Linux System Manager LISA15: systemd, the Next-Generation Linux System Manager
LISA15: systemd, the Next-Generation Linux System Manager
Alison Chaiken1.1K views
Tizen Web Application Checker by Ryo Jin
Tizen Web Application CheckerTizen Web Application Checker
Tizen Web Application Checker
Ryo Jin1.7K views
Build and deployment by WO Community
Build and deploymentBuild and deployment
Build and deployment
WO Community1.1K views
How to test infrastructure code: automated testing for Terraform, Kubernetes,... by Yevgeniy Brikman
How to test infrastructure code: automated testing for Terraform, Kubernetes,...How to test infrastructure code: automated testing for Terraform, Kubernetes,...
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
Yevgeniy Brikman33.8K views
Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor... by Michael Lee
Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...
Setup of EDA tools and workstation environment variables in NCTU 307 Lab. wor...
Michael Lee1.9K views
My "Perfect" Toolchain Setup for Grails Projects by GR8Conf
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
GR8Conf4.4K views
Adop and maintenance task presentation 151015 by andreas kuncoro
Adop and maintenance task presentation 151015Adop and maintenance task presentation 151015
Adop and maintenance task presentation 151015
andreas kuncoro866 views
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview by Leo Lorieri
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Leo Lorieri2K views
Tamir Dresher - Demystifying the Core of .NET Core by Tamir Dresher
Tamir Dresher  - Demystifying the Core of .NET CoreTamir Dresher  - Demystifying the Core of .NET Core
Tamir Dresher - Demystifying the Core of .NET Core
Tamir Dresher353 views
Apigee deploy grunt plugin.1.0 by Diego Zuluaga
Apigee deploy grunt plugin.1.0Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0
Diego Zuluaga856 views
Tibet 5.0 / CouchDB by bedney
Tibet 5.0 / CouchDBTibet 5.0 / CouchDB
Tibet 5.0 / CouchDB
bedney591 views
Docker 102 - Immutable Infrastructure by Adrian Otto
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable Infrastructure
Adrian Otto1.3K views
The Popper Experimentation Protocol and CLI tool by Ivo Jimenez
The Popper Experimentation Protocol and CLI toolThe Popper Experimentation Protocol and CLI tool
The Popper Experimentation Protocol and CLI tool
Ivo Jimenez177 views
A Fabric/Puppet Build/Deploy System by adrian_nye
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
adrian_nye9.2K views
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red... by OpenShift Origin
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
Extending OpenShift Origin: Build Your Own Cartridge with Bill DeCoste of Red...
OpenShift Origin5K views

More from Alessandro Franceschi

DevOps - Evoluzione della specie - DevOps Heroes.pdf by
DevOps - Evoluzione della specie - DevOps Heroes.pdfDevOps - Evoluzione della specie - DevOps Heroes.pdf
DevOps - Evoluzione della specie - DevOps Heroes.pdfAlessandro Franceschi
30 views30 slides
ReUse Your (Puppet) Modules! by
ReUse Your (Puppet) Modules!ReUse Your (Puppet) Modules!
ReUse Your (Puppet) Modules!Alessandro Franceschi
991 views45 slides
Ten years of [Puppet] installations. What now? by
Ten years of [Puppet] installations. What now?Ten years of [Puppet] installations. What now?
Ten years of [Puppet] installations. What now?Alessandro Franceschi
585 views26 slides
Puppet Systems Infrastructure Construction Kit by
Puppet Systems Infrastructure Construction KitPuppet Systems Infrastructure Construction Kit
Puppet Systems Infrastructure Construction KitAlessandro Franceschi
1.6K views22 slides
Puppet control-repo 
to the next level by
Puppet control-repo 
to the next levelPuppet control-repo 
to the next level
Puppet control-repo 
to the next levelAlessandro Franceschi
2.1K views17 slides
Puppet: From 0 to 100 in 30 minutes by
Puppet: From 0 to 100 in 30 minutesPuppet: From 0 to 100 in 30 minutes
Puppet: From 0 to 100 in 30 minutesAlessandro Franceschi
1.6K views25 slides

More from Alessandro Franceschi(17)

Recently uploaded

Audience profile.pptx by
Audience profile.pptxAudience profile.pptx
Audience profile.pptxMollyBrown86
12 views2 slides
UiPath Document Understanding_Day 2.pptx by
UiPath Document Understanding_Day 2.pptxUiPath Document Understanding_Day 2.pptx
UiPath Document Understanding_Day 2.pptxRohitRadhakrishnan8
282 views21 slides
Opportunities for Youth in IG - Alena Muravska RIPE NCC.pdf by
Opportunities for Youth in IG - Alena Muravska RIPE NCC.pdfOpportunities for Youth in IG - Alena Muravska RIPE NCC.pdf
Opportunities for Youth in IG - Alena Muravska RIPE NCC.pdfRIPE NCC
9 views12 slides
informing ideas.docx by
informing ideas.docxinforming ideas.docx
informing ideas.docxMollyBrown86
12 views10 slides
We see everywhere that many people are talking about technology.docx by
We see everywhere that many people are talking about technology.docxWe see everywhere that many people are talking about technology.docx
We see everywhere that many people are talking about technology.docxssuserc5935b
6 views2 slides
Sustainable Marketing by
Sustainable MarketingSustainable Marketing
Sustainable MarketingTheo van der Zee
9 views50 slides

Recently uploaded(20)

Opportunities for Youth in IG - Alena Muravska RIPE NCC.pdf by RIPE NCC
Opportunities for Youth in IG - Alena Muravska RIPE NCC.pdfOpportunities for Youth in IG - Alena Muravska RIPE NCC.pdf
Opportunities for Youth in IG - Alena Muravska RIPE NCC.pdf
RIPE NCC9 views
We see everywhere that many people are talking about technology.docx by ssuserc5935b
We see everywhere that many people are talking about technology.docxWe see everywhere that many people are talking about technology.docx
We see everywhere that many people are talking about technology.docx
ssuserc5935b6 views
Building trust in our information ecosystem: who do we trust in an emergency by Tina Purnat
Building trust in our information ecosystem: who do we trust in an emergencyBuilding trust in our information ecosystem: who do we trust in an emergency
Building trust in our information ecosystem: who do we trust in an emergency
Tina Purnat85 views
IGF UA - Dialog with I_ organisations - Alena Muavska RIPE NCC.pdf by RIPE NCC
IGF UA - Dialog with I_ organisations - Alena Muavska RIPE NCC.pdfIGF UA - Dialog with I_ organisations - Alena Muavska RIPE NCC.pdf
IGF UA - Dialog with I_ organisations - Alena Muavska RIPE NCC.pdf
RIPE NCC15 views
UiPath Document Understanding_Day 3.pptx by UiPathCommunity
UiPath Document Understanding_Day 3.pptxUiPath Document Understanding_Day 3.pptx
UiPath Document Understanding_Day 3.pptx
UiPathCommunity95 views
google forms survey (1).pptx by MollyBrown86
google forms survey (1).pptxgoogle forms survey (1).pptx
google forms survey (1).pptx
MollyBrown8614 views
IETF 118: Starlink Protocol Performance by APNIC
IETF 118: Starlink Protocol PerformanceIETF 118: Starlink Protocol Performance
IETF 118: Starlink Protocol Performance
APNIC124 views
PORTFOLIO 1 (Bret Michael Pepito).pdf by brejess0410
PORTFOLIO 1 (Bret Michael Pepito).pdfPORTFOLIO 1 (Bret Michael Pepito).pdf
PORTFOLIO 1 (Bret Michael Pepito).pdf
brejess04107 views
𝐒𝐨𝐥𝐚𝐫𝐖𝐢𝐧𝐝𝐬 𝐂𝐚𝐬𝐞 𝐒𝐭𝐮𝐝𝐲 by Infosec train
𝐒𝐨𝐥𝐚𝐫𝐖𝐢𝐧𝐝𝐬 𝐂𝐚𝐬𝐞 𝐒𝐭𝐮𝐝𝐲𝐒𝐨𝐥𝐚𝐫𝐖𝐢𝐧𝐝𝐬 𝐂𝐚𝐬𝐞 𝐒𝐭𝐮𝐝𝐲
𝐒𝐨𝐥𝐚𝐫𝐖𝐢𝐧𝐝𝐬 𝐂𝐚𝐬𝐞 𝐒𝐭𝐮𝐝𝐲
Infosec train7 views
Serverless cloud architecture patterns by Jimmy Dahlqvist
Serverless cloud architecture patternsServerless cloud architecture patterns
Serverless cloud architecture patterns
Jimmy Dahlqvist17 views
Existing documentaries (1).docx by MollyBrown86
Existing documentaries (1).docxExisting documentaries (1).docx
Existing documentaries (1).docx
MollyBrown8613 views

Tp install anything

  • 1. tp install anything [anywhere(*)] by Alessandro Franceschi @alvagante
 Founder and CTO @example42 at #cfgmgmtcamp 2017 1
  • 2. Tiny Puppet needs Puppet 4 (**) • If Puppet is not installed, just feel reckless and run:
 wget -O - https://bit.ly/installpuppet | sudo bash • Script removes old versions, detects OS, installs official Puppet repos and then Puppet 4 agent • (**) tp is optimised for Puppet4 but has defines compatible with Puppet 3: tp::install3, tp::conf3, tp::dir3 2
  • 3. "Piping the internet to my shell !?!?!" • The https://bit.ly/installpuppet URL redirects to a script in example42 control-repo:
 
 https://raw.githubusercontent.com/example42/control- repo/production/bin/puppet_install.sh • Take your time to review it or just fire and forget 
 
 .
 
 3
  • 4. Install Tiny Puppet • Usage from shell
 puppet module install example42/tp
 puppet tp setup
 tp
 • In Puppetfile for usage in manifests:
 mod "example42/tp"
 mod "example42/tinydata" 4
  • 5. Yet Another Universal Installer • al@localhost$ [sudo] tp install app • It supports any application
 on any operating system (*) • It manages package repositories and other dependencies 5
  • 6. (*) Any Opeating System? • RedHat and Debian derivatives always supported • Suse, Alpine and other Linux distros need more tiny data • Solaris, BSD, Darwin support partial but possible (may miss data, tests and some features) • Windows: WIP. Currently not supported 6
  • 7. Some supported apps • tp install docker-engine • tp install sysdig • tp install gitlab-ce • tp install gitlab-runner • tp install zabbix-agent • tp install virtualbox • tp install puppetserver • tp install puppetdb • tp install awscli • tp install elasticsearch 7
  • 8. All the supported apps • By default TP uses tinydata as source for data about applications • Missing support for apps or OS is just a matter of
 missing data • github.com/example42/tinydata/ • You can use your own data module 8
  • 9. Usage on cli: tp test to show apps status • al@localhost$ tp test [app] • Show status of all the applications managed by tp • Can be automated in CI and testing • Custom checks can be easily created • If any of the apps fails, the global exit code is 1
 9
  • 10. Usage on cli: tp log to show apps logs • al@localhost$ tp log [app] • tail -f the log[s] of all or the written application • Useful for quick debugging when unaware of log paths • Customisations: tp::install { 'redis': settings_hash => {
 log_file_path => '/opt/redis/redis.logs',
 log_dir_path => '/opt/redis'
 }, }
 10
  • 11. Usage on cli: tp list - tp uninstall • al@localhost$ tp uninstall <app> • Removes package and eventually repo file of an app • al@localhost$ tp list • List all the applications tp can install
 
 11
  • 12. Usage on manifests: tp::install • Different options for tp::install. Here shown default values. tp::install { 'postgresql': ensure => present, repo => undef, auto_repo => true, auto_prerequisites => false, auto_conf => true, options_hash => {}, settings_hash => {}, cli_enable => true, test_enable => false, puppi_enable => false, } 12
  • 13. Usage on manifests: tp::conf • Manage configuration files of an app tp::conf { 'nginx::example.com.conf': ensure => present, base_dir => 'confd', $source => undef, $template => undef, $epp => undef, $content => undef, $base_dir => 'config', $base_file => 'config', $path => undef, $config_file_notify => true, $config_file_require => true, $options_hash => { }, $settings_hash => { }, $data_module => tinydata } 13
  • 14. Usage on manifests: Test installed apps • Testing of application can be enable by either one of: tp::test { 'redis': }
 tp::install { 'redis': test_enable => true,
 test_template => 'site/test/nginx.erb', } • A custom test script is created in /etc/tp/test/$app
 Default tests use data from /etc/tp/app/$app 14
  • 15. Essential acceptance tests • TP be able to test an app (alternatives) 
 git clone https://github.com/example42/tp-acceptance cd tp-acceptance r10k puppetfile install vagrant status # Test munin on all supported OS bin/test_app.sh munin all acceptance # Test all apps on a specific OS bin/test_app.sh all Centos7 acceptance # Test all appas on all supporte OS
 bin/test_app.sh all all acceptance Compatibility Matrix 15
  • 16. It's all about Tiny Data • Data to manage apps on different OS is on separated tinydata module • Currently 149 applications supported (ls -1 data/ | wc -l) • For each application a data/$app/hiera.yaml file define the hierarchy to use for data lookup (erm, no, Hiera is not actually used): 
 --- :hierarchy: - "%{title}/operatingsystem/%{operatingsystem}-%{operatingsystemmajrelease}" - "%{title}/operatingsystem/%{operatingsystem}" - "%{title}/osfamily/%{osfamily}" - "%{title}/default" - default 16
  • 17. It's all about Tiny Data • Eash data file, in YAML format, contains the info tp uses to manage applications:
 --- redis::settings: package_name: 'redis' service_name: 'redis' config_file_path: '/etc/redis/redis.conf' config_dir_path: '/etc/redis' tcp_port: '6379' pid_file_path: '/var/run/redis.pid' log_file_path: '/var/log/redis.log' log_dir_path: '' process_user: 'redis' process_group: 'redis' 17
  • 18. Use cases - In manifests • In local site profiles, when we have to configure applications we know how to configure • In component modules, with local tiny data • tp can replace or coexist with component modules 18
  • 19. Use cases - On the command line • Quickly install applications • Check if installed apps are working correctly:
 monitoring, CI, runtime tests. • Troubleshoot locally problems by quickly accessing logs 19
  • 20. Thank you • http://www.tiny-puppet.com • @alvagante @example42 • Slides published on http://slideshare.net/alvagante 20