From 0d6067258d09fdd47c95828e5e0e9b0f9987a529 Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Mon, 9 Jan 2017 10:04:10 -0500 Subject: chef: remove the use of chef The use of chef was never complete, had isses with updating binary database files and had a cumbersome implementation. Since we are using Ansible in meta-overc we are dropping the use of chef here and will look to being at par with meta-overc by using Ansible if/when we get time to look at runtime configuration in meta-cloud-services. Signed-off-by: Mark Asselstine Signed-off-by: Bruce Ashfield --- .../recipes-support/deploychef/deploychef_0.1.bb | 100 --------------------- .../deploychef/files/deploychef.init | 26 ------ .../deploychef/files/run-deploychef | 33 ------- .../deploychef/files/run-openstackchef | 30 ------- .../postgresql/postgresql_9.%.bbappend | 26 +++--- 5 files changed, 10 insertions(+), 205 deletions(-) delete mode 100644 meta-openstack/recipes-support/deploychef/deploychef_0.1.bb delete mode 100644 meta-openstack/recipes-support/deploychef/files/deploychef.init delete mode 100644 meta-openstack/recipes-support/deploychef/files/run-deploychef delete mode 100644 meta-openstack/recipes-support/deploychef/files/run-openstackchef (limited to 'meta-openstack/recipes-support') diff --git a/meta-openstack/recipes-support/deploychef/deploychef_0.1.bb b/meta-openstack/recipes-support/deploychef/deploychef_0.1.bb deleted file mode 100644 index 6237538..0000000 --- a/meta-openstack/recipes-support/deploychef/deploychef_0.1.bb +++ /dev/null @@ -1,100 +0,0 @@ -# -# Copyright (C) 2014 Wind River Systems, Inc. -# -SUMMARY = "For the provisioning of OpenStack nodes" -DESCRIPTION = "There are a number of variables that are baked into Openstack \ -at build time, for example the ip address of a compute or controller node. \ -This means that when a new compute or controller node boots up, it will \ -have an ip address that differs from its currently assigned ip address \ -This package facilitates the recreation of openstack script and \ -configuration files, as well as their placement in the appropriate directories on \ -the files system on a compute/controller/allinone node at runtime" - -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -PR = "r1" - - -RDEPENDS_${PN} = "chef" -SRC_URI = "\ - file://deploychef.init \ - file://attributes.json \ - file://config.rb \ - file://default_recipe.rb \ - file://run-openstackchef \ - file://run-postinsts \ - file://run-deploychef \ - file://service-shutdown \ - file://deploychef-inc \ - " -inherit update-rc.d identity hosts default_configs - -S = "${WORKDIR}" -#Since this package does not need to be ran for each boot-up -#There is no need for an init scrpt so install it in /opt/${BPN} -DEPLOYCHEF_ROOT_DIR ?= "/opt/${BPN}" -POSTINSTS_DIR ?= "rpm-postinsts" - -#Provide a mechanism for these strings to be over-written if necessary -COOKBOOK_DIR = "${DEPLOYCHEF_ROOT_DIR}/cookbooks/" -ATTRIBUTE_DIR = "${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/attributes/" -RECIPE_DIR = "${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/recipes/" - -FILES_${PN} += " \ - ${DEPLOYCHEF_ROOT_DIR}/* \ - ${DEPLOYCHEF_ROOT_DIR}/conf-templates/* \ - ${DEPLOYCHEF_ROOT_DIR}/cookbooks/* \ - ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/recipes/* \ - ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/templates/* \ - ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/templates/default \ - ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/attributes \ - ${DEPLOYCHEF_ROOT_DIR}/cookbooks/openstack/attributes/* \ - " -#Read the module config files and make them into -#chef-solo templates -do_install() { - if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then - #This script will make templates out of postinst script before they - #have a chance to run - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${S}/${BPN}.init ${D}${sysconfdir}/init.d/${BPN} - - install -d ${D}/${DEPLOYCHEF_ROOT_DIR} - #Copy the template configuration scripts to image directory - install -m 0644 ${S}/config.rb ${D}/${DEPLOYCHEF_ROOT_DIR}/config.rb - install -m 0644 ${S}/attributes.json ${D}/${DEPLOYCHEF_ROOT_DIR}/attributes.json - install -m 0755 ${S}/run-postinsts ${D}/${DEPLOYCHEF_ROOT_DIR}/run-postinsts - install -m 0755 ${S}/run-openstackchef ${D}/${DEPLOYCHEF_ROOT_DIR}/run-openstackchef - install -m 0755 ${S}/run-deploychef ${D}/${DEPLOYCHEF_ROOT_DIR}/run-deploychef - install -m 0755 ${S}/service-shutdown ${D}/${DEPLOYCHEF_ROOT_DIR}/service-shutdown - install -m 0644 ${S}/deploychef-inc ${D}/${DEPLOYCHEF_ROOT_DIR}/deploychef-inc - #Copy the chefsolo recipe file to chefsolo recipe folder - install -d ${D}/${RECIPE_DIR} - install -m 0644 ${S}/default_recipe.rb ${D}/${RECIPE_DIR}/default.rb - fi -} - -do_install_append() { - - #Replace all required placeholders - for file in "${D}/${DEPLOYCHEF_ROOT_DIR}/run-deploychef \ - ${D}/${DEPLOYCHEF_ROOT_DIR}/service-shutdown \ - ${D}/${DEPLOYCHEF_ROOT_DIR}/deploychef-inc \ - ${D}/${DEPLOYCHEF_ROOT_DIR}/run-postinsts \ - ${D}/${DEPLOYCHEF_ROOT_DIR}/run-openstackchef \ - ${D}/${RECIPE_DIR}/default.rb \ - ${D}/${sysconfdir}/init.d/${BPN} "; do - - sed -i s:%SYSCONFDIR%:${sysconfdir}:g $file - sed -i s:%POSTINSTS_DIR%:${POSTINSTS_DIR}:g $file - sed -i s:%PACKAGE_NAME%:${BPN}:g $file - sed -i s:%DEPLOYCHEF_ROOT_DIR%:${DEPLOYCHEF_ROOT_DIR}:g $file - done -} - -INITSCRIPT_PACKAGES = "${BPN}" -INITSCRIPT_NAME_${BPN} = "${BPN}" -INITSCRIPT_PARAMS = "start 96 S ." - diff --git a/meta-openstack/recipes-support/deploychef/files/deploychef.init b/meta-openstack/recipes-support/deploychef/files/deploychef.init deleted file mode 100644 index 22f318b..0000000 --- a/meta-openstack/recipes-support/deploychef/files/deploychef.init +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -#After this script executes, it runs the 'run-openstackchef' script found in -#/opt/deploychef/ directory. After that, all the -#configuration files that were registered with openstackchef class are -#created using run-time environment variables and default values -# found in /opt/deploychef/cookbooks/openstack/attributes/default.rb -deploychef_root=%DEPLOYCHEF_ROOT_DIR% -LOG_DIR=/var/log/%PACKAGE_NAME% -LOG_FILE=$LOG_DIR/%PACKAGE_NAME%.log -script_file=$deploychef_root/run-openstackchef -chefsolo_success_file="%SYSCONFDIR%/chefsolo.ran" -if [ ! -f $chefsolo_success_file ]; then - if [ -f $script_file ] ; then - mkdir -p $LOG_DIR - #Remove deploy init script if present - rm -f /etc/init.d/deploy 2>/dev/null - cd $deploychef_root - . $(basename $script_file) - if [ $? = 0 ]; then - echo "Deploychef successfully created chefsolo configuration files" \ - > $LOG_FILE - else - echo "deploychef ERROR: $i failed." > $LOG_FILE - fi - fi -fi diff --git a/meta-openstack/recipes-support/deploychef/files/run-deploychef b/meta-openstack/recipes-support/deploychef/files/run-deploychef deleted file mode 100644 index 4fd41d8..0000000 --- a/meta-openstack/recipes-support/deploychef/files/run-deploychef +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# run-deploychef -# -# Copyright (c) 2014 Wind River Systems, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# -# This file is the main script file that reconfigures the stack when any of -# the attributes variables change at run-time. -# -#Shutdown all registered services -. ./service-shutdown -#Re-generate configuration files from template files -. ./run-openstackchef -#Run post-install script and then start services -. ./run-postinsts diff --git a/meta-openstack/recipes-support/deploychef/files/run-openstackchef b/meta-openstack/recipes-support/deploychef/files/run-openstackchef deleted file mode 100644 index 18e6a68..0000000 --- a/meta-openstack/recipes-support/deploychef/files/run-openstackchef +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# run-openstackchef -# -# Copyright (c) 2014 Wind River Systems, Inc. -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# -# This script just runs chefsolo to generate our configuration files -# -# -#Use chefsolo to generate configuration files/scripts base on -#templates if templates/default -chef-solo -f -c config.rb -j attributes.json diff --git a/meta-openstack/recipes-support/postgresql/postgresql_9.%.bbappend b/meta-openstack/recipes-support/postgresql/postgresql_9.%.bbappend index 42ceaf8..22dae71 100644 --- a/meta-openstack/recipes-support/postgresql/postgresql_9.%.bbappend +++ b/meta-openstack/recipes-support/postgresql/postgresql_9.%.bbappend @@ -3,7 +3,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://postgresql \ file://postgresql-init" -inherit useradd update-rc.d identity hosts openstackchef +inherit useradd update-rc.d identity hosts PACKAGECONFIG[libxml] = "--with-libxml CFLAGS=-I${STAGING_INCDIR}/libxml2,--without-libxml,libxml2,libxml2" @@ -16,25 +16,19 @@ do_install_append() { install -d ${D}${sysconfdir}/init.d/ install -m 0755 ${WORKDIR}/postgresql ${INIT_D_DEST_DIR}/postgresql install -m 0755 ${WORKDIR}/postgresql-init ${INIT_D_DEST_DIR}/postgresql-init - if [ -z "${OPENSTACKCHEF_ENABLED}" ]; then - sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql - sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql-init - sed -e "s:%DB_USER%:${DB_USER}:g" -i ${INIT_D_DEST_DIR}/postgresql-init - sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${INIT_D_DEST_DIR}/postgresql-init + sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql + sed -e "s:%DB_DATADIR%:${DB_DATADIR}:g" -i ${INIT_D_DEST_DIR}/postgresql-init - sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init - sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init + sed -e "s:%DB_USER%:${DB_USER}:g" -i ${INIT_D_DEST_DIR}/postgresql-init + sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${INIT_D_DEST_DIR}/postgresql-init - sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init - sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init - fi -} + sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init + sed -e "s:%CONTROLLER_HOST%:${CONTROLLER_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init -CHEF_SERVICES_CONF_FILES := "\ - ${sysconfdir}/init.d/postgresql \ - ${sysconfdir}/init.d/postgresql-init \ - " + sed -e "s:%COMPUTE_IP%:${COMPUTE_IP}:g" -i ${INIT_D_DEST_DIR}/postgresql-init + sed -e "s:%COMPUTE_HOST%:${COMPUTE_HOST}:g" -i ${INIT_D_DEST_DIR}/postgresql-init +} RDEPENDS_${PN} += "postgresql-timezone eglibc-utils update-rc.d" USERADD_PACKAGES = "${PN}" -- cgit v1.2.3-54-g00ecf