saltstack presentation for august - bangpyper demo
HTML JavaScript SaltStack CSS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
present
srv/salt
miscCommands
readme
setup

readme

This tutorial is meant for saltstack demo in August Bangpypers meet.
To understand various saltstack concepts like, minion, master, grains, pillars, state files, salt modules.

There are salt state files added in srv folder. 
On running salt '*' state.highstate in salt master, a `hello world` nodejs web application
will be installed as a systemd service and made up and running. You can view the running 
application at http://guestIp:3010.
'present' folder contains the ppt stuff, which i recommend others to go through before attending workshop
 index.html contains 9 slides, and use the url ------ 
 /path/to/index.html#1
 to see the contents. Press down/up key to navigate between the slides......
*********************************************************************************************************
Prerequisites for the workshop attendees:
*********************************************************************************************************
Four steps:
1) Install hypervisor, virt-manager
2) Bring up a Centos Vm Instance
3) Login to Vm
4) ssh to Vm
5) Change hostname

1) Install hypervisor, virt-manager
  sudo apt-get install virt-manager
2) Bring up a Centos Vm Instance
Download image, say centos7_bangpydemo.qcow2 from  http://cloud.centos.org/centos/7/images/
Create a new guest machine following the instructions at,
  https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/chap-Virtualization_Host_Configuration_and_Guest_Installation_Guide-Guest_Installation_Virt_Manager-Creating_guests_with_virt_manager.html
Try to boot the virtual instance. If it throws error as, "No bootable device", refer this post and fix it,
  http://serverfault.com/questions/675437/boot-failed-virt-manager-fails-to-load-qcow2-image && 
  http://ubuntuforums.org/showthread.php?t=1638708
3) Login to Vm
  Now, try to login as root user into the VM. If it asks for password authentication, use guestfish to remove password for root user,
    sudo apt-get install libguestfs-tools  # Debian/Ubuntu
    guestfish --ro -i -a disk.img
    https://access.redhat.com/discussions/664843
  Now you must be able to login into vm via virt-manager
  Run ifconfig inside Vm to get eth0 IPAddress. If eth0 is not up and running,
    http://unix.stackexchange.com/questions/36705/why-the-default-eth0-interface-is-down-by-default-on-centos
  and reboot the Vm
  Note down eth0's Ip address.
4) ssh to Vm
  Try ssh root@guestIp. It may fail, because ssh protocol by default doesnot allow ssh login with empty passwords.
  Add these three lines to /etc/ssh/sshd_config,
    StrictModes yes 
    PermitEmptyPasswords yes
    PermitRootLogin yes
  Restart ssh daemon as, sudo service sshd restart
  Confirm, you are able to do, ssh root@guestIp from the host machine
5) Change hostname
   Change guestmachine hostname as 'salt-at-redhat' in /etc/hostname
   Get the guestmachine's ip by running this command on host machine --- `arp -an` 
   In /etc/hosts on the host machine, add an entry `guestIp salt-at-redhat`
   Try `ping salt-at-redhat` and `ssh salt-at-redhat` from the host m/c and both must work.
6) Install salt
   - For CentOs machines, you need to add EPEL to yum.repos.d before installing salt packages
     -- rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
   - On master(host machine):
     `yum install salt-master` #use apt-get if you have a ubuntu machine
     `service salt-master status`
     must say, service is up and running
   - On minion(Centos vm):
     `yum install salt-minion`
     `service salt-minion status`
   In case you face errors during  `yum install salt-*`, try the debugging steps given here - http://hobodave.com/2011/02/10/fixing-epel-primary-sqlite-database-not-found/
       
Now, all the necessary resources are set up in place.
Go through the presentation in github repo, bangpy-aug-saltstack/present/index.html and do those steps, as much as you can before coming for the workshop