Browse Source

Generate tackerc from puppet manifest

Try to remove external dependencies.

Change-Id: Ib56f2e1aaeecb85fd2427d91031c4756d39b8305
Signed-off-by: Michal Skalski <mskalski@mirantis.com>
Michal Skalski 2 years ago
parent
commit
e49db23fa2

+ 0
- 26
deployment_scripts/create_tackerc.sh View File

@@ -1,26 +0,0 @@
1
-#!/bin/sh
2
-
3
-wget -N http://mirrors.kernel.org/ubuntu/pool/universe/p/python-iniparse/python-iniparse_0.4-2.1build1_all.deb
4
-wget -N http://archive.ubuntu.com/ubuntu/pool/universe/c/crudini/crudini_0.3-1_amd64.deb
5
-dpkg -i python-iniparse_0.4-2.1build1_all.deb crudini_0.3-1_amd64.deb
6
-
7
-
8
-    auth_uri=$(crudini --get '/etc/heat/heat.conf' 'keystone_authtoken' 'auth_uri')
9
-
10
-    cat > tackerc <<EOFRC
11
-#!/bin/sh
12
-export LC_ALL=C
13
-export OS_NO_CACHE='true'
14
-export OS_TENANT_NAME='services'
15
-export OS_PROJECT_NAME='services'
16
-export OS_USERNAME='tacker'
17
-export OS_PASSWORD='tacker'
18
-export OS_AUTH_URL='${auth_uri}'
19
-export OS_DEFAULT_DOMAIN='default'
20
-export OS_AUTH_STRATEGY='keystone'
21
-export OS_REGION_NAME='RegionOne'
22
-export TACKER_ENDPOINT_TYPE='internalURL'
23
-EOFRC
24
-    chmod +x tackerc
25
-    mv tackerc /root/
26
-

+ 1
- 2
deployment_scripts/puppet/manifests/keystone.pp View File

@@ -8,7 +8,7 @@ $public_vip          = hiera('public_vip')
8 8
 $public_ssl_hash     = hiera_hash('public_ssl')
9 9
 $management_vip      = hiera('management_vip')
10 10
 $region              = pick($tacker_hash['region'], hiera('region', 'RegionOne'))
11
-$password            = pick($tacker_hash['auth_name'], 'tacker')
11
+$password            = $tacker_hash['user_password']
12 12
 $auth_name           = pick($tacker_hash['auth_name'], 'tacker')
13 13
 $configure_endpoint  = pick($tacker_hash['configure_endpoint'], true)
14 14
 $configure_user      = pick($tacker_hash['configure_user'], true)
@@ -44,4 +44,3 @@ class { 'tacker::keystone::auth':
44 44
   public_url          => $public_url,
45 45
   region              => $region,
46 46
 }
47
-

+ 3
- 4
deployment_scripts/puppet/manifests/tacker.pp View File

@@ -17,11 +17,11 @@ $service_name = pick($tacker_hash['service'], 'tacker-server')
17 17
 
18 18
 $tacker_tenant        = pick($tacker_hash['tenant'], 'services')
19 19
 $tacker_user          = pick($tacker_hash['user'], 'tacker')
20
-$tacker_user_password = pick($tacker_hash['user'], 'tacker')
20
+$tacker_user_password = $tacker_hash['user_password']
21 21
 
22 22
 $ssl_hash               = hiera_hash('use_ssl', {})
23
-$public_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'public', 'protocol', 'http')
24
-$public_auth_address  = get_ssl_property($ssl_hash, {}, 'keystone', 'public', 'hostname', $public_vip)
23
+$public_auth_protocol   = get_ssl_property($ssl_hash, {}, 'keystone', 'public', 'protocol', 'http')
24
+$public_auth_address    = get_ssl_property($ssl_hash, {}, 'keystone', 'public', 'hostname', $public_vip)
25 25
 $admin_auth_protocol    = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'protocol', 'http')
26 26
 $admin_auth_address     = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', $management_vip)
27 27
 
@@ -68,4 +68,3 @@ class { 'tacker':
68 68
   opendaylight_port   => $odl_port,
69 69
   heat_uri            => $heat_uri,
70 70
 }
71
-

+ 37
- 0
deployment_scripts/puppet/manifests/tacker_rc.pp View File

@@ -0,0 +1,37 @@
1
+notice('MODULAR: tacker_rc.pp')
2
+
3
+$plugin_hash = hiera_hash('tacker', {})
4
+$tacker_hash = $plugin_hash['metadata']
5
+$public_vip  = hiera('public_vip')
6
+
7
+$tacker_tenant        = pick($tacker_hash['tenant'], 'services')
8
+$tacker_user          = pick($tacker_hash['user'], 'tacker')
9
+$tacker_user_password = $tacker_hash['user_password']
10
+
11
+$ssl_hash               = hiera_hash('use_ssl', {})
12
+$public_auth_protocol   = get_ssl_property($ssl_hash, {}, 'keystone', 'public', 'protocol', 'http')
13
+$public_auth_address    = get_ssl_property($ssl_hash, {}, 'keystone', 'public', 'hostname', $public_vip)
14
+$auth_uri               = "${public_auth_protocol}://${public_auth_address}:5000/v2.0/"
15
+
16
+$tackerc = inline_template("
17
+#!/bin/sh
18
+export LC_ALL=C
19
+export OS_NO_CACHE='true'
20
+export OS_TENANT_NAME='<%= @tacker_tenant %>'
21
+export OS_PROJECT_NAME='<%= @tacker_tenant %>'
22
+export OS_USERNAME='<%= @tacker_user %>'
23
+export OS_PASSWORD='<%= @tacker_user_password %>'
24
+export OS_AUTH_URL='<%= @auth_uri %>'
25
+export OS_DEFAULT_DOMAIN='default'
26
+export OS_AUTH_STRATEGY='keystone'
27
+export OS_REGION_NAME='RegionOne'
28
+export TACKER_ENDPOINT_TYPE='internalURL'
29
+")
30
+
31
+file { '/root/tackerc':
32
+    owner   => 'root',
33
+    group   => 'root',
34
+    mode    => '0700',
35
+    ensure  => file,
36
+    content => "${tackerc}",
37
+}

+ 8
- 7
deployment_tasks.yaml View File

@@ -56,14 +56,15 @@
56 56
     puppet_manifest: puppet/manifests/haproxy.pp
57 57
     puppet_modules: puppet/modules:/etc/puppet/modules
58 58
     timeout: 300
59
-- id: tacker-tackerc
60
-  role: [primary-controller]
59
+- id: tacker-rc
60
+  groups: [primary-controller, controller]
61 61
   required_for: [deploy_end]
62
-  requires: [primary-database, database,heat]
63
-  type: shell
62
+  requires: [tacker-install]
63
+  type: puppet
64
+  version: 2.0.0
64 65
   cross-depends:
65
-    - name: /(primary-)?database/
66
+    - name: tacker-install
66 67
   parameters:
67
-    cmd: bash create_tackerc.sh
68
+    puppet_manifest: puppet/manifests/tacker_rc.pp
69
+    puppet_modules: puppet/modules:/etc/puppet/modules
68 70
     timeout: 180
69
-

Loading…
Cancel
Save