Operations grimoire/Deploy with Salt: Difference between revisions

From Nasqueron Agora
Line 2: Line 2:
* We deploy from Ysul using:
* We deploy from Ysul using:
** /opt/nasqueron-operations as our local copy of rOPS, authoritative for Salt
** /opt/nasqueron-operations as our local copy of rOPS, authoritative for Salt
** /opt/stating for web application content
** /opt/staging for web application content
* You need to belong to the <code>salt</code> group
* You need to belong to the <code>salt</code> group to be able to control Salt
* You need to belong to the <code>deploy</code> group to be able to update /opt/staging (salt is a member of deploy)
* You want this alias: <code>alias salt sudo -u salt salt</code> (tcsh syntax)
* You want this alias: <code>alias salt sudo -u salt salt</code> (tcsh syntax)
* Check salt-master is run, if not <code>service salt-master start</code>
* Check salt-master is run, if not <code>service salt-master start</code>

Revision as of 05:00, 12 September 2016

Where to work?

  • We deploy from Ysul using:
    • /opt/nasqueron-operations as our local copy of rOPS, authoritative for Salt
    • /opt/staging for web application content
  • You need to belong to the salt group to be able to control Salt
  • You need to belong to the deploy group to be able to update /opt/staging (salt is a member of deploy)
  • You want this alias: alias salt sudo -u salt salt (tcsh syntax)
  • Check salt-master is run, if not service salt-master start

Deployment workflow

  1.  On your laptop, prepare and upload a change to Differential against rOPS repository
  2. Get the change on Ysul: arc patch D607
  3. Ask Salt to apply the change
  4.  Log on #nasqueron-operations something like [Eglide] New user account: amj (D607)
  5. Once working, you can merge it to master

Salt commands

To apply one state or a directory:

salt eglide state.apply roles/shellserver/users

To apply all:

salt eglide state.highstate

Replace eglide by the server name, or * to target all machines.

When you've a new state, ensure it's called from top.sls file, as the repository root.