Last active
December 22, 2015 20:49
-
-
Save copelco/6528865 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mine_interfaces: | |
match: '*' | |
function: | |
mine.send: | |
- network.interfaces | |
db: | |
match: '*db*' | |
require: | |
- mine_interfaces | |
sls: | |
- postgresql.project | |
- postgresql.ufw | |
app: | |
match: '*web*' | |
require: | |
- db | |
sls: | |
- pgbouncer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; hiii | |
{% for host, ifaces in salt['mine.get']('{{ target }}', 'network.interfaces').iteritems() %} | |
{% set host_addr = ifaces.get('{{ interface }}', {}).get('inet', [{}])[0].get('address') %} | |
{{ pillar['project_name'] }}_{{ pillar['environment'] }} = host={{ address }} | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgresql-client: | |
pkg: | |
- installed | |
pgbouncer: | |
pkg: | |
- installed | |
- require: | |
- pkg: postgresql-client | |
service: | |
- running | |
- enable: True | |
pgbouncer_ini: | |
file.managed: | |
- name: /etc/pgbouncer/pgbouncer.ini | |
- source: salt://pgbouncer/pgbouncer.ini | |
- user: root | |
- group: root | |
- mode: 0640 | |
- template: jinja | |
- context: | |
target: '*db*' | |
interface: pillar['primary_iface'] | |
- require: | |
- pkg: pgbouncer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment