SlideShare une entreprise Scribd logo
1  sur  39
Salty OPS – Saltstack Introduction
By Walter Liu 2013/12/24
Before Saltstack
(This section is borrowed slides from slideshare)
Basics
Commands and misc
Basic components
 Salt-master
 Salt-minion
 Salt-syndic: for large deployment or cross data-center.
Basic files of Salt
 Configuration files
 /etc/salt/master
 /etc/salt/minion
 /etc/salt/minion_id (generated when first time start daemon)
 /etc/salt/pki/ (generated when first time start daemon)

 Log: /var/log/salt/
 GITFS cache: /var/cache/salt/master/gitfs/refs/master/
Basic command
 salt
 salt –v "*" test.ping
 salt –v –L “web1,web2” test.ping
 salt –v –E “web[12]” test.ping
 Salt –v –N group1 test.ping

 salt-key –a, salt-key -d
 salt-call
Update to newest state
 salt –v '*' state.highstate
Copy file to minions
 salt „*‟ cp.get_file salt://path/to/file /minion/path/to/file
 salt „*‟ cp.get_dir salt://path/to/dir/ /minion/path/to/dir/
Information commands
 salt '*' sys.doc [module]
 salt '*' grains.items
 salt '*' pillar.items
Package something and
Run command
 salt '*' pkg.install nginx
 salt '*' pkg.remove nginx
 salt '*' cmd.run ifconfig
Batch Size
 Use batch size to rolling web server restart.
 Example:
 salt “websvr*” –batch-size 25% apache.signal restart
 salt “websvr*” –batch-size 10 apache.signal restart
Troubleshooting and
Test your command
 Use salt-call to run locally
 Add test=True to just view what will be done.
 example:
 salt-call -l info state.highstate test=True
 salt '*' state.highstate test=True
 salt „testsvr01‟ state.sls nginx test=True

 Demo: Test failed. only salt-call could see the error.
Let‟s run some examples. 
Installation (CentOS)
 yum install salt-master
 yum install salt-minion
 yum install salt-api
 yum install python-halite

 Other OS
 wget -O - http://bootstrap.saltstack.org | sudo sh
Re-initialize demo environment
 salt "*" pkg.remove nginx
 salt “*” cmd.run “rm /etc/nginx/conf.d/*”
 salt-key -D
Add a new machine to Salt
 Minion: edit /etc/salt/minion
 Minion: hostname change to “www-01.dc1”
 Minion: service salt-minion start
 Master: salt-key -A
Configure installation in Salty way
 Master: edit /etc/salt/master
 Master: Add file top.sls
 Master: Add file nginx.sls
 Minion: salt-call -l debug state.highstate test=True
 Master: salt "*" state.highstate test=True
 Execute on master: salt "*" state.highstate
Add another new machine to salt
 Minion: Add another machine. (hostname)
 Master: salt "*" state.highstate
Add a managed config file
 Master: edit top.sls, add dc1 directives.
 Master: Add dc1/web.sls
 Master: Add conf/dc1/www.conf
 Master: salt "*" state.highstate
Add dc2 managed config file
 Master: edit top.sls, add dc1 directives.
 Master: Add dc2/web.sls
 Master: Add conf/dc2/www.conf
 Master: salt "*" state.highstate
Grains in short
 Key values items of minion hardware/env.
 Only acquire at salt-minion startup.
 May be used in sls/template.
 Let‟s see how to config by domain/hostname.






Master: salt „*‟ grains.items
Master: Add web_general/web.sls
Master: Modify top.sls
Master: Add conf/dc3/www.conf
Master: salt-call „*.dc3‟ highstate test=True
Pillar in short
 Usage
 Highly Sensitive Data
 Minion Configuration
 Variables
 Arbitrary Data

 Example,
 DB username, password
 Configure config file by hostname
GITFS
 /etc/salt/master, change below configuration
 fileserver_backend:
- git
 Gitfs_remotes:
- git@gitlab……..

 salt-run fileserver.update
 Another method: Or only use gitfs to host config files.
Check config before restart
 Application support check config in service reload
(“init.d”).
 Return error code if failed.

 Use cmd.wait:


- name: ”nginx -s reload” # do reload



- onlyif: “nginx -t” # test if config is ok.



- watch:



- file: /etc/nginx/conf.d/my_web.conf
Collaboration
 RD
 Installation sls: “nginx.sls”
 User Config sls: “web_general/web.sls”
 User Config template: “www_redis.conf.template”

 OPS
 top.sls
 pillar/top.sls
Reference for writing SLS
 Salt Formulars on github
 https://github.com/saltstack-formulas

 Salt-states on github
 https://github.com/saltstack/salt-states
Halite
 Demo Web UI
Salty OPS – Saltstack Introduction

Contenu connexe

Tendances

Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Araf Karsh Hamid
 
DEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIDEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIAmazon Web Services
 
Alfresco Security Best Practices Guide
Alfresco Security Best Practices GuideAlfresco Security Best Practices Guide
Alfresco Security Best Practices GuideToni de la Fuente
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceAmazon Web Services
 
(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWSAmazon Web Services
 
Web Application Firewall intro
Web Application Firewall introWeb Application Firewall intro
Web Application Firewall introRich Helton
 
AWS Security Strategy
AWS Security StrategyAWS Security Strategy
AWS Security StrategyTeri Radichel
 
Red Hat OpenShift -- Innovation without limitation.pdf
Red Hat OpenShift -- Innovation without limitation.pdfRed Hat OpenShift -- Innovation without limitation.pdf
Red Hat OpenShift -- Innovation without limitation.pdfssuser1490e8
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewBob Killen
 
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...Amazon Web Services
 
Monitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECSMonitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECSAmazon Web Services
 
Inform2015 - What's New in Domino 9 & 9.0.1 for Admins
Inform2015 - What's New in Domino 9 & 9.0.1 for AdminsInform2015 - What's New in Domino 9 & 9.0.1 for Admins
Inform2015 - What's New in Domino 9 & 9.0.1 for AdminsJared Roberts
 

Tendances (20)

Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics Apache Flink, AWS Kinesis, Analytics
Apache Flink, AWS Kinesis, Analytics
 
DEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIDEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLI
 
Alfresco Security Best Practices Guide
Alfresco Security Best Practices GuideAlfresco Security Best Practices Guide
Alfresco Security Best Practices Guide
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 
Deep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line InterfaceDeep Dive: AWS Command Line Interface
Deep Dive: AWS Command Line Interface
 
AWS networking fundamentals
AWS networking fundamentalsAWS networking fundamentals
AWS networking fundamentals
 
Function as a Service
Function as a ServiceFunction as a Service
Function as a Service
 
(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS
 
Serverless architecture
Serverless architectureServerless architecture
Serverless architecture
 
Web Application Firewall intro
Web Application Firewall introWeb Application Firewall intro
Web Application Firewall intro
 
AWS Security Strategy
AWS Security StrategyAWS Security Strategy
AWS Security Strategy
 
Red Hat OpenShift -- Innovation without limitation.pdf
Red Hat OpenShift -- Innovation without limitation.pdfRed Hat OpenShift -- Innovation without limitation.pdf
Red Hat OpenShift -- Innovation without limitation.pdf
 
Kubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive OverviewKubernetes - A Comprehensive Overview
Kubernetes - A Comprehensive Overview
 
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
Migrating Your Databases to AWS - Deep Dive on Amazon RDS and AWS Database Mi...
 
Automation CICD
Automation CICDAutomation CICD
Automation CICD
 
Infrastructure as Code on AWS
Infrastructure as Code on AWSInfrastructure as Code on AWS
Infrastructure as Code on AWS
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Monitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECSMonitoring in Motion: Monitoring Containers and Amazon ECS
Monitoring in Motion: Monitoring Containers and Amazon ECS
 
Windows 2019
Windows 2019Windows 2019
Windows 2019
 
Inform2015 - What's New in Domino 9 & 9.0.1 for Admins
Inform2015 - What's New in Domino 9 & 9.0.1 for AdminsInform2015 - What's New in Domino 9 & 9.0.1 for Admins
Inform2015 - What's New in Domino 9 & 9.0.1 for Admins
 

En vedette

Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Love Nyberg
 
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)Blazeclan Technologies Private Limited
 
Orchestrate Event-Driven Infrastructure with SaltStack
Orchestrate Event-Driven Infrastructure with SaltStackOrchestrate Event-Driven Infrastructure with SaltStack
Orchestrate Event-Driven Infrastructure with SaltStackLove Nyberg
 
Introduction to Systems Management with SaltStack
Introduction to Systems Management with SaltStackIntroduction to Systems Management with SaltStack
Introduction to Systems Management with SaltStackCraig Sebenik
 
SaltConf 2014: Safety with powertools
SaltConf 2014: Safety with powertoolsSaltConf 2014: Safety with powertools
SaltConf 2014: Safety with powertoolsThomas Jackson
 
Real-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStackReal-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStackSaltStack
 
SaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, FasterSaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, FasterThomas Jackson
 
Test driven infrastructure avec Docker
Test driven infrastructure avec DockerTest driven infrastructure avec Docker
Test driven infrastructure avec DockerSéven Le Mesle
 
Understanding salt modular sub-systems and customization
Understanding salt   modular sub-systems and customizationUnderstanding salt   modular sub-systems and customization
Understanding salt modular sub-systems and customizationjasondenning
 
Saltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrencySaltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrencyThomas Jackson
 
Getting started with salt stack
Getting started with salt stackGetting started with salt stack
Getting started with salt stackSuresh Paulraj
 
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStackBitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStackSubbu Rama
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016effie mouzeli
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPressJustin Carmony
 
Automate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackAutomate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackNetworkedAssets
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltStack
 
Deploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise EnvironmentsDeploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise Environmentsinovex GmbH
 

En vedette (20)

Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...
 
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
 
Orchestrate Event-Driven Infrastructure with SaltStack
Orchestrate Event-Driven Infrastructure with SaltStackOrchestrate Event-Driven Infrastructure with SaltStack
Orchestrate Event-Driven Infrastructure with SaltStack
 
Introduction to Systems Management with SaltStack
Introduction to Systems Management with SaltStackIntroduction to Systems Management with SaltStack
Introduction to Systems Management with SaltStack
 
SaltConf 2014: Safety with powertools
SaltConf 2014: Safety with powertoolsSaltConf 2014: Safety with powertools
SaltConf 2014: Safety with powertools
 
Real-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStackReal-time Cloud Management with SaltStack
Real-time Cloud Management with SaltStack
 
SaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, FasterSaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
 
Test driven infrastructure avec Docker
Test driven infrastructure avec DockerTest driven infrastructure avec Docker
Test driven infrastructure avec Docker
 
Understanding salt modular sub-systems and customization
Understanding salt   modular sub-systems and customizationUnderstanding salt   modular sub-systems and customization
Understanding salt modular sub-systems and customization
 
Saltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrencySaltconf 2016: Salt stack transport and concurrency
Saltconf 2016: Salt stack transport and concurrency
 
Puppet on AWS
Puppet on AWSPuppet on AWS
Puppet on AWS
 
Getting started with salt stack
Getting started with salt stackGetting started with salt stack
Getting started with salt stack
 
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStackBitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
Bitfusion Saltconf16 - Seamless Docker Orchestration with SaltStack
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016
 
Demystifying CSS & WordPress
Demystifying CSS & WordPressDemystifying CSS & WordPress
Demystifying CSS & WordPress
 
Salt stack
Salt stackSalt stack
Salt stack
 
Demystifying kubernetes
Demystifying kubernetesDemystifying kubernetes
Demystifying kubernetes
 
Automate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackAutomate your development environment with Jira and Saltstack
Automate your development environment with Jira and Saltstack
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
Deploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise EnvironmentsDeploying Foreman in Enterprise Environments
Deploying Foreman in Enterprise Environments
 

Similaire à Salty OPS – Saltstack Introduction

Configuration management and orchestration with Salt
Configuration management and orchestration with SaltConfiguration management and orchestration with Salt
Configuration management and orchestration with SaltAnirban Saha
 
Configuration Management with Saltstack
Configuration Management with SaltstackConfiguration Management with Saltstack
Configuration Management with Saltstackinovex GmbH
 
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...SaltStack
 
A user's perspective on SaltStack and other configuration management tools
A user's perspective on SaltStack and other configuration management toolsA user's perspective on SaltStack and other configuration management tools
A user's perspective on SaltStack and other configuration management toolsSaltStack
 
SaltStack Configuration Management
SaltStack Configuration ManagementSaltStack Configuration Management
SaltStack Configuration ManagementNathan Sickler
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt55020
 
Saltstack for Ansible users
Saltstack for Ansible usersSaltstack for Ansible users
Saltstack for Ansible usersPaul Traylor
 
Testing Salt States (part 1)
Testing Salt States (part 1)Testing Salt States (part 1)
Testing Salt States (part 1)jasondenning
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginnersbryanbibat
 
Event driven architecture with SaltStack
Event driven architecture with SaltStackEvent driven architecture with SaltStack
Event driven architecture with SaltStackBharatNailwal2
 
Automating deployments from GitHub using SaltStack
Automating deployments from GitHub using SaltStackAutomating deployments from GitHub using SaltStack
Automating deployments from GitHub using SaltStackLINE Corporation
 
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...NETWAYS
 
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard SuttnerOSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard SuttnerNETWAYS
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?Alessandro Nadalin
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabSoftware Guru
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Dana Luther
 
Saltcheck: a tool in the salt toolbox
Saltcheck: a tool in the salt toolboxSaltcheck: a tool in the salt toolbox
Saltcheck: a tool in the salt toolboxChristian McHugh
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaDana Luther
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Brian K. Vagnini
 

Similaire à Salty OPS – Saltstack Introduction (20)

Configuration management and orchestration with Salt
Configuration management and orchestration with SaltConfiguration management and orchestration with Salt
Configuration management and orchestration with Salt
 
Configuration Management with Saltstack
Configuration Management with SaltstackConfiguration Management with Saltstack
Configuration Management with Saltstack
 
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
Arnold Bechtoldt, Inovex GmbH Linux systems engineer - Configuration Manageme...
 
A user's perspective on SaltStack and other configuration management tools
A user's perspective on SaltStack and other configuration management toolsA user's perspective on SaltStack and other configuration management tools
A user's perspective on SaltStack and other configuration management tools
 
SaltStack Configuration Management
SaltStack Configuration ManagementSaltStack Configuration Management
SaltStack Configuration Management
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt
 
Saltstack for Ansible users
Saltstack for Ansible usersSaltstack for Ansible users
Saltstack for Ansible users
 
Testing Salt States (part 1)
Testing Salt States (part 1)Testing Salt States (part 1)
Testing Salt States (part 1)
 
Version Control with Git for Beginners
Version Control with Git for BeginnersVersion Control with Git for Beginners
Version Control with Git for Beginners
 
Event driven architecture with SaltStack
Event driven architecture with SaltStackEvent driven architecture with SaltStack
Event driven architecture with SaltStack
 
Automating deployments from GitHub using SaltStack
Automating deployments from GitHub using SaltStackAutomating deployments from GitHub using SaltStack
Automating deployments from GitHub using SaltStack
 
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
OSBConf 2015 | Live demonstration of tying together git, slat and bareos bacu...
 
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard SuttnerOSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
OSCamp #4 on Foreman | Salted Foreman by Bernhard Suttner
 
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
 
Instrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con GitlabInstrumentación de entrega continua con Gitlab
Instrumentación de entrega continua con Gitlab
 
Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]Converting Your Dev Environment to a Docker Stack - php[world]
Converting Your Dev Environment to a Docker Stack - php[world]
 
Saltstack with Zabbix
Saltstack with ZabbixSaltstack with Zabbix
Saltstack with Zabbix
 
Saltcheck: a tool in the salt toolbox
Saltcheck: a tool in the salt toolboxSaltcheck: a tool in the salt toolbox
Saltcheck: a tool in the salt toolbox
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
 

Plus de Walter Liu

Generative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdfGenerative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdfWalter Liu
 
Infrastructure as code using Kubernetes
Infrastructure as code using KubernetesInfrastructure as code using Kubernetes
Infrastructure as code using KubernetesWalter Liu
 
手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談Walter Liu
 
關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒Walter Liu
 
Kubernetes Workshop
Kubernetes WorkshopKubernetes Workshop
Kubernetes WorkshopWalter Liu
 
Using Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPUsing Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPWalter Liu
 
Game DDOS Prevention
Game DDOS PreventionGame DDOS Prevention
Game DDOS PreventionWalter Liu
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engineWalter Liu
 
Super Fast Gevent Introduction
Super Fast Gevent IntroductionSuper Fast Gevent Introduction
Super Fast Gevent IntroductionWalter Liu
 
HTTP/2 to web dev
HTTP/2 to web devHTTP/2 to web dev
HTTP/2 to web devWalter Liu
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 IntroductionWalter Liu
 
Consul - service discovery and others
Consul - service discovery and othersConsul - service discovery and others
Consul - service discovery and othersWalter Liu
 
Docker introduction
Docker introductionDocker introduction
Docker introductionWalter Liu
 
WRS GIT Branching Model - draft
WRS GIT Branching Model - draftWRS GIT Branching Model - draft
WRS GIT Branching Model - draftWalter Liu
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yumWalter Liu
 
Game Localization in Python
Game Localization in PythonGame Localization in Python
Game Localization in PythonWalter Liu
 
Service production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointService production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointWalter Liu
 
Celery in the Django
Celery in the DjangoCelery in the Django
Celery in the DjangoWalter Liu
 

Plus de Walter Liu (18)

Generative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdfGenerative AI 在手機遊戲發行上的應用介紹.pdf
Generative AI 在手機遊戲發行上的應用介紹.pdf
 
Infrastructure as code using Kubernetes
Infrastructure as code using KubernetesInfrastructure as code using Kubernetes
Infrastructure as code using Kubernetes
 
手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談手機遊戲數位行銷工具淺談
手機遊戲數位行銷工具淺談
 
關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒關於第三方追蹤廣告再行銷的那些事兒
關於第三方追蹤廣告再行銷的那些事兒
 
Kubernetes Workshop
Kubernetes WorkshopKubernetes Workshop
Kubernetes Workshop
 
Using Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCPUsing Kubernetes to deploy Django in GCP
Using Kubernetes to deploy Django in GCP
 
Game DDOS Prevention
Game DDOS PreventionGame DDOS Prevention
Game DDOS Prevention
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
 
Super Fast Gevent Introduction
Super Fast Gevent IntroductionSuper Fast Gevent Introduction
Super Fast Gevent Introduction
 
HTTP/2 to web dev
HTTP/2 to web devHTTP/2 to web dev
HTTP/2 to web dev
 
HTTP/2 Introduction
HTTP/2 IntroductionHTTP/2 Introduction
HTTP/2 Introduction
 
Consul - service discovery and others
Consul - service discovery and othersConsul - service discovery and others
Consul - service discovery and others
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
WRS GIT Branching Model - draft
WRS GIT Branching Model - draftWRS GIT Branching Model - draft
WRS GIT Branching Model - draft
 
Django deployment and rpm+yum
Django deployment and rpm+yumDjango deployment and rpm+yum
Django deployment and rpm+yum
 
Game Localization in Python
Game Localization in PythonGame Localization in Python
Game Localization in Python
 
Service production from d3 pitfall viewpoint
Service production from d3 pitfall viewpointService production from d3 pitfall viewpoint
Service production from d3 pitfall viewpoint
 
Celery in the Django
Celery in the DjangoCelery in the Django
Celery in the Django
 

Dernier

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Salty OPS – Saltstack Introduction

  • 1. Salty OPS – Saltstack Introduction By Walter Liu 2013/12/24
  • 2. Before Saltstack (This section is borrowed slides from slideshare)
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 15. Basic components  Salt-master  Salt-minion  Salt-syndic: for large deployment or cross data-center.
  • 16. Basic files of Salt  Configuration files  /etc/salt/master  /etc/salt/minion  /etc/salt/minion_id (generated when first time start daemon)  /etc/salt/pki/ (generated when first time start daemon)  Log: /var/log/salt/  GITFS cache: /var/cache/salt/master/gitfs/refs/master/
  • 17. Basic command  salt  salt –v "*" test.ping  salt –v –L “web1,web2” test.ping  salt –v –E “web[12]” test.ping  Salt –v –N group1 test.ping  salt-key –a, salt-key -d  salt-call
  • 18. Update to newest state  salt –v '*' state.highstate
  • 19. Copy file to minions  salt „*‟ cp.get_file salt://path/to/file /minion/path/to/file  salt „*‟ cp.get_dir salt://path/to/dir/ /minion/path/to/dir/
  • 20. Information commands  salt '*' sys.doc [module]  salt '*' grains.items  salt '*' pillar.items
  • 21. Package something and Run command  salt '*' pkg.install nginx  salt '*' pkg.remove nginx  salt '*' cmd.run ifconfig
  • 22. Batch Size  Use batch size to rolling web server restart.  Example:  salt “websvr*” –batch-size 25% apache.signal restart  salt “websvr*” –batch-size 10 apache.signal restart
  • 23. Troubleshooting and Test your command  Use salt-call to run locally  Add test=True to just view what will be done.  example:  salt-call -l info state.highstate test=True  salt '*' state.highstate test=True  salt „testsvr01‟ state.sls nginx test=True  Demo: Test failed. only salt-call could see the error.
  • 24. Let‟s run some examples. 
  • 25. Installation (CentOS)  yum install salt-master  yum install salt-minion  yum install salt-api  yum install python-halite  Other OS  wget -O - http://bootstrap.saltstack.org | sudo sh
  • 26. Re-initialize demo environment  salt "*" pkg.remove nginx  salt “*” cmd.run “rm /etc/nginx/conf.d/*”  salt-key -D
  • 27. Add a new machine to Salt  Minion: edit /etc/salt/minion  Minion: hostname change to “www-01.dc1”  Minion: service salt-minion start  Master: salt-key -A
  • 28. Configure installation in Salty way  Master: edit /etc/salt/master  Master: Add file top.sls  Master: Add file nginx.sls  Minion: salt-call -l debug state.highstate test=True  Master: salt "*" state.highstate test=True  Execute on master: salt "*" state.highstate
  • 29. Add another new machine to salt  Minion: Add another machine. (hostname)  Master: salt "*" state.highstate
  • 30. Add a managed config file  Master: edit top.sls, add dc1 directives.  Master: Add dc1/web.sls  Master: Add conf/dc1/www.conf  Master: salt "*" state.highstate
  • 31. Add dc2 managed config file  Master: edit top.sls, add dc1 directives.  Master: Add dc2/web.sls  Master: Add conf/dc2/www.conf  Master: salt "*" state.highstate
  • 32. Grains in short  Key values items of minion hardware/env.  Only acquire at salt-minion startup.  May be used in sls/template.  Let‟s see how to config by domain/hostname.      Master: salt „*‟ grains.items Master: Add web_general/web.sls Master: Modify top.sls Master: Add conf/dc3/www.conf Master: salt-call „*.dc3‟ highstate test=True
  • 33. Pillar in short  Usage  Highly Sensitive Data  Minion Configuration  Variables  Arbitrary Data  Example,  DB username, password  Configure config file by hostname
  • 34. GITFS  /etc/salt/master, change below configuration  fileserver_backend: - git  Gitfs_remotes: - git@gitlab……..  salt-run fileserver.update  Another method: Or only use gitfs to host config files.
  • 35. Check config before restart  Application support check config in service reload (“init.d”).  Return error code if failed.  Use cmd.wait:  - name: ”nginx -s reload” # do reload  - onlyif: “nginx -t” # test if config is ok.  - watch:  - file: /etc/nginx/conf.d/my_web.conf
  • 36. Collaboration  RD  Installation sls: “nginx.sls”  User Config sls: “web_general/web.sls”  User Config template: “www_redis.conf.template”  OPS  top.sls  pillar/top.sls
  • 37. Reference for writing SLS  Salt Formulars on github  https://github.com/saltstack-formulas  Salt-states on github  https://github.com/saltstack/salt-states

Notes de l'éditeur

  1. Other OS installation script supportedAmazon Linux 2012.09ArchCentOS 5/6Debian 6.x/7.xFedora 17/18FreeBSD 9.1GentooLinaroLinux Mint 13/14OpenSUSE 12.xRed Hat 5/6Red Hat Enterprise 5/6SmartOSSuSE 11 SP1/11 SP2Ubuntu 10.x/11.x/12.x/13.04/13.10