SlideShare a Scribd company logo
Stacki and Chef at Pardot
David Peterson
Lead Systems Engineer
david.peterson@salesforce.com
About Me
I joined Salesforce in 2014 and am currently a Lead Systems Engineer based out of
Atlanta, GA. I help lead the infrastructure design and scaling of Salesforce’s
product offering, Pardot Marketing Automation.
Prior to Salesforce, I worked at Perfect Sense Digital where I was the Lead
Engineer in architecting and implementing HGTV and Travel Channel's new
website infrastructure in AWS. I also helped design and implement the
infrastructure for digital media sites such as Food Network, Univision, Coca-Cola,
Walmart, Lionsgate, BET, Snagfilms, National Geographic, and others.
Prior to PSD, I worked at ChannelAdvisor, an e-commerce SaaS company, where I
helped design and manage the infrastructure responsible for processing over $3
billion in GMV.
Agenda
▪ Why Stacki (I’m assuming version 3.2)
▪ Stacki global configuration for multiple DCs
▪ Stacki chef cart setup
▪ Specific Chef configurations and how we handle server
re-provisions
▪ Proper ordering with multiple carts
▪ Questions
Why Stacki
▪ Managing thousands of servers is easy (csv)
▪ HP and Dell raid controller support
▪ Easy out of the box provisioning but deep customization available
▪ Ability to re-provision without losing data
▪ Easy network/subnet configuration and host assignment
▪ YUM repo support
▪ Command line, command line, command line
▪ Support
Stacki Global Configurations
[root@stacki]# stack list attr
SCOPE ATTR VALUE SOURCE
--------- Confirm_Private_PureRootPassword a G
--------- HttpConf /etc/httpd/conf G
--------- HttpConfigDirExt /etc/httpd/conf.d G
--------- HttpRoot /var/www/html G
--------- Info_CertificateCountry US G
--------- Info_CertificateLocality Solana Beach G
--------- Info_CertificateOrganization StackIQ G
--------- Info_CertificateState California G
--------- Info_ClusterContact ---------------------------------------------------------------------------- G
--------- Info_ClusterLatlong N32.87 W117.22 G
--------- Info_ClusterName Stacki G
--------- Info_ClusterURL http://stackihost.local/ G
--------- Info_FQDN stackihost.local G
--------- Kickstart_BoxDir /export/stack G
--------- Kickstart_DistroDir /export/stack G
--------- Kickstart_Keyboard us G
--------- Kickstart_Lang en_US G
--------- Kickstart_Langsupport en_US G
(continued)...
Stacki Global Configurations
[root@stacki]# stack add attr attr=datacenter value=DC-EAST
[root@stacki]# stack add attr attr=chef_server value=https://chef-dc-east.xyz.com:443/organizations/companyX
[root@stacki]# stack list attr
SCOPE ATTR VALUE SOURCE
--------- chef_server https://chef-dc-east.xyz.com:443/organizations/companyX G
--------- datacenter DC-EAST G
Chef Stacki Cart
[root@stacki]# stack add cart chef
[root@stacki]# stack list cart
NAME BOXES
chef: -----
[root@stacki]# tree /export/stack/carts/chef/
├── graph
│ └── cart-chef.xml
├── nodes
│ └── cart-chef-backend.xml
└── RPMS
Chef Config
/export/stack/carts/chef/nodes/cart-chef-backend.xml
<?xml version="1.0" standalone="no"?>
<kickstart>
<description>
chef cart backend appliance extensions
</description>
<package>chef</package>
<!-- shell code for post RPM installation -->
<post>
mkdir -p /etc/chef /var/log/chef /var/run/chef
</post>
Chef Config
XML tag Overview
● <post>
○ This tag allows the admin to run scripts after the package installation is done. The
scripts can be in any interpreted language present on the installed system.
● <boot order=”post”>
○ This section is a collection of shell scripts that are run on first-boot after all services
and daemons have started. This is typically used to run scripts that interact with
system daemons, or to finish and clean-up the installation process.
Chef Config
/export/stack/carts/chef/nodes/cart-chef-backend.xml
<post cond="not 'proxyout' in hostname">
############# DC-EAST ##########
if [ "&datacenter;" == "DC-EAST" ]
then
<file name="/etc/chef/client.rb">
<![CDATA[
# Chef Client Config File
# Dynamically generated by Stacki
log_level :info
log_location STDOUT
chef_server_url "#CHEF_SERVER#"
validation_client_name "prod-validator"
validation_key "/etc/chef/validation.pem"
client_key "/etc/chef/client.pem"
ssl_verify_mode :verify_none
http_proxy 'http://proxyout.dc-east.local.com:3128'
https_proxy 'http://proxyout.dc-east.local.com:3128'
environment 'production'
node_name "#HOSTNAME#"
]]>
</file>
# Need to add the chef server and client hostname to the client.rb file
sed -i 's,#CHEF_SERVER#,&chef_server;,g' /etc/chef/client.rb
sed -i 's/#HOSTNAME#/&hostname;.&domainname;/g' /etc/chef/client.rb
fi
</post>
Chef Config
/export/stack/carts/chef/nodes/cart-chef-backend.xml
<post cond="'proxyout' in hostname">
<file name="/etc/chef/client.rb">
<![CDATA[
# Chef Client Config File
# Dynamically generated by Stacki
log_level :info
log_location STDOUT
chef_server_url "#CHEF_SERVER#"
validation_client_name "prod-validator"
validation_key "/etc/chef/validation.pem"
client_key "/etc/chef/client.pem"
ssl_verify_mode :verify_none
environment 'production'
# Using default node name (fqdn)
node_name "#HOSTNAME#"
]]>
</file>
# Need to add the chef server and client hostname to the client.rb file
sed -i 's,#CHEF_SERVER#,&chef_server;,g' /etc/chef/client.rb
sed -i 's/#HOSTNAME#/&hostname;.&domainname;/g' /etc/chef/client.rb
</post>
Chef Config
/export/stack/carts/chef/nodes/cart-chef-backend.xml
<post>
if [ "&datacenter;" == "DC-EAST" ]
then
<file name="/etc/chef/first-boot.json">
{
"run_list": [
"role[base]",
"role[dc_east]"
]
}
</file>
<file name="/etc/chef/validation.pem" perms="0644">
-----BEGIN RSA PRIVATE KEY-----
asdfasdfasdfasdfasdfasdfasdfasdfasdfsadfasdfasdfasdfsadfasdfasdfasdfsadfsadfasdf
adsasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasfasdfasdfasdfasdfa
-----END RSA PRIVATE KEY-----
</file>
<file name="/etc/chef/encrypted_data_bag_secret" perms="0400">
asdfasdfasdfasdfasfdasfdasdfasfdasdfasfasdfasfdasdfasdfsafasfdasfdsadfasdfasdfasdf
adsfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasfdasdfasdfasdfasdfasdfa
</file>
fi
</post>
######### DC-EAST END ########
Chef Config: Server Provisioning
● Two attributes attached to a host control what happens to existing data on that host when it is configured
to be provisioned by setting the action attribute: “stack set host boot host1.local.com action=install”
○ nukecontroller
■ If set to “False”: Leaves the existing RAID controller setup as it is
■ If set to “True”: Removes all existing RAID groups and LUNS
○ nukedisks
■ If set to “False”: Only removes everything in the “/” and “/var/log” partition
■ If set to “True”: Will remove all partitions from all disks
[root@stacki]# stack list host attr host1.local.com |egrep 'nuke|HOST'
HOST SCOPE ATTR VALUE SOURCE
host1.local.com: --------- nukecontroller false H
host1.local.com: --------- nukedisks false H
Chef Config: Server Provisioning
/export/stack/carts/chef/nodes/cart-chef-backend.xml
# If we are nuking disks we are assuming this is a new server
# or the chef client/node has been deleted out of the chef server if it existed.
<boot order="post" cond="nukedisks">
# Run chef-client for the first time
/usr/bin/chef-client -j /etc/chef/first-boot.json -L /var/log/chef/chef.log
# Make a backup of the chef private key in case we need to re-provision/upgrade a server
mkdir -p /data/chef-backup
chown root:root /data/chef-backup
chmod 700 /data/chef-backup
cp -a /etc/chef/* /data/chef-backup
</boot>
[root@stacki]# stack set host attr host1.local.com attr=nukedisks value=true
[root@stacki]# stack list host attr host1.local.com |egrep 'nukedisks|HOST'
HOST SCOPE ATTR VALUE SOURCE
host1.local.com: --------- nukedisks true H
Chef Config: Server Provisioning
/export/stack/carts/chef/nodes/cart-chef-backend.xml
# If we are not nuking the disks we are assuming we are re-loading or upgrading
# the OS and need to keep the client.pem chef key so chef-client can run properly
<boot order="post" cond="not nukedisks">
cp /data/chef-backup/client.pem /etc/chef/
/usr/bin/chef-client -L /var/log/chef/chef.log
</boot>
</kickstart>
Chef Cart Config
● Put your chef RPM file in /export/stack/carts/chef/RPMS/ directory
● Assign your chef cart to a box
● Compile a cart when adding/removing RPMs to update the repo
[root@stacki]# stack enable cart chef box=default
[root@stacki]# stack compile cart chef
[root@stacki]# stack list cart chef
NAME BOXES
chef: default
Chef Cart Config
PRO TIP: When making xml config changes, always verify them by running the “stack list host
profile” command which does syntax checking and gives you the full generated kickstart file
[root@stacki]# stack list host profile host1.local.com|less
<?xml version="1.0" standalone="no"?>
<profile lang="kickstart">
<section name="kickstart">
<![CDATA[
#
# Node Traversal Order
#
# /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/partitions-save.xml (stacki)
# /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/pre-ssh-key.xml (stacki)
# /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/storage-controller-client.xml (stacki)
# /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/nukedisks.xml (stacki)
# /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/partition.xml (stacki)
(continued)...
Chef Cart Ordering
[root@stacki]# stack list cart
NAME BOXES
base: default
custom-rpms: default
chef: default
[root@stacki]# stack list host profile host1.local.com|less
<?xml version="1.0" standalone="no"?>
<profile lang="kickstart">
<section name="kickstart">
<![CDATA[
#
# Node Traversal Order
#
...
# /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/do-partition.xml (stacki)
# /export/stack/carts/chef/nodes/cart-chef-backend.xml (unknown)
# /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/base.xml (stacki)
# /export/stack/carts/base/nodes/cart-base-backend.xml (unknown)
# /export/stack/carts/custom-rpms/nodes/cart-custom-rpms-backend.xml (unknown)
(continued)...
Chef Cart Ordering
/export/stack/carts/chef/graph/cart-chef.xml
<?xml version="1.0" standalone="no"?>
<graph>
<description>
chef cart
</description>
<order head="backend" tail="cart-chef-backend"/>
<edge from="backend" to="cart-chef-backend"/>
</graph>
<?xml version="1.0" standalone="no"?>
<graph>
<description>
chef cart
</description>
<order head="backend" tail="cart-chef-backend"/>
<edge from="backend" to="cart-chef-backend"/>
<order head="cart-base-backend" tail="cart-chef-backend"/>
<edge from="cart-base-backend" to="cart-chef-backend"/>
</graph>
Chef Cart Ordering
[root@stacki]# stack list host profile host1.local.com|less
<?xml version="1.0" standalone="no"?>
<profile lang="kickstart">
<section name="kickstart">
<![CDATA[
#
# Node Traversal Order
#
...
# /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/do-partition.xml (stacki)
# /export/stack/carts/base/nodes/cart-base-backend.xml (unknown)
# /export/stack/carts/chef/nodes/cart-chef-backend.xml (unknown)
# /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/base.xml (stacki)
# /export/stack/carts/custom-rpms/nodes/cart-custom-rpms-backend.xml (unknown)
(continued)...
thank y u

More Related Content

PDF
Inno Db Performance And Usability Patches
MySQLConference
 
PPTX
Apache BookKeeper as a long term distributed store
Salesforce Engineering
 
DOC
Stankey_S_Resume_2016
Somer Stankey
 
PPTX
Global Mercy Plan
mercyglobal
 
PPTX
Доверительная собственность. Презентация с мастер-класса для студентов эконом...
«Велес Капитал»
 
PDF
Dr chookoonlip faac-showfxasia-20160917-brief
Power Point
 
PPTX
Ten Years of DITA: Are We There Yet?
Salesforce Engineering
 
PPT
Tata nama neoplasma
helmy lisik miko
 
Inno Db Performance And Usability Patches
MySQLConference
 
Apache BookKeeper as a long term distributed store
Salesforce Engineering
 
Stankey_S_Resume_2016
Somer Stankey
 
Global Mercy Plan
mercyglobal
 
Доверительная собственность. Презентация с мастер-класса для студентов эконом...
«Велес Капитал»
 
Dr chookoonlip faac-showfxasia-20160917-brief
Power Point
 
Ten Years of DITA: Are We There Yet?
Salesforce Engineering
 
Tata nama neoplasma
helmy lisik miko
 

Viewers also liked (9)

PPTX
How Developers and Quality Engineer Collaborate at Salesforce
Salesforce Engineering
 
PDF
Секреты успешного собеседования: что нужно знать при устройстве на работу. Пр...
«Велес Капитал»
 
PPTX
Getting to NO NINES
Salesforce Engineering
 
PPTX
презентация тищук
Power Point
 
PPTX
Famous Interior Design Firms In Pakistan
Mahin Shahid
 
PPTX
Operationalizing Big Data as a Service
Salesforce Engineering
 
PPT
Kuliah 2 Jejas Sel
Robby Candra Purnama
 
PPTX
Krishma
krishi25
 
PPTX
Business planEntrepreneurship Business Plan of Travel Agency for local and in...
AFAAQSALEEM
 
How Developers and Quality Engineer Collaborate at Salesforce
Salesforce Engineering
 
Секреты успешного собеседования: что нужно знать при устройстве на работу. Пр...
«Велес Капитал»
 
Getting to NO NINES
Salesforce Engineering
 
презентация тищук
Power Point
 
Famous Interior Design Firms In Pakistan
Mahin Shahid
 
Operationalizing Big Data as a Service
Salesforce Engineering
 
Kuliah 2 Jejas Sel
Robby Candra Purnama
 
Krishma
krishi25
 
Business planEntrepreneurship Business Plan of Travel Agency for local and in...
AFAAQSALEEM
 
Ad

Similar to Stacki and Chef at Pardot (20)

PDF
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackIQ
 
PPTX
Stacki - The1600+ Server Journey
Salesforce Engineering
 
DOCX
How to install squid proxy on server or how to install squid proxy on centos o
Proxiesforrent
 
PDF
Automate Your FME Server Installs, Take a Five Minute Break
Safe Software
 
PPTX
NLIT 2011: Chef & Capistrano
nickblah
 
PDF
glance replicator
irix_jp
 
PDF
Salesforce at Stacki Atlanta Meetup February 2016
StackIQ
 
PDF
Global Azure Austria 2023 - Fast feedback with pull request deployments
Marc Müller
 
PPT
What's New in ZF 1.10
Ralph Schindler
 
PPT
Deploy Rails Application by Capistrano
Tasawr Interactive
 
PDF
Atmosphere Conference 2015: Taming the Modern Datacenter
PROIDEA
 
PDF
Variant Configurition in SAP: Beginners Guide | www.sapdocs.info
sapdocs. info
 
PDF
Nko workshop - node js crud & deploy
Simon Su
 
PDF
Securing your MySQL / MariaDB Server data
Colin Charles
 
PPT
Presentation iv implementasi 802x eap tls peap mscha pv2
Hell19
 
PDF
Clouldera Implementation Guide for Production Deployments
Ahmed Mekawy
 
PDF
DWX 2023 - Schnelles Feedback mit Pull-Request Deployments
Marc Müller
 
PDF
Into The Box 2018 Going live with commandbox and docker
Ortus Solutions, Corp
 
PDF
Going live with BommandBox and docker Into The Box 2018
Ortus Solutions, Corp
 
PPTX
drupal ci cd concept cornel univercity.pptx
rukuntravel
 
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackIQ
 
Stacki - The1600+ Server Journey
Salesforce Engineering
 
How to install squid proxy on server or how to install squid proxy on centos o
Proxiesforrent
 
Automate Your FME Server Installs, Take a Five Minute Break
Safe Software
 
NLIT 2011: Chef & Capistrano
nickblah
 
glance replicator
irix_jp
 
Salesforce at Stacki Atlanta Meetup February 2016
StackIQ
 
Global Azure Austria 2023 - Fast feedback with pull request deployments
Marc Müller
 
What's New in ZF 1.10
Ralph Schindler
 
Deploy Rails Application by Capistrano
Tasawr Interactive
 
Atmosphere Conference 2015: Taming the Modern Datacenter
PROIDEA
 
Variant Configurition in SAP: Beginners Guide | www.sapdocs.info
sapdocs. info
 
Nko workshop - node js crud & deploy
Simon Su
 
Securing your MySQL / MariaDB Server data
Colin Charles
 
Presentation iv implementasi 802x eap tls peap mscha pv2
Hell19
 
Clouldera Implementation Guide for Production Deployments
Ahmed Mekawy
 
DWX 2023 - Schnelles Feedback mit Pull-Request Deployments
Marc Müller
 
Into The Box 2018 Going live with commandbox and docker
Ortus Solutions, Corp
 
Going live with BommandBox and docker Into The Box 2018
Ortus Solutions, Corp
 
drupal ci cd concept cornel univercity.pptx
rukuntravel
 
Ad

More from Salesforce Engineering (20)

PPTX
Locker Service Ready Lightning Components With Webpack
Salesforce Engineering
 
PPTX
Scaling HBase for Big Data
Salesforce Engineering
 
PPTX
Techniques to Effectively Monitor the Performance of Customers in the Cloud
Salesforce Engineering
 
PPTX
Predictive System Performance Data Analysis
Salesforce Engineering
 
PPTX
Apache HBase State of the Project
Salesforce Engineering
 
PPTX
Hit the Trail with Trailhead
Salesforce Engineering
 
PPTX
HBase/PHOENIX @ Scale
Salesforce Engineering
 
PPTX
Scaling up data science applications
Salesforce Engineering
 
PPTX
Containers and Security for DevOps
Salesforce Engineering
 
PPTX
Aspect Oriented Programming: Hidden Toolkit That You Already Have
Salesforce Engineering
 
PPTX
Monitoring @ Scale in Salesforce
Salesforce Engineering
 
PPTX
Performance Tuning with XHProf
Salesforce Engineering
 
PPTX
A Smarter Pig: Building a SQL interface to Pig using Apache Calcite
Salesforce Engineering
 
PPTX
Implementing a Content Strategy Is Like Running 100 Miles
Salesforce Engineering
 
PPTX
Salesforce Cloud Infrastructure and Challenges - A Brief Overview
Salesforce Engineering
 
PDF
Koober Preduction IO Presentation
Salesforce Engineering
 
PPTX
Finding Security Issues Fast!
Salesforce Engineering
 
PDF
Microservices
Salesforce Engineering
 
PPTX
Global State Management of Micro Services
Salesforce Engineering
 
PPTX
The Future of Hbase
Salesforce Engineering
 
Locker Service Ready Lightning Components With Webpack
Salesforce Engineering
 
Scaling HBase for Big Data
Salesforce Engineering
 
Techniques to Effectively Monitor the Performance of Customers in the Cloud
Salesforce Engineering
 
Predictive System Performance Data Analysis
Salesforce Engineering
 
Apache HBase State of the Project
Salesforce Engineering
 
Hit the Trail with Trailhead
Salesforce Engineering
 
HBase/PHOENIX @ Scale
Salesforce Engineering
 
Scaling up data science applications
Salesforce Engineering
 
Containers and Security for DevOps
Salesforce Engineering
 
Aspect Oriented Programming: Hidden Toolkit That You Already Have
Salesforce Engineering
 
Monitoring @ Scale in Salesforce
Salesforce Engineering
 
Performance Tuning with XHProf
Salesforce Engineering
 
A Smarter Pig: Building a SQL interface to Pig using Apache Calcite
Salesforce Engineering
 
Implementing a Content Strategy Is Like Running 100 Miles
Salesforce Engineering
 
Salesforce Cloud Infrastructure and Challenges - A Brief Overview
Salesforce Engineering
 
Koober Preduction IO Presentation
Salesforce Engineering
 
Finding Security Issues Fast!
Salesforce Engineering
 
Microservices
Salesforce Engineering
 
Global State Management of Micro Services
Salesforce Engineering
 
The Future of Hbase
Salesforce Engineering
 

Recently uploaded (20)

PDF
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PPTX
Information Retrieval and Extraction - Module 7
premSankar19
 
PDF
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PDF
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PDF
Zero Carbon Building Performance standard
BassemOsman1
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PDF
All chapters of Strength of materials.ppt
girmabiniyam1234
 
PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Information Retrieval and Extraction - Module 7
premSankar19
 
Natural_Language_processing_Unit_I_notes.pdf
sanguleumeshit
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
Zero Carbon Building Performance standard
BassemOsman1
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
All chapters of Strength of materials.ppt
girmabiniyam1234
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 

Stacki and Chef at Pardot

  • 1. Stacki and Chef at Pardot David Peterson Lead Systems Engineer [email protected]
  • 2. About Me I joined Salesforce in 2014 and am currently a Lead Systems Engineer based out of Atlanta, GA. I help lead the infrastructure design and scaling of Salesforce’s product offering, Pardot Marketing Automation. Prior to Salesforce, I worked at Perfect Sense Digital where I was the Lead Engineer in architecting and implementing HGTV and Travel Channel's new website infrastructure in AWS. I also helped design and implement the infrastructure for digital media sites such as Food Network, Univision, Coca-Cola, Walmart, Lionsgate, BET, Snagfilms, National Geographic, and others. Prior to PSD, I worked at ChannelAdvisor, an e-commerce SaaS company, where I helped design and manage the infrastructure responsible for processing over $3 billion in GMV.
  • 3. Agenda ▪ Why Stacki (I’m assuming version 3.2) ▪ Stacki global configuration for multiple DCs ▪ Stacki chef cart setup ▪ Specific Chef configurations and how we handle server re-provisions ▪ Proper ordering with multiple carts ▪ Questions
  • 4. Why Stacki ▪ Managing thousands of servers is easy (csv) ▪ HP and Dell raid controller support ▪ Easy out of the box provisioning but deep customization available ▪ Ability to re-provision without losing data ▪ Easy network/subnet configuration and host assignment ▪ YUM repo support ▪ Command line, command line, command line ▪ Support
  • 5. Stacki Global Configurations [root@stacki]# stack list attr SCOPE ATTR VALUE SOURCE --------- Confirm_Private_PureRootPassword a G --------- HttpConf /etc/httpd/conf G --------- HttpConfigDirExt /etc/httpd/conf.d G --------- HttpRoot /var/www/html G --------- Info_CertificateCountry US G --------- Info_CertificateLocality Solana Beach G --------- Info_CertificateOrganization StackIQ G --------- Info_CertificateState California G --------- Info_ClusterContact ---------------------------------------------------------------------------- G --------- Info_ClusterLatlong N32.87 W117.22 G --------- Info_ClusterName Stacki G --------- Info_ClusterURL http://stackihost.local/ G --------- Info_FQDN stackihost.local G --------- Kickstart_BoxDir /export/stack G --------- Kickstart_DistroDir /export/stack G --------- Kickstart_Keyboard us G --------- Kickstart_Lang en_US G --------- Kickstart_Langsupport en_US G (continued)...
  • 6. Stacki Global Configurations [root@stacki]# stack add attr attr=datacenter value=DC-EAST [root@stacki]# stack add attr attr=chef_server value=https://chef-dc-east.xyz.com:443/organizations/companyX [root@stacki]# stack list attr SCOPE ATTR VALUE SOURCE --------- chef_server https://chef-dc-east.xyz.com:443/organizations/companyX G --------- datacenter DC-EAST G
  • 7. Chef Stacki Cart [root@stacki]# stack add cart chef [root@stacki]# stack list cart NAME BOXES chef: ----- [root@stacki]# tree /export/stack/carts/chef/ ├── graph │ └── cart-chef.xml ├── nodes │ └── cart-chef-backend.xml └── RPMS
  • 8. Chef Config /export/stack/carts/chef/nodes/cart-chef-backend.xml <?xml version="1.0" standalone="no"?> <kickstart> <description> chef cart backend appliance extensions </description> <package>chef</package> <!-- shell code for post RPM installation --> <post> mkdir -p /etc/chef /var/log/chef /var/run/chef </post>
  • 9. Chef Config XML tag Overview ● <post> ○ This tag allows the admin to run scripts after the package installation is done. The scripts can be in any interpreted language present on the installed system. ● <boot order=”post”> ○ This section is a collection of shell scripts that are run on first-boot after all services and daemons have started. This is typically used to run scripts that interact with system daemons, or to finish and clean-up the installation process.
  • 10. Chef Config /export/stack/carts/chef/nodes/cart-chef-backend.xml <post cond="not 'proxyout' in hostname"> ############# DC-EAST ########## if [ "&datacenter;" == "DC-EAST" ] then <file name="/etc/chef/client.rb"> <![CDATA[ # Chef Client Config File # Dynamically generated by Stacki log_level :info log_location STDOUT chef_server_url "#CHEF_SERVER#" validation_client_name "prod-validator" validation_key "/etc/chef/validation.pem" client_key "/etc/chef/client.pem" ssl_verify_mode :verify_none http_proxy 'http://proxyout.dc-east.local.com:3128' https_proxy 'http://proxyout.dc-east.local.com:3128' environment 'production' node_name "#HOSTNAME#" ]]> </file> # Need to add the chef server and client hostname to the client.rb file sed -i 's,#CHEF_SERVER#,&chef_server;,g' /etc/chef/client.rb sed -i 's/#HOSTNAME#/&hostname;.&domainname;/g' /etc/chef/client.rb fi </post>
  • 11. Chef Config /export/stack/carts/chef/nodes/cart-chef-backend.xml <post cond="'proxyout' in hostname"> <file name="/etc/chef/client.rb"> <![CDATA[ # Chef Client Config File # Dynamically generated by Stacki log_level :info log_location STDOUT chef_server_url "#CHEF_SERVER#" validation_client_name "prod-validator" validation_key "/etc/chef/validation.pem" client_key "/etc/chef/client.pem" ssl_verify_mode :verify_none environment 'production' # Using default node name (fqdn) node_name "#HOSTNAME#" ]]> </file> # Need to add the chef server and client hostname to the client.rb file sed -i 's,#CHEF_SERVER#,&chef_server;,g' /etc/chef/client.rb sed -i 's/#HOSTNAME#/&hostname;.&domainname;/g' /etc/chef/client.rb </post>
  • 12. Chef Config /export/stack/carts/chef/nodes/cart-chef-backend.xml <post> if [ "&datacenter;" == "DC-EAST" ] then <file name="/etc/chef/first-boot.json"> { "run_list": [ "role[base]", "role[dc_east]" ] } </file> <file name="/etc/chef/validation.pem" perms="0644"> -----BEGIN RSA PRIVATE KEY----- asdfasdfasdfasdfasdfasdfasdfasdfasdfsadfasdfasdfasdfsadfasdfasdfasdfsadfsadfasdf adsasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasfasdfasdfasdfasdfa -----END RSA PRIVATE KEY----- </file> <file name="/etc/chef/encrypted_data_bag_secret" perms="0400"> asdfasdfasdfasdfasfdasfdasdfasfdasdfasfasdfasfdasdfasdfsafasfdasfdsadfasdfasdfasdf adsfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasfdasdfasdfasdfasdfasdfa </file> fi </post> ######### DC-EAST END ########
  • 13. Chef Config: Server Provisioning ● Two attributes attached to a host control what happens to existing data on that host when it is configured to be provisioned by setting the action attribute: “stack set host boot host1.local.com action=install” ○ nukecontroller ■ If set to “False”: Leaves the existing RAID controller setup as it is ■ If set to “True”: Removes all existing RAID groups and LUNS ○ nukedisks ■ If set to “False”: Only removes everything in the “/” and “/var/log” partition ■ If set to “True”: Will remove all partitions from all disks [root@stacki]# stack list host attr host1.local.com |egrep 'nuke|HOST' HOST SCOPE ATTR VALUE SOURCE host1.local.com: --------- nukecontroller false H host1.local.com: --------- nukedisks false H
  • 14. Chef Config: Server Provisioning /export/stack/carts/chef/nodes/cart-chef-backend.xml # If we are nuking disks we are assuming this is a new server # or the chef client/node has been deleted out of the chef server if it existed. <boot order="post" cond="nukedisks"> # Run chef-client for the first time /usr/bin/chef-client -j /etc/chef/first-boot.json -L /var/log/chef/chef.log # Make a backup of the chef private key in case we need to re-provision/upgrade a server mkdir -p /data/chef-backup chown root:root /data/chef-backup chmod 700 /data/chef-backup cp -a /etc/chef/* /data/chef-backup </boot> [root@stacki]# stack set host attr host1.local.com attr=nukedisks value=true [root@stacki]# stack list host attr host1.local.com |egrep 'nukedisks|HOST' HOST SCOPE ATTR VALUE SOURCE host1.local.com: --------- nukedisks true H
  • 15. Chef Config: Server Provisioning /export/stack/carts/chef/nodes/cart-chef-backend.xml # If we are not nuking the disks we are assuming we are re-loading or upgrading # the OS and need to keep the client.pem chef key so chef-client can run properly <boot order="post" cond="not nukedisks"> cp /data/chef-backup/client.pem /etc/chef/ /usr/bin/chef-client -L /var/log/chef/chef.log </boot> </kickstart>
  • 16. Chef Cart Config ● Put your chef RPM file in /export/stack/carts/chef/RPMS/ directory ● Assign your chef cart to a box ● Compile a cart when adding/removing RPMs to update the repo [root@stacki]# stack enable cart chef box=default [root@stacki]# stack compile cart chef [root@stacki]# stack list cart chef NAME BOXES chef: default
  • 17. Chef Cart Config PRO TIP: When making xml config changes, always verify them by running the “stack list host profile” command which does syntax checking and gives you the full generated kickstart file [root@stacki]# stack list host profile host1.local.com|less <?xml version="1.0" standalone="no"?> <profile lang="kickstart"> <section name="kickstart"> <![CDATA[ # # Node Traversal Order # # /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/partitions-save.xml (stacki) # /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/pre-ssh-key.xml (stacki) # /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/storage-controller-client.xml (stacki) # /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/nukedisks.xml (stacki) # /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/partition.xml (stacki) (continued)...
  • 18. Chef Cart Ordering [root@stacki]# stack list cart NAME BOXES base: default custom-rpms: default chef: default [root@stacki]# stack list host profile host1.local.com|less <?xml version="1.0" standalone="no"?> <profile lang="kickstart"> <section name="kickstart"> <![CDATA[ # # Node Traversal Order # ... # /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/do-partition.xml (stacki) # /export/stack/carts/chef/nodes/cart-chef-backend.xml (unknown) # /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/base.xml (stacki) # /export/stack/carts/base/nodes/cart-base-backend.xml (unknown) # /export/stack/carts/custom-rpms/nodes/cart-custom-rpms-backend.xml (unknown) (continued)...
  • 19. Chef Cart Ordering /export/stack/carts/chef/graph/cart-chef.xml <?xml version="1.0" standalone="no"?> <graph> <description> chef cart </description> <order head="backend" tail="cart-chef-backend"/> <edge from="backend" to="cart-chef-backend"/> </graph> <?xml version="1.0" standalone="no"?> <graph> <description> chef cart </description> <order head="backend" tail="cart-chef-backend"/> <edge from="backend" to="cart-chef-backend"/> <order head="cart-base-backend" tail="cart-chef-backend"/> <edge from="cart-base-backend" to="cart-chef-backend"/> </graph>
  • 20. Chef Cart Ordering [root@stacki]# stack list host profile host1.local.com|less <?xml version="1.0" standalone="no"?> <profile lang="kickstart"> <section name="kickstart"> <![CDATA[ # # Node Traversal Order # ... # /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/do-partition.xml (stacki) # /export/stack/carts/base/nodes/cart-base-backend.xml (unknown) # /export/stack/carts/chef/nodes/cart-chef-backend.xml (unknown) # /export/stack/pallets/stacki/3.2/redhat/x86_64/nodes/base.xml (stacki) # /export/stack/carts/custom-rpms/nodes/cart-custom-rpms-backend.xml (unknown) (continued)...