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
This commit is contained in:
Artem Savinov 2016-08-24 17:14:21 +03:00
parent c6eac64196
commit 85be272e7d
5 changed files with 54 additions and 0 deletions

View File

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

View File

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

View File

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

View File

@ -0,0 +1,31 @@
class nsxt::create_repo (
$repo_dir = '/opt/nsx-t-repo',
$repo_file = '/etc/apt/sources.list.d/nsx-t-local.list',
$repo_pref_file = '/etc/apt/preferences.d/nsx-t-local.pref',
) {
file { $repo_dir:
ensure => directory,
mode => '0755',
source => "puppet:///modules/${module_name}/packages",
recurse => true,
force => true,
}
file { $repo_file:
ensure => file,
mode => '0644',
content => "deb file:${repo_dir} /",
replace => true,
}
file { $repo_pref_file:
ensure => file,
mode => '0644',
source => "puppet:///modules/${module_name}/pinning",
replace => true,
}
exec { 'Create repo':
path => '/usr/sbin:/usr/bin:/sbin:/bin',
command => "cd ${repo_dir} && dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz",
provider => 'shell',
require => File[$repo_dir],
}
}

View File

@ -1,3 +1,19 @@
- id: nsx-t-create-repo
version: 2.0.0
type: puppet
groups:
- primary-controller
- controller
- compute
required_for:
- pre_deployment_end
requires:
- pre_deployment_start
parameters:
puppet_manifest: puppet/manifests/create-repo.pp
puppet_modules: puppet/modules
timeout: 120
- id: nsx-t-install-plugin
version: 2.0.0
type: puppet