Skip to content

Instantly share code, notes, and snippets.

@anorgan anorgan/Nginx example.sls
Last active Aug 29, 2015

What would you like to do?
Nginx example
# /srv/salt/nginx/init.sls
# Set up the package repository with PPA
- managed
- ppa: nginx/stable
# This is telling SaltStack that when running pkg module, this is its dependency
# This is a reverse way of setting requirements
- require_in:
- pkg: nginx
# Install the package
- installed
- running
- require:
- pkg: nginx
- watch:
# When something here changes, restart the service
- pkg: nginx
- file: /etc/nginx/sites-enabled/
- file: /etc/nginx/nginx.conf
- managed
- source: salt://nginx/nginx.conf.jinja
- user: root
- group: root
- mode: 644
- template: jinja
- require:
- pkg: nginx
# /srv/salt/nginx/nginx.conf.jinja
user www-data;
worker_processes {{ pillars['nginx']['num_of_workers_per_cpu'] * grains['num_cpus'] }};
pid /run/;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.