Browse Source

Uplift fuel-plugin-tacker to Fuel 10

Migrate tacker service from upstart to systemd because Fuel 10 uses
Ubuntu 16.04.

Change-Id: If0b47469e1252a498100e1adc04cd13d381afb10
Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
George Paraskevopoulos 2 years ago
parent
commit
5733444161

+ 1
- 0
deployment_scripts/puppet/manifests/tacker.pp View File

@@ -62,6 +62,7 @@ class { 'tacker':
62 62
   rabbit_userid       => $rabbit_userid,
63 63
   bind_port           => $bind_port,
64 64
   bind_host           => $bind_host,
65
+  service_provider    => 'systemd',
65 66
   service_name        => $service_name,
66 67
   debug               => $debug,
67 68
   opendaylight_host   => $management_vip,

+ 3
- 3
metadata.yaml View File

@@ -3,11 +3,11 @@ name: tacker
3 3
 # Human-readable name for your plugin
4 4
 title: Tacker VNF manager
5 5
 # Plugin version
6
-version: '0.2.0'
6
+version: '1.0.0'
7 7
 # Description
8 8
 description: Tacker VNF manager
9 9
 # Required fuel version
10
-fuel_version: ['9.0']
10
+fuel_version: ['10.0']
11 11
 # Specify license of your plugin
12 12
 licenses: ['Apache License Version 2.0']
13 13
 # Specify author or company name
@@ -25,7 +25,7 @@ is_hotpluggable: false
25 25
 # The plugin is compatible with releases in the list
26 26
 releases:
27 27
   - os: ubuntu
28
-    version: mitaka-9.0
28
+    version: newton-10.0
29 29
     mode: ['ha']
30 30
     deployment_scripts_path: deployment_scripts/
31 31
     repository_path: repositories/ubuntu

+ 1
- 1
pre_build_hook View File

@@ -38,7 +38,7 @@ function build_pkg {
38 38
     ubuntu)
39 39
       pushd "${DIR}/repositories/${1}/"
40 40
       download $TOSCA_PARSER python-tosca-parser_0.1.0-3_all.deb
41
-      fpm --force -s python -t deb --deb-upstart "${DIR}/tacker_package/tacker-server" --after-install "${DIR}/tacker_package/tacker-post" --no-python-fix-name --python-install-bin /usr/bin --python-install-lib /usr/lib/python2.7/dist-packages ${TMP_DIR}/tacker/setup.py
41
+      fpm --force -s python -t deb --deb-systemd "${DIR}/tacker_package/systemd/tacker-server" --after-install "${DIR}/tacker_package/tacker-post" --no-python-fix-name --python-install-bin /usr/bin --python-install-lib /usr/lib/python2.7/dist-packages ${TMP_DIR}/tacker/setup.py
42 42
       fpm --force -s python -t deb --python-install-lib /usr/lib/python2.7/dist-packages ${TMP_DIR}/tacker-horizon/setup.py
43 43
       fpm --force -s python -t deb --python-install-lib /usr/lib/python2.7/dist-packages ${TMP_DIR}/python-tackerclient/setup.py
44 44
       popd

+ 16
- 0
tacker_package/systemd/tacker-server View File

@@ -0,0 +1,16 @@
1
+# Author: George Paraskevopoulos <geopar@intracom-telecom.com>
2
+# Original Upstart script author: Michal Skalski <mskalski@mirantis.com>
3
+
4
+[Unit]
5
+Description=Tacker VNF Manager
6
+Requires=multi-user.target
7
+After=multi-user.target
8
+
9
+[Service]
10
+WorkingDirectory=/var/run
11
+Restart=always
12
+RestartSec=5
13
+LimitNOFILE=65535
14
+ExecStartPre=/var/lib/tacker/systemd/tacker-pre-service
15
+ExecStart=/var/lib/tacker/systemd/tacker-run-service
16
+

+ 27
- 2
tacker_package/tacker-post View File

@@ -1,6 +1,31 @@
1 1
 #!/bin/sh
2
-set -e
2
+set -uxe
3
+
4
+adduser --quiet --system --group --home /var/lib/tacker tacker
5
+mkdir -p /var/lib/tacker/systemd
6
+
7
+cat > /var/lib/tacker/systemd/tacker-pre-service <<EOF
8
+#!/bin/sh
9
+for dir in run log lib cache ; do
10
+        mkdir -p /var/\${dir}/tacker
11
+        chown tacker /var/\${dir}/tacker
12
+done
13
+chmod 700 /var/cache/tacker
14
+EOF
15
+
16
+cat > /var/lib/tacker/systemd/tacker-run-service << EOF
17
+#!/bin/sh
18
+[ -x "/usr/bin/tacker-server" ] || exit 0
19
+DAEMON_ARGS="--verbose --log-file=/var/log/tacker/tacker-server.log"
20
+exec start-stop-daemon --start --chdir /var/lib/tacker \
21
+        --chuid tacker:tacker --make-pidfile --pidfile /var/run/tacker/tacker-server.pid \
22
+        --exec /usr/bin/tacker-server -- --config-file=/etc/tacker/tacker.conf \${DAEMON_ARGS}
23
+
24
+EOF
25
+
26
+chmod +x /var/lib/tacker/systemd/tacker-pre-service
27
+chmod +x /var/lib/tacker/systemd/tacker-run-service
3 28
 
4
-adduser --quiet --system --group --no-create-home --home /var/lib/tacker tacker
5 29
 mv /usr/local/etc/tacker /etc/
6 30
 chown -R tacker:tacker /etc/tacker
31
+

tacker_package/tacker-server → tacker_package/upstart/tacker-server View File


Loading…
Cancel
Save