summaryrefslogtreecommitdiffstats
path: root/mcp/salt-formulas/tacker/server.sls
diff options
context:
space:
mode:
authorMichael Polenchuk <mpolenchuk@mirantis.com>2018-06-01 14:24:35 +0400
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-06-08 15:30:42 +0200
commit21638104f5b82ef06c4c60cf968aab5ae8906e31 (patch)
tree48b550bfb5b39152a95d3cf86f7580aba2b71fb8 /mcp/salt-formulas/tacker/server.sls
parentbf341b7e0d7e423044827f379e4b180e9dc897a1 (diff)
Bring in Tacker salt formula
Install tacker from git repository since there is no ubuntu package yet. Change-Id: Ibe4b6486050213df1a545c5c79c43a635bbf6c08 Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
Diffstat (limited to 'mcp/salt-formulas/tacker/server.sls')
-rw-r--r--mcp/salt-formulas/tacker/server.sls56
1 files changed, 56 insertions, 0 deletions
diff --git a/mcp/salt-formulas/tacker/server.sls b/mcp/salt-formulas/tacker/server.sls
new file mode 100644
index 000000000..eb3468a11
--- /dev/null
+++ b/mcp/salt-formulas/tacker/server.sls
@@ -0,0 +1,56 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+{%- from "tacker/map.jinja" import server with context %}
+{%- if server.enabled %}
+
+include:
+- git
+
+{{ server.git.source }}:
+ git.latest:
+ - target: {{ server.git.target }}
+ - rev: {{ server.git.branch }}
+ - depth: 1
+
+tacker_packages:
+ pkg.installed:
+ - names: {{ server.pkgs }}
+
+tacker_install:
+ cmd.run:
+ - name: python setup.py install
+ - cwd: {{ server.git.target }}
+ - creates: /usr/local/bin/tacker-server
+ - require:
+ - git: {{ server.git.source }}
+
+/usr/local/etc/tacker/tacker.conf:
+ file.managed:
+ - source: salt://tacker/files/tacker.conf
+ - template: jinja
+ - makedirs: true
+ - require:
+ - cmd: tacker_install
+
+tacker_db_manage:
+ cmd.run:
+ - name: /usr/local/bin/tacker-db-manage --config-file /usr/local/etc/tacker/tacker.conf upgrade head
+ - require:
+ - file: /usr/local/etc/tacker/tacker.conf
+
+/lib/systemd/system/tacker.service:
+ file.managed:
+ - source: salt://tacker/files/tacker.systemd
+
+tacker:
+ service.running:
+ - enable: true
+ - watch:
+ - file: /usr/local/etc/tacker/tacker.conf
+
+{%- endif %}