Skip to content

Instantly share code, notes, and snippets.

Created May 15, 2015 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1bb2f4a7be3175853172 to your computer and use it in GitHub Desktop.
Save anonymous/1bb2f4a7be3175853172 to your computer and use it in GitHub Desktop.
#!py
import yaml
def run():
config = yaml.load(file('/srv/pillar/common/nginx.sls', 'r'))
name = {'server_name': 'another-salt-test.com'}
root = {'root': '/var/www/another-salt-test.com/current/web'}
config['nginx']['ng']['server']['config']['worker_processes'] = __grains__['num_cpus']
config['nginx']['ng']['vhosts']['managed']['production']['config'][0]['server'].insert(1, name)
config['nginx']['ng']['vhosts']['managed']['production']['config'][0]['server'].insert(2, root)
return config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment