Meetup - An introduction to Salt

1,283 views
869 views

Published on

The slides of the Salt introduction meetup.

http://www.meetup.com/middleware/events/166872152/

http://www.meetup.com/SaltStack-User-Group-The-Netherlands/events/171114002/

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,283
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
23
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Meetup - An introduction to Salt

  1. 1. MEETUP SALTPRIMERANINTRODUCTIONTOSALT ERWINEMBSEN&RICHARDWOUDENBERG18MARCH2014
  2. 2. SSC ID 0x57F37A53 ERWINEMBSEN SENIORCONSULTANT XEBIABV,EEMBSEN@XEBIA.COM,+31610901698
  3. 3. SSC id: 0xB5D844E6 RichardWoudenberg ! SeniorConsultant/InnovationArchitect/Troublemaker Xebia/rwoudenberg@xebia.com Immutable Servers
  4. 4. INTRODUCTIONS
  5. 5. SALT OVERVIEW HIGHSPEEDREMOTEEXECUTIONENGINE CONFIGURATIONMANAGEMENTSYSTEM
  6. 6. MASTERANDMINIONS Master Minions
  7. 7. SALT SYNDIC Master Minions Master Master Minions
  8. 8. SALT CLOUD RACKSPACE AMAZONAWS MICROSOFTAZURE DIGITALOCEAN GOGRID GOOGLECOMPUTEENGINE OPENSTACK HPCLOUD
  9. 9. OTHER COMPONENTS SALTVIRT SALTMINE RUNNERS PROXYMINION WINDOWSSOFTWAREREPO REACTOR
  10. 10. EXERCISESETUP SETUPSALTMASTER SETUPSALTMINION
  11. 11. SETUPMASTER-MINIONS / PART1 EXERCISE#1 1. vagrant up master 2. vagrant ssh master 3. (Master) sudo su - 4. (Master) service salt-master start 5. (Master) salt-key -L 6. (Master) service salt-minion start 7. (Master) salt-key -L 8. (Master) salt-key -a master 9. (Master) salt-key -L # Start the master # SSH into the master VM # Change to the root user # Start the Salt master # List keys # Start the Salt minion # List keys # Sign the key # List keys (Master)-Executeonthemaster / (Minion)-Executeontheminion
  12. 12. SETUPMASTER-MINIONS / PART2 EXERCISE#1 1. Open a new terminal windows 2. vagrant up minion 3. vagrant ssh minion 4. (Minion) sudo su - 5. (Minion) service salt-minion start 6. (Master) salt-key -L 7. (Master) salt-key -a minion 8. (Master) salt-key -L # SSH into the minion VM # Change to the root user # Start the Salt minion # List keys # Sign the key # List keys (Master)-Executeonthemaster / (Minion)-Executeontheminion
  13. 13. COMMAND STRUCTURE salt * pkg.install vim InvokeSalt SpecifyTarget CallFunction PassArguments
  14. 14. REMOTEEXECUTION EXERCISE#2 1. vagrant ssh master 2. sudo su - 3. salt * test.ping 4. salt master sys.doc 5. salt master sys.doc file 6. salt * disk.usage 7. salt * status.loadavg 8. salt * pkg.version wget 9. salt minion pkg.install lynx # SSH into the master VM # Change to the root user # Ping all minions # Output sys.doc # Output sys.doc for file # Return usage information # Return load averages # Get version of wget # Install lynx on minion
  15. 15. PROVIDESSAMESETOF COMMANDSAND FUNCTIONALITYASSALT NEEDSROSTERFILETOFUNCTION SALT-SSH
  16. 16. SALTSSH EXERCISE#3 1. vagrant ssh master 2. sudo su - 3. cat /etc/salt/roster 4. salt-ssh minion-ssh pkg.version wget 5. salt-ssh * test.ping
  17. 17. INFORMATIONOFTHEUNDERLYINGSYSTEM AVAILABLETHROUGHTHEGRAINSINTERFACE 2PLACESONTHEMINIONTOSPECIFYTHEM SALT GRAINS
  18. 18. SALTGRAINS EXERCISE#4 1. vagrant ssh master 2. sudo su - 3. salt minion grains.items 4. salt minion grains.item cpuarch 5. salt minion grains.setval meetup salt
 6. (Minion) echo ‘salt: primer’ > /etc/salt/grains 7. salt minion saltutil.sync_grains 8. salt minion grains.item salt
  19. 19. RUNCOMMANDOREXECUTESTATEBYMATCHING: hostnames,systeminformation,definedgroups TARGETING
  20. 20. SALTTARGETING EXERCISE#5 1. vagrant ssh master 2. sudo su - 3. salt minion grains.items 4. salt -G ‘cpuarch:x86_64’ grains.item num_cpus
  21. 21. COREOFTHESALTSYSTEMISTHESALTSTATEFILE REPRESENTSTHEDESIREDSTATEOFASYSTEM STATES
  22. 22. apache: pkg: - installed service: - running # Install package # apache http server # start the service # if it is stopped # Executed in the # order defined STATES
  23. 23. TREE-LIKESTRUCTURES(YAML)OFDATADEFINED ONTHEMASTERANDPASSEDTHROUGHTOMINIONS PILLARS
  24. 24. BUILDATOMCATSTATE-PART#1 EXERCISE#6 1. Open file /srv/salt/states/tomcat/init.sls 2. Alternative is salt/states/tomcat/init.sls 3. Create runtime user tomcat in group tomcat 4. Apply state: salt minion state.sls tomcat 5. Validate that user and group are created http://docs.saltstack.com/ref/states/all
  25. 25. BUILDATOMCATSTATE-PART#2 EXERCISE#6 Extend the tomcat state file with:
 
 install tomcat6 package
 configure tomcat
 start tomcat
  26. 26. ErwinEmbsen eembsen@xebia.com RichardWoudenberg rwoudenberg@xebia.com THANK YOU

×