diff --git a/hieradata/class/performance_backend.yaml b/hieradata/class/performance_backend.yaml index 7ae331f2a2d..5f64d469e0d 100644 --- a/hieradata/class/performance_backend.yaml +++ b/hieradata/class/performance_backend.yaml @@ -1,4 +1,6 @@ --- +nodejs::version: '0.10.37-1chl1~%{::lsbdistcodename}1' + govuk::node::s_base::apps: - performanceplatform_admin diff --git a/hieradata/class/performance_frontend.yaml b/hieradata/class/performance_frontend.yaml index bd19db0fb9b..9ebdb323ad8 100644 --- a/hieradata/class/performance_frontend.yaml +++ b/hieradata/class/performance_frontend.yaml @@ -1,5 +1,7 @@ --- +nodejs::version: '0.10.37-1chl1~%{::lsbdistcodename}1' + govuk::node::s_base::apps: - performanceplatform_big_screen_view - spotlight diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 53179822f42..093333dee86 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -1510,7 +1510,8 @@ mysql::client::package_ensure: 'present' nginx::package::version: '1.4.6-1ubuntu3.8' -nodejs::version: '0.10.37-1chl1~%{::lsbdistcodename}1' +nodejs::repo::apt_mirror_hostname: "%{hiera('apt_mirror_hostname')}" +nodejs::version: '6.11.2-1nodesource1~%{::lsbdistcodename}1' ntp::server_list: - 'ntp.ubuntu.com' diff --git a/hieradata_aws/common.yaml b/hieradata_aws/common.yaml index a76cadc9831..fa1c853ce52 100644 --- a/hieradata_aws/common.yaml +++ b/hieradata_aws/common.yaml @@ -1058,7 +1058,8 @@ mysql::client::package_ensure: 'present' nginx::package::nginx_package: 'nginx-extras' nginx::package::version: '1.4.6-1ubuntu3.8' -nodejs::version: '0.10.37-1chl1~%{::lsbdistcodename}1' +nodejs::repo::apt_mirror_hostname: "%{hiera('apt_mirror_hostname')}" +nodejs::version: '6.11.2-1nodesource1~%{::lsbdistcodename}1' ntp::server_list: - 'ntp.ubuntu.com' diff --git a/modules/nodejs/manifests/init.pp b/modules/nodejs/manifests/init.pp index 920bbac20a8..9b4098f8655 100644 --- a/modules/nodejs/manifests/init.pp +++ b/modules/nodejs/manifests/init.pp @@ -9,7 +9,7 @@ # Default: `undef` # class nodejs( - $version = undef + $version = undef, ) { if $version == undef { @@ -18,6 +18,8 @@ $ensure = $version } + class { '::nodejs::repo': } + package { 'nodejs': ensure => $ensure, } diff --git a/modules/nodejs/manifests/repo.pp b/modules/nodejs/manifests/repo.pp new file mode 100644 index 00000000000..74a6c51a3b1 --- /dev/null +++ b/modules/nodejs/manifests/repo.pp @@ -0,0 +1,20 @@ +# == Class: nodejs::repo +# +# Use our own mirror of the beat repo. Should be used with `manage_repo` +# disable of the upstream module. +# +# === Parameters +# +# [*apt_mirror_hostname*] +# Hostname to use for the APT mirror. +# +class nodejs::repo( + $apt_mirror_hostname = undef, +) { + apt::source { 'nodejs': + location => "http://${apt_mirror_hostname}/nodejs", + release => $::lsbdistcodename, + architecture => $::architecture, + key => '', + } +}