c148067970
On Xenial, the nodejs puppet module tries to create a symlink from /usr/bin/node to /usr/bin/nodejs. Depending on the resource ordering, this might happen before or after the nodejs package creates its own /usr/bin/node. If puppet has the chance to make the symlink itself, it breaks node by creating a broken link cycle. This patch uses the legacy_debian_symlinks parameter to prevent the puppet module from doing that. This problem was fixed and the option was deprecated and removed in later versions of the nodejs puppet module, so we will have to remove the parameter if we update the nodejs module. Change-Id: I1884dc5a005fe328469b58f876e854c22037d0b7
58 lines
1.3 KiB
Puppet
58 lines
1.3 KiB
Puppet
# Install and maintain OpenStack Health.
|
|
# params:
|
|
# source_dir:
|
|
# The directory where the application will be running
|
|
|
|
class openstack_health::frontend(
|
|
$api_endpoint,
|
|
$source_dir = '/opt/openstack-health',
|
|
) {
|
|
|
|
class { '::nodejs':
|
|
repo_url_suffix => '6.x',
|
|
legacy_debian_symlinks => false,
|
|
}
|
|
|
|
package { 'node-gyp':
|
|
ensure => present,
|
|
provider => npm,
|
|
require => Class['::nodejs'],
|
|
}
|
|
|
|
package { 'gulp':
|
|
ensure => present,
|
|
provider => npm,
|
|
require => Class['::nodejs'],
|
|
}
|
|
|
|
exec { 'install-frontend-requirements':
|
|
command => 'npm install',
|
|
cwd => $source_dir,
|
|
path => ['/usr/local/bin/', '/usr/bin/', '/bin/'],
|
|
timeout => 900,
|
|
require => [
|
|
Package['gulp'],
|
|
Package['node-gyp'],
|
|
],
|
|
subscribe => Vcsrepo[$source_dir],
|
|
}
|
|
|
|
exec { 'build-static-files':
|
|
command => 'gulp prod',
|
|
cwd => $source_dir,
|
|
path => ['/usr/local/bin/', '/usr/bin/', '/bin/'],
|
|
require => Exec['install-frontend-requirements'],
|
|
subscribe => Vcsrepo[$source_dir],
|
|
}
|
|
|
|
file { "${source_dir}/build/config.json":
|
|
ensure => present,
|
|
owner => 'openstack_health',
|
|
group => 'openstack_health',
|
|
mode => '0755',
|
|
content => template('openstack_health/config.json.erb'),
|
|
require => Exec['build-static-files']
|
|
}
|
|
|
|
}
|