Using Salt Orchestration

Hands-On Lab

 

Photo of Elle Krout

Elle Krout

Content Team Lead in Content

Length

01:00:00

Difficulty

Intermediate

Salt's orchestration runner allows Salt to ensure our modules, runners, states, formulas, beacons, and reactors are run in the appropriate order across all minion machines. When using the orchestration runner, our master server uses its master-level overview of all minions to run our Salt commands and states at the appropriate time, instead of concurrently across all minions. This view ensures no server tries to run a state or command before the proper time.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

  1. Create an orchestration directory:

    mkdir /srv/salt/orch
  2. Create an orchestration state:

    vim wordpress.sls
  3. Set hostname:

    set_hostname:
      salt.function:
        - name: network.mod_hostname
        - tgt: 'minion1'
        - arg:
          - web1
  4. Run php, apache, mysql formulas:

    configure_web_minion:
      salt.state:
        - tgt: 'minion1'
        - sls:
          - php
          - apache
          - mysql
          - mysql.client
  5. Run wordpress formula:

    install_wordpress:
      salt.state:
        - tgt: 'minion1'
        - sls: wordpress
  6. Run the orchestration state:

    sudo salt-run state.orch orch.wordpress