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:
Note
Please refer to https://github.com/PacktPublishing/Implementing-DevOps-on-AWS/tree/master/5585_05_CodeFiles/CodeCommit/salt/states.
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 is a good time to add an account and an SSH key for yourself.