Browse Source

Tacker VNF plugin for Fuel

This plugin install custom version of tacker which support SFC through
OpenDaylight controller. Both tacker code and puppet module for
installing tacker are fetch from repositories defined inside
pre_build_hook file.

For now it is possible to deploy one instance of tacker-server managed
by upstart script.

Signed-off-by: Michal Skalski <mskalski@mirantis.com>
Michal Skalski 3 years ago
commit
60acf33d28

+ 6
- 0
.gitignore View File

@@ -0,0 +1,6 @@
1
+.tox
2
+.build
3
+*.pyc
4
+*.deb
5
+*.rpm
6
+deployment_scripts/puppet/modules/tacker/

+ 202
- 0
LICENSE View File

@@ -0,0 +1,202 @@
1
+Apache License
2
+                           Version 2.0, January 2004
3
+                        http://www.apache.org/licenses/
4
+
5
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+   1. Definitions.
8
+
9
+      "License" shall mean the terms and conditions for use, reproduction,
10
+      and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+      "Licensor" shall mean the copyright owner or entity authorized by
13
+      the copyright owner that is granting the License.
14
+
15
+      "Legal Entity" shall mean the union of the acting entity and all
16
+      other entities that control, are controlled by, or are under common
17
+      control with that entity. For the purposes of this definition,
18
+      "control" means (i) the power, direct or indirect, to cause the
19
+      direction or management of such entity, whether by contract or
20
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+      outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+      "You" (or "Your") shall mean an individual or Legal Entity
24
+      exercising permissions granted by this License.
25
+
26
+      "Source" form shall mean the preferred form for making modifications,
27
+      including but not limited to software source code, documentation
28
+      source, and configuration files.
29
+
30
+      "Object" form shall mean any form resulting from mechanical
31
+      transformation or translation of a Source form, including but
32
+      not limited to compiled object code, generated documentation,
33
+      and conversions to other media types.
34
+
35
+      "Work" shall mean the work of authorship, whether in Source or
36
+      Object form, made available under the License, as indicated by a
37
+      copyright notice that is included in or attached to the work
38
+      (an example is provided in the Appendix below).
39
+
40
+      "Derivative Works" shall mean any work, whether in Source or Object
41
+      form, that is based on (or derived from) the Work and for which the
42
+      editorial revisions, annotations, elaborations, or other modifications
43
+      represent, as a whole, an original work of authorship. For the purposes
44
+      of this License, Derivative Works shall not include works that remain
45
+      separable from, or merely link (or bind by name) to the interfaces of,
46
+      the Work and Derivative Works thereof.
47
+
48
+      "Contribution" shall mean any work of authorship, including
49
+      the original version of the Work and any modifications or additions
50
+      to that Work or Derivative Works thereof, that is intentionally
51
+      submitted to Licensor for inclusion in the Work by the copyright owner
52
+      or by an individual or Legal Entity authorized to submit on behalf of
53
+      the copyright owner. For the purposes of this definition, "submitted"
54
+      means any form of electronic, verbal, or written communication sent
55
+      to the Licensor or its representatives, including but not limited to
56
+      communication on electronic mailing lists, source code control systems,
57
+      and issue tracking systems that are managed by, or on behalf of, the
58
+      Licensor for the purpose of discussing and improving the Work, but
59
+      excluding communication that is conspicuously marked or otherwise
60
+      designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+      "Contributor" shall mean Licensor and any individual or Legal Entity
63
+      on behalf of whom a Contribution has been received by Licensor and
64
+      subsequently incorporated within the Work.
65
+
66
+   2. Grant of Copyright License. Subject to the terms and conditions of
67
+      this License, each Contributor hereby grants to You a perpetual,
68
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+      copyright license to reproduce, prepare Derivative Works of,
70
+      publicly display, publicly perform, sublicense, and distribute the
71
+      Work and such Derivative Works in Source or Object form.
72
+
73
+   3. Grant of Patent License. Subject to the terms and conditions of
74
+      this License, each Contributor hereby grants to You a perpetual,
75
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+      (except as stated in this section) patent license to make, have made,
77
+      use, offer to sell, sell, import, and otherwise transfer the Work,
78
+      where such license applies only to those patent claims licensable
79
+      by such Contributor that are necessarily infringed by their
80
+      Contribution(s) alone or by combination of their Contribution(s)
81
+      with the Work to which such Contribution(s) was submitted. If You
82
+      institute patent litigation against any entity (including a
83
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+      or a Contribution incorporated within the Work constitutes direct
85
+      or contributory patent infringement, then any patent licenses
86
+      granted to You under this License for that Work shall terminate
87
+      as of the date such litigation is filed.
88
+
89
+   4. Redistribution. You may reproduce and distribute copies of the
90
+      Work or Derivative Works thereof in any medium, with or without
91
+      modifications, and in Source or Object form, provided that You
92
+      meet the following conditions:
93
+
94
+      (a) You must give any other recipients of the Work or
95
+          Derivative Works a copy of this License; and
96
+
97
+      (b) You must cause any modified files to carry prominent notices
98
+          stating that You changed the files; and
99
+
100
+      (c) You must retain, in the Source form of any Derivative Works
101
+          that You distribute, all copyright, patent, trademark, and
102
+          attribution notices from the Source form of the Work,
103
+          excluding those notices that do not pertain to any part of
104
+          the Derivative Works; and
105
+
106
+      (d) If the Work includes a "NOTICE" text file as part of its
107
+          distribution, then any Derivative Works that You distribute must
108
+          include a readable copy of the attribution notices contained
109
+          within such NOTICE file, excluding those notices that do not
110
+          pertain to any part of the Derivative Works, in at least one
111
+          of the following places: within a NOTICE text file distributed
112
+          as part of the Derivative Works; within the Source form or
113
+          documentation, if provided along with the Derivative Works; or,
114
+          within a display generated by the Derivative Works, if and
115
+          wherever such third-party notices normally appear. The contents
116
+          of the NOTICE file are for informational purposes only and
117
+          do not modify the License. You may add Your own attribution
118
+          notices within Derivative Works that You distribute, alongside
119
+          or as an addendum to the NOTICE text from the Work, provided
120
+          that such additional attribution notices cannot be construed
121
+          as modifying the License.
122
+
123
+      You may add Your own copyright statement to Your modifications and
124
+      may provide additional or different license terms and conditions
125
+      for use, reproduction, or distribution of Your modifications, or
126
+      for any such Derivative Works as a whole, provided Your use,
127
+      reproduction, and distribution of the Work otherwise complies with
128
+      the conditions stated in this License.
129
+
130
+   5. Submission of Contributions. Unless You explicitly state otherwise,
131
+      any Contribution intentionally submitted for inclusion in the Work
132
+      by You to the Licensor shall be under the terms and conditions of
133
+      this License, without any additional terms or conditions.
134
+      Notwithstanding the above, nothing herein shall supersede or modify
135
+      the terms of any separate license agreement you may have executed
136
+      with Licensor regarding such Contributions.
137
+
138
+   6. Trademarks. This License does not grant permission to use the trade
139
+      names, trademarks, service marks, or product names of the Licensor,
140
+      except as required for reasonable and customary use in describing the
141
+      origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+   7. Disclaimer of Warranty. Unless required by applicable law or
144
+      agreed to in writing, Licensor provides the Work (and each
145
+      Contributor provides its Contributions) on an "AS IS" BASIS,
146
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+      implied, including, without limitation, any warranties or conditions
148
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+      PARTICULAR PURPOSE. You are solely responsible for determining the
150
+      appropriateness of using or redistributing the Work and assume any
151
+      risks associated with Your exercise of permissions under this License.
152
+
153
+   8. Limitation of Liability. In no event and under no legal theory,
154
+      whether in tort (including negligence), contract, or otherwise,
155
+      unless required by applicable law (such as deliberate and grossly
156
+      negligent acts) or agreed to in writing, shall any Contributor be
157
+      liable to You for damages, including any direct, indirect, special,
158
+      incidental, or consequential damages of any character arising as a
159
+      result of this License or out of the use or inability to use the
160
+      Work (including but not limited to damages for loss of goodwill,
161
+      work stoppage, computer failure or malfunction, or any and all
162
+      other commercial damages or losses), even if such Contributor
163
+      has been advised of the possibility of such damages.
164
+
165
+   9. Accepting Warranty or Additional Liability. While redistributing
166
+      the Work or Derivative Works thereof, You may choose to offer,
167
+      and charge a fee for, acceptance of support, warranty, indemnity,
168
+      or other liability obligations and/or rights consistent with this
169
+      License. However, in accepting such obligations, You may act only
170
+      on Your own behalf and on Your sole responsibility, not on behalf
171
+      of any other Contributor, and only if You agree to indemnify,
172
+      defend, and hold each Contributor harmless for any liability
173
+      incurred by, or claims asserted against, such Contributor by reason
174
+      of your accepting any such warranty or additional liability.
175
+
176
+   END OF TERMS AND CONDITIONS
177
+
178
+   APPENDIX: How to apply the Apache License to your work.
179
+
180
+      To apply the Apache License to your work, attach the following
181
+      boilerplate notice, with the fields enclosed by brackets "{}"
182
+      replaced with your own identifying information. (Don't include
183
+      the brackets!)  The text should be enclosed in the appropriate
184
+      comment syntax for the file format. We also recommend that a
185
+      file or class name and description of purpose be included on the
186
+      same "printed page" as the copyright notice for easier
187
+      identification within third-party archives.
188
+
189
+   Copyright {yyyy} {name of copyright owner}
190
+
191
+   Licensed under the Apache License, Version 2.0 (the "License");
192
+   you may not use this file except in compliance with the License.
193
+   You may obtain a copy of the License at
194
+
195
+       http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+   Unless required by applicable law or agreed to in writing, software
198
+   distributed under the License is distributed on an "AS IS" BASIS,
199
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+   See the License for the specific language governing permissions and
201
+   limitations under the License.
202
+

+ 12
- 0
README.md View File

@@ -0,0 +1,12 @@
1
+Tacker plugin for Fuel
2
+============
3
+
4
+This plugin install Tacker VNF manager which support SFC through OpenDaylight controller.
5
+
6
+Dependencies
7
+------------
8
+
9
+Below plugins needs to be also installed:
10
+
11
+* [OpenDaylight](https://github.com/openstack/fuel-plugin-opendaylight)
12
+* [OVS with NSH support](https://github.com/openstack/fuel-plugin-ovs)

+ 49
- 0
deployment_scripts/puppet/manifests/db.pp View File

@@ -0,0 +1,49 @@
1
+notice('MODULAR: tacker/db.pp')
2
+
3
+$plugin_hash    = hiera_hash('tacker', {})
4
+$tacker_hash    = $plugin_hash['metadata']
5
+$mysql_hash     = hiera_hash('mysql', {})
6
+$management_vip = hiera('management_vip')
7
+$database_vip   = hiera('database_vip')
8
+
9
+$mysql_root_user     = pick($mysql_hash['root_user'], 'root')
10
+$mysql_root_password = $mysql_hash['root_password']
11
+
12
+$db_user     = pick($tacker_hash['user'], 'tacker')
13
+$db_name     = pick($tacker_hash['db_name'], 'tacker')
14
+$db_password = pick($tacker_hash['db_password'], $mysql_root_password)
15
+
16
+$db_host          = $database_vip
17
+$db_root_user     = $mysql_root_user
18
+$db_root_password = $mysql_root_password
19
+
20
+$allowed_hosts = [ 'localhost', '127.0.0.1', '%' ]
21
+
22
+validate_string($mysql_root_user)
23
+validate_string($database_vip)
24
+
25
+class { 'galera::client':
26
+  custom_setup_class => hiera('mysql_custom_setup_class', 'galera'),
27
+}
28
+
29
+class { 'tacker::db::mysql':
30
+  user          => $db_user,
31
+  password      => $db_password,
32
+  dbname        => $db_name,
33
+  allowed_hosts => $allowed_hosts,
34
+}
35
+
36
+class { 'osnailyfacter::mysql_access':
37
+  db_host     => $db_host,
38
+  db_user     => $db_root_user,
39
+  db_password => $db_root_password,
40
+}
41
+
42
+Class['galera::client'] ->
43
+  Class['osnailyfacter::mysql_access'] ->
44
+    Class['tacker::db::mysql']
45
+
46
+class mysql::config {}
47
+include mysql::config
48
+class mysql::server {}
49
+include mysql::server

+ 46
- 0
deployment_scripts/puppet/manifests/haproxy.pp View File

@@ -0,0 +1,46 @@
1
+notice('MODULAR: tacker/haproxy.pp')
2
+
3
+$plugin_hash    = hiera_hash('tacker', {})
4
+$tacker_hash    = $plugin_hash['metadata']
5
+$tacker_port    = $tacker_hash['port']
6
+
7
+$network_metadata   = hiera_hash('network_metadata')
8
+$tacker_address_map = get_node_to_ipaddr_map_by_network_role(get_nodes_hash_by_roles($network_metadata, ['tacker']), 'management')
9
+
10
+$public_ssl_hash   = hiera('public_ssl')
11
+$ssl_hash          = hiera_hash('use_ssl', {})
12
+
13
+$public_ssl        = get_ssl_property($ssl_hash, $public_ssl_hash, 'tacker', 'public', 'usage', false)
14
+$public_ssl_path   = get_ssl_property($ssl_hash, $public_ssl_hash, 'tacker', 'public', 'path', [''])
15
+
16
+$internal_ssl      = get_ssl_property($ssl_hash, {}, 'tacker', 'internal', 'usage', false)
17
+$internal_ssl_path = get_ssl_property($ssl_hash, {}, 'tacker', 'internal', 'path', [''])
18
+
19
+firewall {'220 tacker':
20
+  port   => [$tacker_port],
21
+  proto  => 'tcp',
22
+  action => 'accept',
23
+}
24
+
25
+Openstack::Ha::Haproxy_service {
26
+  internal_virtual_ip => hiera('management_vip'),
27
+  ipaddresses         => values($tacker_address_map),
28
+  public_virtual_ip   => hiera('public_vip'),
29
+  server_names        => keys($tacker_address_map),
30
+}
31
+
32
+openstack::ha::haproxy_service { 'tacker':
33
+  order                  => '220',
34
+  listen_port            => $tacker_port,
35
+  public                 => true,
36
+  public_ssl             => $public_ssl,
37
+  public_ssl_path        => $public_ssl_path,
38
+  internal_ssl           => $internal_ssl,
39
+  internal_ssl_path      => $internal_ssl_path,
40
+  haproxy_config_options => {
41
+      'option'         => ['httpchk /', 'httplog', 'httpclose'],
42
+      'http-request'   => 'set-header X-Forwarded-Proto https if { ssl_fc }',
43
+      'timeout server' => '11m',
44
+  },
45
+  balancermember_options => 'check inter 10s fastinter 2s downinter 3s rise 3 fall 3',
46
+}

+ 46
- 0
deployment_scripts/puppet/manifests/keystone.pp View File

@@ -0,0 +1,46 @@
1
+notice('MODULAR: tacker/keystone.pp')
2
+
3
+$plugin_hash = hiera_hash('tacker', {})
4
+$tacker_hash = $plugin_hash['metadata']
5
+$port = $tacker_hash['port']
6
+
7
+$public_vip          = hiera('public_vip')
8
+$public_ssl_hash     = hiera_hash('public_ssl')
9
+$management_vip      = hiera('management_vip')
10
+$region              = pick($tacker_hash['region'], hiera('region', 'RegionOne'))
11
+$password            = $tacker_hash['user_password']
12
+$auth_name           = pick($tacker_hash['auth_name'], 'tacker')
13
+$configure_endpoint  = pick($tacker_hash['configure_endpoint'], true)
14
+$configure_user      = pick($tacker_hash['configure_user'], true)
15
+$configure_user_role = pick($tacker_hash['configure_user_role'], true)
16
+$service_name        = pick($tacker_hash['service_name'], 'tacker')
17
+$tenant              = pick($tacker_hash['tenant'], 'services')
18
+$ssl_hash            = hiera_hash('use_ssl', {})
19
+
20
+Class['::osnailyfacter::wait_for_keystone_backends'] -> Class['::tacker::keystone::auth']
21
+
22
+$public_protocol     = get_ssl_property($ssl_hash, $public_ssl_hash, 'tacker', 'public', 'protocol', 'http')
23
+$public_address      = get_ssl_property($ssl_hash, $public_ssl_hash, 'tacker', 'public', 'hostname', [$public_vip])
24
+$internal_protocol   = get_ssl_property($ssl_hash, {}, 'tacker', 'internal', 'protocol', 'http')
25
+$internal_address    = get_ssl_property($ssl_hash, {}, 'tacker', 'internal', 'hostname', [$management_vip])
26
+$admin_protocol      = get_ssl_property($ssl_hash, {}, 'tacker', 'admin', 'protocol', 'http')
27
+$admin_address       = get_ssl_property($ssl_hash, {}, 'tacker', 'admin', 'hostname', [$management_vip])
28
+
29
+$public_url   = "${public_protocol}://${public_address}:${port}"
30
+$internal_url = "${internal_protocol}://${internal_address}:${port}"
31
+$admin_url    = "${admin_protocol}://${admin_address}:${port}"
32
+
33
+validate_string($public_address)
34
+validate_string($password)
35
+
36
+class {'::osnailyfacter::wait_for_keystone_backends':}
37
+
38
+class { 'tacker::keystone::auth':
39
+  auth_name           => $auth_name,
40
+  password            => $password,
41
+  tenant              => $tenant,
42
+  admin_url           => $admin_url,
43
+  internal_url        => $internal_url,
44
+  public_url          => $public_url,
45
+  region              => $region,
46
+}

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

@@ -0,0 +1,67 @@
1
+notice('MODULAR: tacker.pp')
2
+
3
+$management_vip      = hiera('management_vip')
4
+$network_scheme = hiera_hash('network_scheme', {})
5
+prepare_network_config($network_scheme)
6
+
7
+$plugin_hash = hiera_hash('tacker', {})
8
+$debug       = $plugin_hash['debug']
9
+$tacker_hash = $plugin_hash['metadata']
10
+$odl         = hiera_hash('opendaylight', {})
11
+$odl_port    = $odl['rest_api_port']
12
+
13
+$bind_port    = $tacker_hash['port']
14
+$bind_host    = get_network_role_property('management', 'ipaddr')
15
+$service_name = pick($tacker_hash['service'], 'tacker-server')
16
+
17
+$tacker_tenant        = pick($tacker_hash['tenant'], 'services')
18
+$tacker_user          = pick($tacker_hash['user'], 'tacker')
19
+$tacker_user_password = $tacker_hash['user_password']
20
+
21
+$ssl_hash               = hiera_hash('use_ssl', {})
22
+$internal_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'protocol', 'http')
23
+$internal_auth_address  = get_ssl_property($ssl_hash, {}, 'keystone', 'internal', 'hostname', [hiera('service_endpoint', ''), $management_vip])
24
+$admin_auth_protocol    = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'protocol', 'http')
25
+$admin_auth_address     = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', [hiera('service_endpoint', ''), $management_vip])
26
+
27
+$auth_uri     = "${internal_auth_protocol}://${internal_auth_address}:5000/"
28
+$identity_uri = "${admin_auth_protocol}://${admin_auth_address}:35357/"
29
+
30
+$database_vip = hiera('database_vip', undef)
31
+$db_type      = 'mysql'
32
+$db_host      = pick($tacker_hash['db_host'], $database_vip)
33
+$db_user      = pick($tacker_hash['username'], 'tacker')
34
+$db_password  = $tacker_hash['db_password']
35
+$db_name      = pick($tacker_hash['db_name'], 'tacker')
36
+
37
+$db_connection = os_database_connection({
38
+  'dialect'  => $db_type,
39
+  'host'     => $db_host,
40
+  'database' => $db_name,
41
+  'username' => $db_user,
42
+  'password' => $db_password,
43
+  'charset'  => 'utf8'
44
+})
45
+
46
+$rabbit_hash        = hiera_hash('rabbit_hash', {})
47
+$rabbit_hosts       = split(hiera('amqp_hosts',''), ',')
48
+$rabbit_password    = $rabbit_hash['password']
49
+$rabbit_userid      = $rabbit_hash['user']
50
+
51
+class { 'tacker':
52
+  keystone_password   => $tacker_user_password,
53
+  keystone_tenant     => $tacker_tenant,
54
+  keystone_user       => $tacker_user,
55
+  auth_uri            => $auth_uri,
56
+  identity_uri        => $identity_uri,
57
+  database_connection => $db_connection,
58
+  rabbit_hosts        => $rabbit_hosts,
59
+  rabbit_password     => $rabbit_password,
60
+  rabbit_userid       => $rabbit_userid,
61
+  bind_port           => $bind_port,
62
+  bind_host           => $bind_host,
63
+  service_name        => $service_name,
64
+  debug               => $debug,
65
+  opendaylight_host   => $management_vip,
66
+  opendaylight_port   => $odl_port,
67
+}

+ 0
- 0
deployment_scripts/puppet/modules/.gitkeep View File


+ 58
- 0
deployment_tasks.yaml View File

@@ -0,0 +1,58 @@
1
+- id: tacker
2
+  type: group
3
+  role: [tacker]
4
+  requires: [deploy_start, primary-controller]
5
+  required_for: [deploy_end]
6
+  tasks: [hiera, globals, tools, logging, netconfig, hosts, deploy_start]
7
+  parameters:
8
+    strategy:
9
+      type: parallel
10
+- id: tacker-install
11
+  type: puppet
12
+  version: 2.0.0
13
+  groups: [tacker]
14
+  required_for: [deploy_end]
15
+  requires: [openstack-haproxy, primary-database, primary-controller]
16
+  cross-depends:
17
+    - name: tacker-db
18
+    - name: tacker-keystone
19
+  parameters:
20
+    puppet_manifest: puppet/manifests/tacker.pp
21
+    puppet_modules: puppet/modules:/etc/puppet/modules
22
+    timeout: 3600
23
+- id: tacker-db
24
+  type: puppet
25
+  version: 2.0.0
26
+  groups: [primary-controller]
27
+  required_for: [tacker-install]
28
+  requires: [primary-database, database]
29
+  cross-depends:
30
+    - name: /(primary-)?database/
31
+  parameters:
32
+    puppet_manifest: puppet/manifests/db.pp
33
+    puppet_modules: puppet/modules:/etc/puppet/modules
34
+    timeout: 1800
35
+- id: tacker-keystone
36
+  type: puppet
37
+  version: 2.0.0
38
+  groups: [primary-controller]
39
+  required_for: [tacker-install]
40
+  requires: [primary-keystone, keystone]
41
+  cross-depends:
42
+    - name: keystone
43
+  parameters:
44
+    puppet_manifest: puppet/manifests/keystone.pp
45
+    puppet_modules: puppet/modules:/etc/puppet/modules
46
+    timeout: 1800
47
+- id: haproxy-tacker
48
+  type: puppet
49
+  version: 2.0.0
50
+  groups: [primary-controller, controller]
51
+  required_for: [deploy_end]
52
+  requires: [deploy_start, primary-cluster-haproxy, cluster-haproxy]
53
+  cross-depends:
54
+    - name: /(primary-)?cluster-haproxy/
55
+  parameters:
56
+    puppet_manifest: puppet/manifests/haproxy.pp
57
+    puppet_modules: puppet/modules:/etc/puppet/modules
58
+    timeout: 300

+ 23
- 0
environment_config.yaml View File

@@ -0,0 +1,23 @@
1
+attributes:
2
+  metadata:
3
+    group: 'openstack_services'
4
+    db_password:
5
+      generator: 'password'
6
+    user_password:
7
+      generator: 'password'
8
+    user: 'tacker'
9
+    port: 8889
10
+    service: 'tacker-server'
11
+    restrictions:
12
+      - condition: "settings:opendaylight == null or settings:opendaylight.metadata.enabled == false or settings:opendaylight.enable_sfc.value == false"
13
+        strict: false
14
+        message: "Please install OpenDaylight Plugin with SFC features enabled"
15
+      - condition: "settings:fuel-plugin-ovs == null or settings:fuel-plugin-ovs.metadata.enabled == false"
16
+        strict: false
17
+        message: "Please install and enable Openvswitch plugin with NSH support."
18
+  debug:
19
+    value: false
20
+    label: 'Debug logging'
21
+    description: 'Debug logging mode provides more information, but requires more disk space.'
22
+    weight: 25
23
+    type: "checkbox"

+ 34
- 0
metadata.yaml View File

@@ -0,0 +1,34 @@
1
+# Plugin name
2
+name: tacker
3
+# Human-readable name for your plugin
4
+title: Tacker VNF manager
5
+# Plugin version
6
+version: '0.1.0'
7
+# Description
8
+description: Tacker VNF manager
9
+# Required fuel version
10
+fuel_version: ['8.0']
11
+# Specify license of your plugin
12
+licenses: ['Apache License Version 2.0']
13
+# Specify author or company name
14
+authors: ['Michal Skalski, Mirantis']
15
+# A link to the plugin's page
16
+homepage: 'https://github.com/michalskalski/fuel-plugin-tacker'
17
+# Specify a group which your plugin implements, possible options:
18
+# network, storage, storage::cinder, storage::glance, hypervisor,
19
+# equipment
20
+groups: []
21
+# Change `false` to `true` if the plugin can be installed in the environment
22
+# after the deployment.
23
+is_hotpluggable: false
24
+
25
+# The plugin is compatible with releases in the list
26
+releases:
27
+  - os: ubuntu
28
+    version: liberty-8.0
29
+    mode: ['ha']
30
+    deployment_scripts_path: deployment_scripts/
31
+    repository_path: repositories/ubuntu
32
+
33
+# Version of plugin package
34
+package_version: '4.0.0'

+ 9
- 0
node_roles.yaml View File

@@ -0,0 +1,9 @@
1
+tacker:
2
+  name: "Tacker VNF manager"
3
+  description: "Install Tacker VNF manager"
4
+  has_primary: false                # whether has primary role or not
5
+  public_ip_required: false         # whether requires public net or not
6
+  weight: 150                       # weight that will be used for ordering on fuel ui
7
+  limits:
8
+    max: 1
9
+    min: 1

+ 88
- 0
pre_build_hook View File

@@ -0,0 +1,88 @@
1
+#!/bin/bash
2
+set -eux
3
+
4
+BUILD_FOR=${BUILD_FOR:-ubuntu}
5
+
6
+DIR="$(dirname `readlink -f $0`)"
7
+TMP_DIR="${DIR}/tmp"
8
+MODULES="${DIR}/deployment_scripts/puppet/modules"
9
+
10
+TOSCA_PARSER=${TOSCA_PARSER:-http://mirrors.kernel.org/ubuntu/pool/universe/p/python-tosca-parser/python-tosca-parser_0.1.0-3_all.deb}
11
+#tacker server
12
+TACKER_REPO=${TACKER_REPO:-https://github.com/trozet/tacker}
13
+TACKER_BRANCH=${TACKER_BRANCH:-SFC_brahmaputra}
14
+
15
+TACKER_CLI_REPO=${TACKER_CLI_REPO:-https://github.com/openstack/python-tackerclient}
16
+TACKER_CLI_BRANCH=${TACKER_CLI_BRANCH:-stable/liberty}
17
+
18
+TACKER_HORIZON_REPO=${TACKER_HORIZON_REPO:-https://github.com/openstack/tacker-horizon}
19
+TACKER_HORIZON_BRANCH=${TACKER_HORIZON_BRANCH:-stable/liberty}
20
+
21
+TACKER_PUPPET_REPO=${TACKER_PUPPET_REPO:-https://github.com/radez/puppet-tacker}
22
+TACKER_PUPPET_BRANCH=${TACKER_PUPPET_BRANCH:-master}
23
+
24
+function cleanup {
25
+  rm -rf "${TMP_DIR}"
26
+}
27
+
28
+function download {
29
+  wget "$1" -qO $2
30
+}
31
+
32
+function build_pkg {
33
+  case $1 in
34
+    centos)
35
+      pushd "${DIR}/repositories/${1}/"
36
+      popd
37
+      ;;
38
+    ubuntu)
39
+      pushd "${DIR}/repositories/${1}/"
40
+      download $TOSCA_PARSER python-tosca-parser_0.1.0-3_all.deb
41
+      fpm --force -s python -t deb -m 'mskalski@mirantis.com' --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
42
+      fpm --force -s python -t deb -m 'mskalski@mirantis.com' --python-install-lib /usr/lib/python2.7/dist-packages ${TMP_DIR}/tacker-horizon/setup.py
43
+      fpm --force -s python -t deb -m 'mskalski@mirantis.com' --python-install-lib /usr/lib/python2.7/dist-packages ${TMP_DIR}/python-tackerclient/setup.py
44
+      popd
45
+      ;;
46
+    *) echo "Not supported system"; exit 1;;
47
+  esac
48
+}
49
+
50
+command -v fpm >/dev/null 2>&1 || { echo >&2 "fpm ruby gem required but it's not installed.  Aborting."; exit 1; }
51
+
52
+cleanup
53
+
54
+pushd $MODULES
55
+rm -rf tacker
56
+git clone $TACKER_PUPPET_REPO tacker
57
+pushd tacker
58
+git checkout $TACKER_PUPPET_BRANCH 
59
+popd
60
+popd
61
+
62
+mkdir -p "${TMP_DIR}"
63
+
64
+pushd $TMP_DIR
65
+
66
+git clone $TACKER_REPO tacker 
67
+pushd tacker
68
+git checkout $TACKER_BRANCH
69
+#include changes which fix dependencies for liberty
70
+git am < ${DIR}/tacker_package/requirements-liberty.patch
71
+popd
72
+
73
+git clone $TACKER_CLI_REPO python-tackerclient
74
+pushd python-tackerclient
75
+git checkout $TACKER_CLI_BRANCH
76
+popd
77
+
78
+git clone $TACKER_HORIZON_REPO tacker-horizon 
79
+pushd tacker-horizon
80
+git checkout $TACKER_HORIZON_BRANCH
81
+popd
82
+
83
+for system in $BUILD_FOR
84
+do
85
+  build_pkg $system
86
+done
87
+
88
+cleanup

+ 0
- 0
repositories/centos/.gitkeep View File


+ 0
- 0
repositories/ubuntu/.gitkeep View File


+ 1238
- 0
tacker_package/requirements-liberty.patch
File diff suppressed because it is too large
View File


+ 6
- 0
tacker_package/tacker-post View File

@@ -0,0 +1,6 @@
1
+#!/bin/sh
2
+set -e
3
+
4
+adduser --quiet --system --group --no-create-home --home /var/lib/tacker tacker
5
+mv /usr/local/etc/tacker /etc/
6
+chown -R tacker:tacker /etc/tacker

+ 26
- 0
tacker_package/tacker-server View File

@@ -0,0 +1,26 @@
1
+description "Tacker VNF Manager"
2
+author "Michal Skalski <mskalski@mirantis.com>"
3
+
4
+start on runlevel [2345]
5
+stop on runlevel [!2345]
6
+
7
+chdir /var/run
8
+
9
+respawn
10
+respawn limit 20 5
11
+limit nofile 65535 65535
12
+
13
+pre-start script
14
+        for dir in run log lib cache ; do
15
+                mkdir -p /var/${dir}/tacker
16
+                chown tacker /var/${dir}/tacker
17
+        done
18
+end script
19
+
20
+script
21
+        [ -x "/usr/bin/tacker-server" ] || exit 0
22
+        DAEMON_ARGS="--verbose --log-file=/var/log/tacker/tacker-server.log"
23
+        exec start-stop-daemon --start --chdir /var/lib/tacker \
24
+                --chuid tacker:tacker --make-pidfile --pidfile /var/run/tacker/tacker-server.pid \
25
+                --exec /usr/bin/tacker-server -- --config-file=/etc/tacker/tacker.conf ${DAEMON_ARGS}
26
+end script

+ 1
- 0
tasks.yaml View File

@@ -0,0 +1 @@
1
+[]

+ 6
- 0
volumes.yaml View File

@@ -0,0 +1,6 @@
1
+# Set here new volumes for your role
2
+volumes: []
3
+volumes_roles_mapping:
4
+  tacker:
5
+    # Default role mapping
6
+    - {allocate_size: "min", id: "os"}

Loading…
Cancel
Save