Skip to content

Instantly share code, notes, and snippets.

@flyx
Created September 21, 2015 18:15
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 flyx/7dbb3d3d5df9c7249982 to your computer and use it in GitHub Desktop.
Save flyx/7dbb3d3d5df9c7249982 to your computer and use it in GitHub Desktop.
# somewhere in a jinja for loop where {{name}} is set
"cd /tmp && /usr/lib/ssl/misc/newcert.expect {{name}} {{pillar['ssl']['capass']}} && mv newcert.pem /etc/nginx/ssl/cert/{{name}}.crt && mv newkey.nopass.pem /etc/nginx/ssl/private/{{name}}.key":
cmd.run:
- creates:
- /etc/nginx/ssl/cert/{{name}}.crt
- /etc/nginx/ssl/private/{{name}}.key
# somewhere else
exim4:
service.running:
- require:
- pkg: exim4-daemon-heavy
- file: /etc/nginx/ssl/cert/{{pillar['server']['mail']}}.crt
- file: /etc/nginx/ssl/private/{{pillar['server']['mail']}}.key
- watch:
- file: /etc/exim4/exim4.conf
# error I'm getting:
#
# The following requisites were not found:
# require:
# file: /etc/nginx/ssl/cert/mail.flyx.org.crt
# file: /etc/nginx/ssl/private/mail.flyx.org.key
#
# These files exist and are created by the first state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment