Do not start barbican services with pkg install
barbican-worker and barbican-api manage the same nss database.
To avoid races during installation:
* Make sure barbica-worker is started after api when enabled
* Do not install barbican-worker automatically with package install
Change-Id: I82c415294e24bd6e2221f0d05f29ab82cac8f9e0
Related-Prod: PROD-26988
diff --git a/barbican/server.sls b/barbican/server.sls
index b64e34c..79f58b9 100644
--- a/barbican/server.sls
+++ b/barbican/server.sls
@@ -7,12 +7,24 @@
- barbican._ssl.rabbitmq
- barbican.db.offline_sync
+barbican_policy-rc.d_present:
+ file.managed:
+ - name: /usr/sbin/policy-rc.d
+ - mode: 755
+ - contents: |
+ #!/bin/sh
+ exit 101
+
barbican_server_packages:
pkg.installed:
- names: {{ server.pkgs }}
- require_in:
- sls: barbican._ssl.mysql
- sls: barbican._ssl.rabbitmq
+ - require:
+ - file: barbican_policy-rc.d_present
+ - require_in:
+ - file: barbican_policy-rc.d_absent
/etc/barbican/barbican.conf:
file.managed:
@@ -187,6 +199,8 @@
{%- endif %}
- watch:
- file: /etc/barbican/barbican.conf
+ - require:
+ - barbican_server_services
{%- else %}
barbican_async_workers_disable:
service.dead:
@@ -217,4 +231,9 @@
{%- endif %}
{%- endif %}
+
+barbican_policy-rc.d_absent:
+ file.absent:
+ - name: /usr/sbin/policy-rc.d
+
{%- endif %}