From e6588d1d59d7ac24f25f644650e6845561dd441b Mon Sep 17 00:00:00 2001 From: Michal Skalski Date: Sun, 18 Sep 2016 14:16:16 +0200 Subject: [Fuel-plugin] Install kernel in post-deployment. Install kernel and reboot compute nodes in post-deployment phase when there is less chance to interfere with other tasks. Implement Michael's suggestion to use reboot puppet module. Change-Id: I83867e5e2752c39d2b69c950e3e475d43de04466 Signed-off-by: Michal Skalski (cherry picked from commit a10a10b373f17dc423800e6bb8d1a8e99450090d) --- .gitignore | 4 ++++ .../deployment_scripts/puppet/manifests/kvm-install.pp | 13 +++++++------ fuel-plugin/deployment_scripts/puppet/modules/.gitkeep | 0 fuel-plugin/deployment_tasks.yaml | 8 ++++---- fuel-plugin/pre_build_hook | 8 ++++++++ 5 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 fuel-plugin/deployment_scripts/puppet/modules/.gitkeep diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..23e440920 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.deb +fuel-plugin/.build/ +fuel-plugin/deployment_scripts/puppet/modules/reboot diff --git a/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp b/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp index a396e9472..4c04aa0a6 100644 --- a/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp +++ b/fuel-plugin/deployment_scripts/puppet/manifests/kvm-install.pp @@ -1,15 +1,16 @@ -$fuel_settings = parseyaml(file('/etc/astute.yaml')) +$kvm_settings = hiera('fuel-plugin-kvm') if $operatingsystem == 'Ubuntu' { - if $fuel_settings['fuel-plugin-kvm']['use_kvm'] { + if $kvm_settings['use_kvm'] { package { 'linux-headers-4.4.6-rt14nfv': ensure => "1.0.OPNFV", + notify => Reboot['after_run'], } -> package { 'linux-image-4.4.6-rt14nfv': ensure => "1.0.OPNFV", - } -> - exec {'reboot': - command => "reboot", - path => "/usr/bin:/usr/sbin:/bin:/sbin", + notify => Reboot['after_run'], + } + reboot { 'after_run': + apply => finished, } } else { } diff --git a/fuel-plugin/deployment_scripts/puppet/modules/.gitkeep b/fuel-plugin/deployment_scripts/puppet/modules/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/fuel-plugin/deployment_tasks.yaml b/fuel-plugin/deployment_tasks.yaml index f6e31e3ee..0aee295c1 100644 --- a/fuel-plugin/deployment_tasks.yaml +++ b/fuel-plugin/deployment_tasks.yaml @@ -1,10 +1,10 @@ - id: kvm_install type: puppet version: 2.0.0 - groups: [compute] - required_for: [firewall] - requires: [tools] + role: [compute] + required_for: [post_deployment_end] + requires: [post_deployment_start] parameters: puppet_manifest: puppet/manifests/kvm-install.pp puppet_modules: puppet/modules:/etc/puppet/modules - timeout: 720 + timeout: 1200 diff --git a/fuel-plugin/pre_build_hook b/fuel-plugin/pre_build_hook index a3c883283..259862f8f 100755 --- a/fuel-plugin/pre_build_hook +++ b/fuel-plugin/pre_build_hook @@ -4,6 +4,10 @@ set -eux BUILD_FOR=${BUILD_FOR:-ubuntu} DIR="$(dirname `readlink -f $0`)" +MODULES="${DIR}/deployment_scripts/puppet/modules" + +REBOOT_VER='1.2.1' +REBOOT_URL="https://github.com/puppetlabs/puppetlabs-reboot/archive/${REBOOT_VER}.tar.gz" function build_pkg { case $1 in @@ -25,3 +29,7 @@ for system in $BUILD_FOR do build_pkg $system done + +rm -rf ${MODULES}/reboot +mkdir -p ${MODULES}/reboot +wget -qO- ${REBOOT_URL} | tar -C ${MODULES}/reboot --strip-components=1 -zxvf - -- cgit 1.2.3-korg