Skip to content

Instantly share code, notes, and snippets.

@AntelopeSalad
Created June 23, 2014 20:43
Show Gist options
  • Save AntelopeSalad/4f1c6e9fc6037a1abaae to your computer and use it in GitHub Desktop.
Save AntelopeSalad/4f1c6e9fc6037a1abaae to your computer and use it in GitHub Desktop.
# role A - defaults/main.yml
runit_service:
# role A - tasks/main.yml
command: "echo '{{ item.name}} :: {{ item.script }}'"
with_items: runit_service
when: runit_service is iterable
# role B - using it in your inventory or somewhere
runit_service:
- { name: foo, script: "exec 2>&1 chpst -u foo -e /etc/sv/foo/env nodejs /srv/foo/foo.js" }
- { name: bar, script: "exec 2>&1 chpst -u bar -e /etc/sv/bar/env nodejs /srv/bar/bar.js" }
- { name: baz, script: "exec 2>&1 chpst -u baz -e /etc/sv/baz/env nodejs /srv/baz/my_app.js" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment