From a5b22a67fe0e15d913d9e5b17ddb691c7deefd6e Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Tue, 15 Jan 2019 14:49:57 +0100 Subject: [PATCH] Use hiera v5 format Use hiera version 5 instead of version 3 which is deprecated and outputs a warning. Change-Id: I26ee3329aa75109625476d6c355e82fed2c050e6 --- copy_logs.sh | 7 ++++++- functions | 19 +++++++++++-------- run_tests.sh | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/copy_logs.sh b/copy_logs.sh index 52efc7618..e8c742861 100755 --- a/copy_logs.sh +++ b/copy_logs.sh @@ -272,7 +272,12 @@ if [ -f $LOG_DIR/rabbitmq ]; then done fi -# hiera +# hiera config +if [ -f $SCRIPT_DIR/hiera.yaml ]; then + mv $SCRIPT_DIR/hiera.yaml $LOG_DIR +fi + +# hiera data if [ -d $SCRIPT_DIR/hiera ]; then mv $SCRIPT_DIR/hiera $LOG_DIR fi diff --git a/functions b/functions index 504fe463f..4eef055fe 100644 --- a/functions +++ b/functions @@ -113,14 +113,17 @@ install_modules_unit() { configure_hiera() { cat <$HIERA_CONFIG --- -:backends: - - yaml -:yaml: - :datadir: "${SCRIPT_DIR}/hiera" -:hierarchy: - - "%{::operatingsystem}" - - "%{::osfamily}" - - common +version: 5 +defaults: + datadir: ${SCRIPT_DIR}/hiera + data_hash: yaml_data +hierarchy: + - name: "OS specific" + path: "%{::operatingsystem}.yaml" + - name: "OS family specific" + path: "%{::osfamily}.yaml" + - name: "Common" + path: "common.yaml" EOF } diff --git a/run_tests.sh b/run_tests.sh index d35c2eaed..2253b7cbc 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -24,7 +24,7 @@ export MANAGE_PUPPET_MODULES=${MANAGE_PUPPET_MODULES:-true} export MANAGE_REPOS=${MANAGE_REPOS:-true} export ADD_SWAP=${ADD_SWAP:-true} export SWAP_SIZE_GB=${SWAP_SIZE_GB:-4} -export HIERA_CONFIG=${HIERA_CONFIG:-${SCRIPT_DIR}/hiera/hiera.yaml} +export HIERA_CONFIG=${HIERA_CONFIG:-${SCRIPT_DIR}/hiera.yaml} export MANAGE_HIERA=${MANAGE_HIERA:-true} export PUPPET_ARGS="${PUPPET_ARGS} --detailed-exitcodes --color=false --test --summarize --trace --hiera_config ${HIERA_CONFIG} --logdest ${WORKSPACE}/puppet.log" export DISTRO=$(lsb_release -c -s)