Add designate user for designate-manage commands
Change-Id: I61f6112cac848bc2009acd7b5de544f688698758
Related-Prod: PROD-26062
diff --git a/designate/db/offline_sync.sls b/designate/db/offline_sync.sls
index fd49a7f..06f2615 100644
--- a/designate/db/offline_sync.sls
+++ b/designate/db/offline_sync.sls
@@ -3,6 +3,7 @@
designate_syncdb:
cmd.run:
- name: designate-manage database sync
+ - runas: designate
{%- if grains.get('noservices') or server.get('role', 'primary') == 'secondary' %}
- onlyif: /bin/false
{%- endif %}
diff --git a/designate/server.sls b/designate/server.sls
index 7d08007..dbdedbc 100644
--- a/designate/server.sls
+++ b/designate/server.sls
@@ -144,6 +144,7 @@
designate_pool_sync:
cmd.run:
- name: designate-manage pool-manager-cache sync
+ - runas: designate
{%- if grains.get('noservices') %}
- onlyif: /bin/false
{%- endif %}
@@ -180,6 +181,7 @@
designate_pool_update:
cmd.run:
- name: "attempts=3; for i in $(seq 1 $attempts); do if designate-manage pool update; then exit 0; else if [[ $i -ge $attempts ]]; then exit 1; else sleep 10; fi; fi; done"
+ - runas: designate
- shell: /bin/bash
- require:
- service: designate_server_services