Browse Source

Add manifest to install custom repo on node with nsx packages

We cannot distribute nsx-t packages together with the plugin.
The user has to put packages in
/var/www/naillgun/plugins/nsx-t-1.0/deployment_scripts/puppet/modules/nsxt/files/packages
and we deploy custom repo with nsx-t packages on all openctack
controller/compute nodes.

Change-Id: I41dbb47bfa722061fc4b8b46ab8b94e6e3af8c94
changes/10/359910/2
Artem Savinov 2 years ago
parent
commit
85be272e7d

+ 3
- 0
deployment_scripts/puppet/manifests/create-repo.pp View File

@@ -0,0 +1,3 @@
1
+notice('fuel-plugin-nsx-t: create-repo.pp')
2
+
3
+class { '::nsxt::create_repo': }

+ 1
- 0
deployment_scripts/puppet/modules/nsxt/files/packages/Release View File

@@ -0,0 +1 @@
1
+Label: nsx-t-protected-packages

+ 3
- 0
deployment_scripts/puppet/modules/nsxt/files/pinning View File

@@ -0,0 +1,3 @@
1
+Package: *
2
+Pin: release l=nsx-t-protected-packages
3
+Pin-Priority: 9000

+ 31
- 0
deployment_scripts/puppet/modules/nsxt/manifests/create_repo.pp View File

@@ -0,0 +1,31 @@
1
+class nsxt::create_repo (
2
+  $repo_dir       = '/opt/nsx-t-repo',
3
+  $repo_file      = '/etc/apt/sources.list.d/nsx-t-local.list',
4
+  $repo_pref_file = '/etc/apt/preferences.d/nsx-t-local.pref',
5
+) {
6
+  file { $repo_dir:
7
+    ensure  => directory,
8
+    mode    => '0755',
9
+    source  => "puppet:///modules/${module_name}/packages",
10
+    recurse => true,
11
+    force   => true,
12
+  }
13
+  file { $repo_file:
14
+    ensure  => file,
15
+    mode    => '0644',
16
+    content => "deb file:${repo_dir} /",
17
+    replace => true,
18
+  }
19
+  file { $repo_pref_file:
20
+    ensure  => file,
21
+    mode    => '0644',
22
+    source  => "puppet:///modules/${module_name}/pinning",
23
+    replace => true,
24
+  }
25
+  exec { 'Create repo':
26
+    path     => '/usr/sbin:/usr/bin:/sbin:/bin',
27
+    command  => "cd ${repo_dir} && dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz",
28
+    provider => 'shell',
29
+    require  => File[$repo_dir],
30
+  }
31
+}

+ 16
- 0
deployment_tasks.yaml View File

@@ -1,3 +1,19 @@
1
+- id: nsx-t-create-repo
2
+  version: 2.0.0
3
+  type: puppet
4
+  groups:
5
+    - primary-controller
6
+    - controller
7
+    - compute
8
+  required_for:
9
+    - pre_deployment_end
10
+  requires:
11
+    - pre_deployment_start
12
+  parameters:
13
+    puppet_manifest: puppet/manifests/create-repo.pp
14
+    puppet_modules: puppet/modules
15
+    timeout: 120
16
+
1 17
 - id: nsx-t-install-plugin
2 18
   version: 2.0.0
3 19
   type: puppet

Loading…
Cancel
Save