Prepareing Salt code

We will be using SaltStack to apply configuration management on both our Jenkins and demo-app web server nodes. We will be using Grains to define which States/Pillars apply to which host. Let us have a look at the code:

States

top.sls

The top file shows us that some states are shared between all hosts/roles while others are assigned based on the role:

base: 
  '*': 
    - users 
    - yum-s3 
 
  'roles:jenkins': 
    - match: grain 
    - jenkins 
    - nginx.jenkins 
    - docker 
    - packer 
 
  'roles:demo-app': 
    - match: grain 
    - php-fpm 
    - nginx.demo-app 
    - demo-app 

You are already familiar with the users and the yum-s3 States. Now this ...

Get Implementing DevOps on AWS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.