Fix kitchen
diff --git a/metadata.yml b/metadata.yml
index 918c93b..e1d2cb9 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,3 +1,3 @@
name: "postgresql"
version: "0.2"
-source: "https://github.com/tcpcloud/salt-formula-postgresql"
+source: "https://github.com/salt-formulas/salt-formula-postgresql"
diff --git a/postgresql/_database.sls b/postgresql/_database.sls
index fcbca3e..dae376e 100644
--- a/postgresql/_database.sls
+++ b/postgresql/_database.sls
@@ -1,5 +1,5 @@
{%- for user in database.users %}
-
+{% if not grains.get('noservices', False) %}
postgresql_user_{{ svr_name|default('localhost') }}_{{ database_name }}_{{ user.name }}:
postgres_user.present:
- name: {{ user.name }}
@@ -18,9 +18,10 @@
{%- endfor %}
- user: root
{%- endif %}
-
+{%- endif %}
{%- endfor %}
+{% if not grains.get('noservices', False) %}
postgresql_database_{{ svr_name|default('localhost') }}_{{ database_name }}:
postgres_database.present:
- name: {{ database.get('name', database_name) }}
@@ -40,6 +41,7 @@
{%- endfor %}
- user: root
{%- endif %}
+{%- endif %}
{%- if database.initial_data is defined %}
@@ -56,6 +58,7 @@
- file: postgresql_dirs
- postgres_database: postgresql_database_{{ database_name }}
+{% if not grains.get('noservices', False) %}
restore_postgresql_database_{{ database_name }}:
cmd.run:
- name: /root/postgresql/scripts/restore_{{ database_name }}.sh
@@ -63,5 +66,6 @@
- cwd: /root
- require:
- file: /root/postgresql/scripts/restore_{{ database_name }}.sh
+{%- endif %}
{%- endif %}
diff --git a/postgresql/server.sls b/postgresql/server.sls
index ecbe7ba..fda0be4 100644
--- a/postgresql/server.sls
+++ b/postgresql/server.sls
@@ -12,6 +12,7 @@
{%- if grains.os_family == "Debian" %}
+{% if not grains.get('noservices', False) %}
init_postgresql_cluster:
postgres_cluster.present:
- name: main
@@ -22,6 +23,7 @@
- require_in:
- file: {{ server.dir.config }}/pg_hba.conf
- file: {{ server.dir.config }}/postgresql.conf
+{%- endif %}
{{ server.dir.config }}/pg_hba.conf:
file.managed:
@@ -53,6 +55,7 @@
{%- if grains.os_family == "Debian" %}
+{% if not grains.get('noservices', False) %}
postgresql_service:
service.running:
- name: {{ server.service }}
@@ -62,6 +65,7 @@
- file: {{ server.dir.config }}/postgresql.conf
- require:
- file: /root/.pgpass
+{%- endif %}
{%- for database_name, database in server.get('database', {}).iteritems() %}
{%- include "postgresql/_database.sls" %}
@@ -76,6 +80,7 @@
{%- endif %}
+{% if not grains.get('noservices', False) %}
database_{{ database_name }}_{{ extension_name }}_extension_present:
postgres_extension.present:
- name: {{ extension_name }}
@@ -93,6 +98,7 @@
- user: postgres
- require:
- postgres_database: postgresql_database_{{ database_name }}
+{%- endif %}
{%- endif %}
{%- endfor %}