SlideShare a Scribd company logo
1 of 18
Download to read offline
Saltcheck
Christian McHugh
Linkedin: https://www.linkedin.com/in/christian-mchugh-a9a79949/
Github: mchugh19
Agenda
Tool Selection
Saltstack Background/Architecture
Problem Statement
Saltcheck Solution
Tool Selection
Saltstack Architecture
Saltstack is a remote execution client/server system which also does configuration
management.
Primary usage is to install a minion agent on infrastructure, and connect them all to a central
saltmaster which issues commands.
Saltmaster
Minion 1
Minion 2
Saltstack Architecture
Proxy minions can be used to connect to infrastructure which does not allow agent installations (network
switches)
Saltmaster
Minion 1
Proxy
minion 1
Switch 1
(As an alternative to the minion install, you can also connect to hosts from the master over ssh. You can also
run without a master and just use the schedule the minion to run on its own to control the host
configuration)
Saltstack Architecture
Salt-minion has a very modular codebase:
● Execution Modules (531) - Contain functionality to list, add, modify, etc things.
Generally used through the command line and internally by salt states.
● State modules - Host logic to control idempotency. Manages state logic and leverages
execution module functionality
● Render modules - Write state instructions in (default) yaml/jinja, but also allows full
python if desired
● Auth, pillar (external data sources), grains (variables on minion), engines, output, etc
Saltstack Architecture: yaml/jinja
/etc/http/conf/http.conf:
file.managed:
- source: salt://apache/http.conf
- user: root
- group: root
- mode: 644
{% set motd = ['/etc/motd'] %}
{% if grains['os'] == 'Debian' %}
{% set motd = ['/etc/motd.tail', '/var/run/motd'] %}
{% endif %}
{% for motdfile in motd %}
{{ motdfile }}:
file.managed:
- source: salt://motd
{% endfor %}
Saltcheck
Validates output of salt execution modules
Uses salt rendering system, allowing for use of jina/yaml, grains, pillars, secrets, etc
Since saltcheck is itself a salt execution module, it can be targeted an run like any other salt
function.
Saltcheck
Salt execution module: salt ‘*’ saltcheck.run_highstate_tests
package_latest:
module_and_function: pkg.upgrade_available
args:
- apache2
assertion: assertFalse
{% for package in ["apache2", "openssh"] %}
test_{{ package }}_latest:
module_and_function: pkg.upgrade_available
args:
- {{ package }}
assertion: assertFalse
{% endfor %}
Problem description
Validation of large hadoop clusters
● Code deploy
● Config file
● User management
● AWS environment
● Data state
● Network connectivity
Saltcheck Example: code deploy
{% set refdata_version = salt['pillar.get']('Refdata_tag:version') %}
{% set oozie_version = salt['grains.get']('ec2_tags:OOZIE_VERSION') %}
{% set prime_version = salt['grains.get']('ec2_tags:PRIME_RELEASE') %}
validate_refdata_jars:
module_and_function: hadoop.dfs_present
args:
- /refData/oozie-automation/{{ refdata_version }}_{{ prime_version
}}/oozie/workflows/refdata-config-{{ prime_version }}.jar
assertion: assertTrue
…
Saltcheck Example: config files
validate_oozie_env_jobTracker:
module_and_function: hadoop.dfs
args:
- text
- /oozie-automation/{{ oozie_version }}_{{ prime_version
}}/oozie/common/env.properties
expected-return: jobTracker = yarnRM
assertion: assertNotIn
print_result: False
Saltcheck Example: user management
{% for usr,data in salt['pillar.get']('users').iteritems() %}
validate_user_{{ usr }}:
module_and_function: user.info
assertion_section: shell
args:
- {{ usr }}
assertion: assertEqual
expected-return: /bin/bash
check_ssh_key_{{ usr }}:
module_and_function: ssh.check_key
args:
- {{ usr }}
- {{ data.key }}
- ssh-rsa
- ''
- ''
assertion: assertEqual
expected-return: exists
{% endfor %}
Saltcheck Example: s3 & python boto3
validate_oozie_env_jobTracker:
module_and_function: s3.get
args:
- mybucket
- dataset/{{ prime_version }}/data
assertion: assertTrue
boto3-installed:
module_and_function: cmd.run
args:
- python -c 'import pkgutil; print(1 if pkgutil.find_loader("boto3") else 0)'
assertion: assertEqual
expected-return: 1
Jenkins & Saltstack
https://plugins.jenkins.io/saltstack/
import groovy.json.*
node() {
saltresult = salt authtype: 'pam', clientInterface: local(arguments: '"emr.deploy"',
function: 'state.apply', target: 'ec2:role:hadoop-dev', targettype: 'grain'),
credentialsId: 'a3d814c2-84ed-4752-94a8-271791bb5375', servername:
'http://localhost:8000'
saltresult = salt authtype: 'pam', clientInterface: local(arguments: '"emr.deploy"',
function: 'saltcheck.run_state_tests', target: 'ec2:role:hadoop-dev', targettype:
'grain'),
credentialsId: 'a3d814c2-84ed-4752-94a8-271791bb5375', servername:
'http://localhost:8000'
def prettyJson = JsonOutput.prettyPrint(saltresult)
println(prettyJson)
}
Tool Summary
Saltcheck is able to use Salt’s remote execution capabilities and modules to talk to a wide
variety of infrastructure. All while utilizing the same familiar markup, and data backends.
For teams using Salt, saltcheck allows for knowledge reuse and shareable patterns
Tool Sprawl
Teams have limited resources and capacity for yet another thing
IT trends toward specialization, be aware of the load put on your teams
Thank you

More Related Content

What's hot

Deployment with capistrano
Deployment with capistranoDeployment with capistrano
Deployment with capistranosagar junnarkar
 
Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법Minchul Jung
 
So I Wrote a Manifest
So I Wrote a ManifestSo I Wrote a Manifest
So I Wrote a ManifestPuppet
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with CapistranoRamazan K
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with CapistranoLaunchAny
 
ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)YoungHeon (Roy) Kim
 
Capistrano - automate all the things
Capistrano - automate all the thingsCapistrano - automate all the things
Capistrano - automate all the thingsJohn Cleary
 
openstack源码分析(1)
openstack源码分析(1)openstack源码分析(1)
openstack源码分析(1)cannium
 
Automated Application Management with SaltStack
Automated Application Management with SaltStackAutomated Application Management with SaltStack
Automated Application Management with SaltStackinovex GmbH
 
PostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulPostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulSean Chittenden
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKYoungHeon (Roy) Kim
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stackRootGate
 
Cookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and ServerrspecCookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and ServerrspecDaniel Paulus
 

What's hot (20)

Capistrano
CapistranoCapistrano
Capistrano
 
Deployment with capistrano
Deployment with capistranoDeployment with capistrano
Deployment with capistrano
 
Deep dive networking
Deep dive networkingDeep dive networking
Deep dive networking
 
Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법Ch10.애플리케이션 서버의 병목_발견_방법
Ch10.애플리케이션 서버의 병목_발견_방법
 
Capistrano - Deployment Tool
Capistrano - Deployment ToolCapistrano - Deployment Tool
Capistrano - Deployment Tool
 
So I Wrote a Manifest
So I Wrote a ManifestSo I Wrote a Manifest
So I Wrote a Manifest
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Getting Started with Capistrano
Getting Started with CapistranoGetting Started with Capistrano
Getting Started with Capistrano
 
ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)ProxySQL & PXC(Query routing and Failover Test)
ProxySQL & PXC(Query routing and Failover Test)
 
Capistrano - automate all the things
Capistrano - automate all the thingsCapistrano - automate all the things
Capistrano - automate all the things
 
openstack源码分析(1)
openstack源码分析(1)openstack源码分析(1)
openstack源码分析(1)
 
Automated Application Management with SaltStack
Automated Application Management with SaltStackAutomated Application Management with SaltStack
Automated Application Management with SaltStack
 
Capistrano 3 Deployment
Capistrano 3 DeploymentCapistrano 3 Deployment
Capistrano 3 Deployment
 
PostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consulPostgreSQL High-Availability and Geographic Locality using consul
PostgreSQL High-Availability and Geographic Locality using consul
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
 
Consul presentation
Consul presentationConsul presentation
Consul presentation
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
Mysql
Mysql Mysql
Mysql
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 
Cookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and ServerrspecCookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and Serverrspec
 

Similar to Saltcheck: a tool in the salt toolbox

Active mq Installation and Master Slave setup
Active mq Installation and Master Slave setupActive mq Installation and Master Slave setup
Active mq Installation and Master Slave setupRamakrishna Narkedamilli
 
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)DECK36
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016effie mouzeli
 
Software-defined Datacenter Maintenance - No More Sleepless Nights and Long W...
Software-defined Datacenter Maintenance - No More Sleepless Nights and Long W...Software-defined Datacenter Maintenance - No More Sleepless Nights and Long W...
Software-defined Datacenter Maintenance - No More Sleepless Nights and Long W...SUSE
 
PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpNathan Handler
 
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with TriggerManaging Large-scale Networks with Trigger
Managing Large-scale Networks with Triggerjathanism
 
Monitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_TutorialMonitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_TutorialTim Vaillancourt
 
ProxySQL in the Cloud
ProxySQL in the CloudProxySQL in the Cloud
ProxySQL in the CloudRené Cannaò
 
Practical Operation Automation with StackStorm
Practical Operation Automation with StackStormPractical Operation Automation with StackStorm
Practical Operation Automation with StackStormShu Sugimoto
 
Bpug mcollective 20140624
Bpug mcollective 20140624Bpug mcollective 20140624
Bpug mcollective 20140624Johan De Wit
 
Gatling - Stress test tool
Gatling - Stress test toolGatling - Stress test tool
Gatling - Stress test toolKnoldus Inc.
 
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2Alfonso Martino
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefMatt Ray
 
Training Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringTraining Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringContinuent
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務Mu Chun Wang
 
Monitoring Agile PLM with JConsole
Monitoring Agile PLM with JConsole Monitoring Agile PLM with JConsole
Monitoring Agile PLM with JConsole PLM Mechanic .
 
Extending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptxExtending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptxGuilherme Pereira Silva
 

Similar to Saltcheck: a tool in the salt toolbox (20)

Active mq Installation and Master Slave setup
Active mq Installation and Master Slave setupActive mq Installation and Master Slave setup
Active mq Installation and Master Slave setup
 
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
Our Puppet Story – Patterns and Learnings (sage@guug, March 2014)
 
The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016The SaltStack Pub Crawl - Fosscomm 2016
The SaltStack Pub Crawl - Fosscomm 2016
 
Software-defined Datacenter Maintenance - No More Sleepless Nights and Long W...
Software-defined Datacenter Maintenance - No More Sleepless Nights and Long W...Software-defined Datacenter Maintenance - No More Sleepless Nights and Long W...
Software-defined Datacenter Maintenance - No More Sleepless Nights and Long W...
 
PaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at YelpPaaSTA: Autoscaling at Yelp
PaaSTA: Autoscaling at Yelp
 
Managing Large-scale Networks with Trigger
Managing Large-scale Networks with TriggerManaging Large-scale Networks with Trigger
Managing Large-scale Networks with Trigger
 
Tomcat 6: Evolving our server
Tomcat 6: Evolving our serverTomcat 6: Evolving our server
Tomcat 6: Evolving our server
 
Monitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_TutorialMonitoring_with_Prometheus_Grafana_Tutorial
Monitoring_with_Prometheus_Grafana_Tutorial
 
ProxySQL in the Cloud
ProxySQL in the CloudProxySQL in the Cloud
ProxySQL in the Cloud
 
Practical Operation Automation with StackStorm
Practical Operation Automation with StackStormPractical Operation Automation with StackStorm
Practical Operation Automation with StackStorm
 
Bpug mcollective 20140624
Bpug mcollective 20140624Bpug mcollective 20140624
Bpug mcollective 20140624
 
Docker Monitoring Webinar
Docker Monitoring  WebinarDocker Monitoring  Webinar
Docker Monitoring Webinar
 
Gatling - Stress test tool
Gatling - Stress test toolGatling - Stress test tool
Gatling - Stress test tool
 
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
MuleSoft Meetup Roma - Runtime Fabric Series (From Zero to Hero) - Sessione 2
 
Wso2 test automation framework internal training
Wso2 test automation framework internal trainingWso2 test automation framework internal training
Wso2 test automation framework internal training
 
Bare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and ChefBare Metal to OpenStack with Razor and Chef
Bare Metal to OpenStack with Razor and Chef
 
Training Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringTraining Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten Clustering
 
手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務手把手教你如何串接 Log 到各種網路服務
手把手教你如何串接 Log 到各種網路服務
 
Monitoring Agile PLM with JConsole
Monitoring Agile PLM with JConsole Monitoring Agile PLM with JConsole
Monitoring Agile PLM with JConsole
 
Extending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptxExtending the Mule Runtime - Building a Circuit Breaker Component.pptx
Extending the Mule Runtime - Building a Circuit Breaker Component.pptx
 

Recently uploaded

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
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
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

Saltcheck: a tool in the salt toolbox

  • 4. Saltstack Architecture Saltstack is a remote execution client/server system which also does configuration management. Primary usage is to install a minion agent on infrastructure, and connect them all to a central saltmaster which issues commands. Saltmaster Minion 1 Minion 2
  • 5. Saltstack Architecture Proxy minions can be used to connect to infrastructure which does not allow agent installations (network switches) Saltmaster Minion 1 Proxy minion 1 Switch 1 (As an alternative to the minion install, you can also connect to hosts from the master over ssh. You can also run without a master and just use the schedule the minion to run on its own to control the host configuration)
  • 6. Saltstack Architecture Salt-minion has a very modular codebase: ● Execution Modules (531) - Contain functionality to list, add, modify, etc things. Generally used through the command line and internally by salt states. ● State modules - Host logic to control idempotency. Manages state logic and leverages execution module functionality ● Render modules - Write state instructions in (default) yaml/jinja, but also allows full python if desired ● Auth, pillar (external data sources), grains (variables on minion), engines, output, etc
  • 7. Saltstack Architecture: yaml/jinja /etc/http/conf/http.conf: file.managed: - source: salt://apache/http.conf - user: root - group: root - mode: 644 {% set motd = ['/etc/motd'] %} {% if grains['os'] == 'Debian' %} {% set motd = ['/etc/motd.tail', '/var/run/motd'] %} {% endif %} {% for motdfile in motd %} {{ motdfile }}: file.managed: - source: salt://motd {% endfor %}
  • 8. Saltcheck Validates output of salt execution modules Uses salt rendering system, allowing for use of jina/yaml, grains, pillars, secrets, etc Since saltcheck is itself a salt execution module, it can be targeted an run like any other salt function.
  • 9. Saltcheck Salt execution module: salt ‘*’ saltcheck.run_highstate_tests package_latest: module_and_function: pkg.upgrade_available args: - apache2 assertion: assertFalse {% for package in ["apache2", "openssh"] %} test_{{ package }}_latest: module_and_function: pkg.upgrade_available args: - {{ package }} assertion: assertFalse {% endfor %}
  • 10. Problem description Validation of large hadoop clusters ● Code deploy ● Config file ● User management ● AWS environment ● Data state ● Network connectivity
  • 11. Saltcheck Example: code deploy {% set refdata_version = salt['pillar.get']('Refdata_tag:version') %} {% set oozie_version = salt['grains.get']('ec2_tags:OOZIE_VERSION') %} {% set prime_version = salt['grains.get']('ec2_tags:PRIME_RELEASE') %} validate_refdata_jars: module_and_function: hadoop.dfs_present args: - /refData/oozie-automation/{{ refdata_version }}_{{ prime_version }}/oozie/workflows/refdata-config-{{ prime_version }}.jar assertion: assertTrue …
  • 12. Saltcheck Example: config files validate_oozie_env_jobTracker: module_and_function: hadoop.dfs args: - text - /oozie-automation/{{ oozie_version }}_{{ prime_version }}/oozie/common/env.properties expected-return: jobTracker = yarnRM assertion: assertNotIn print_result: False
  • 13. Saltcheck Example: user management {% for usr,data in salt['pillar.get']('users').iteritems() %} validate_user_{{ usr }}: module_and_function: user.info assertion_section: shell args: - {{ usr }} assertion: assertEqual expected-return: /bin/bash check_ssh_key_{{ usr }}: module_and_function: ssh.check_key args: - {{ usr }} - {{ data.key }} - ssh-rsa - '' - '' assertion: assertEqual expected-return: exists {% endfor %}
  • 14. Saltcheck Example: s3 & python boto3 validate_oozie_env_jobTracker: module_and_function: s3.get args: - mybucket - dataset/{{ prime_version }}/data assertion: assertTrue boto3-installed: module_and_function: cmd.run args: - python -c 'import pkgutil; print(1 if pkgutil.find_loader("boto3") else 0)' assertion: assertEqual expected-return: 1
  • 15. Jenkins & Saltstack https://plugins.jenkins.io/saltstack/ import groovy.json.* node() { saltresult = salt authtype: 'pam', clientInterface: local(arguments: '"emr.deploy"', function: 'state.apply', target: 'ec2:role:hadoop-dev', targettype: 'grain'), credentialsId: 'a3d814c2-84ed-4752-94a8-271791bb5375', servername: 'http://localhost:8000' saltresult = salt authtype: 'pam', clientInterface: local(arguments: '"emr.deploy"', function: 'saltcheck.run_state_tests', target: 'ec2:role:hadoop-dev', targettype: 'grain'), credentialsId: 'a3d814c2-84ed-4752-94a8-271791bb5375', servername: 'http://localhost:8000' def prettyJson = JsonOutput.prettyPrint(saltresult) println(prettyJson) }
  • 16. Tool Summary Saltcheck is able to use Salt’s remote execution capabilities and modules to talk to a wide variety of infrastructure. All while utilizing the same familiar markup, and data backends. For teams using Salt, saltcheck allows for knowledge reuse and shareable patterns
  • 17. Tool Sprawl Teams have limited resources and capacity for yet another thing IT trends toward specialization, be aware of the load put on your teams