post-deploy.yaml heat_template_version: 2014-10-16 description: > Run extra config setup parameters: servers: type: json DeployIdentifier: type: string ComputeHostnameFormat: type: string default: "" resources: general: type: OS::Heat::SoftwareConfig properties: config: {get_file: general.sh} group: script ExtraDeployments-2: type: OS::Heat::SoftwareDeployments properties: config: {get_resource: general} servers: {get_param: servers} actions: ['CREATE','UPDATE'] input_values: deploy_identifier: {get_param: DeployIdentifier} ExtraConfigSriov: type: OS::Heat::SoftwareConfig properties: group: script config: str_replace: template: | #!/bin/bash set -x FORMAT=$COMPUTE_HOSTNAME_FORMAT if [[ -z $FORMAT ]] ; then # ASSUMPTION: ALL FUTURE DATA PLANE NODES ( matching regex *pcpt* ) WILL BE AFFECTED BY THIS SCRIPT FORMAT="cpt" ; else # Assumption: only %index% and %stackname% are the variables in Host name format FORMAT=$(echo $FORMAT | sed 's/\%index\%//g' | sed 's/\%stackname\%//g') ; fi if [[ $(hostname) == *$FORMAT* ]] ; then tuned_service=/usr/lib/systemd/system/tuned.service grep -q "network.target" $tuned_service if [ "$?" -eq 0 ]; then sed -i '/After=.*/s/network.target//g' $tuned_service fi grep -q "Before=.*network.target" $tuned_service if [ ! "$?" -eq 0 ]; then grep -q "Before=.*" $tuned_service if [ "$?" -eq 0 ]; then sed -i 's/^\(Before=.*\)/\1 network.target openvswitch.service/g' $tuned_service else sed -i '/After/i Before=network.target openvswitch.service' $tuned_service fi fi systemctl daemon-reload fi params: $COMPUTE_HOSTNAME_FORMAT: {get_param: ComputeHostnameFormat} ExtraDeployments-sriov: type: OS::Heat::StructuredDeployments properties: servers: {get_param: servers} config: {get_resource: ExtraConfigSriov} # Do this on CREATE/UPDATE (which is actually the default) actions: ['CREATE', 'UPDATE'] # GnocchiConfig: # type: OS::Heat::SoftwareConfig # properties: # group: script # config: | # #!/bin/bash # #1) the credentials to run these commands are missing in this script, to make it work the overcloudrc file has to be sourced # gnocchi archive-policy list | grep turkcell # if [ $? -ne 0 ]; then # gnocchi archive-policy create \ # -b 0 -m std -m count -m 95pct -m min -m max -m sum -m median -m mean \ # -d 'timespan:'5days',granularity:600' \ # custom_turkcell # fi # gnocchi archive-policy rule | grep turkcell # if [ $? -ne 0 ]; then # gnocchi archive-policy-rule create -a custom_turkcell -m "*" turkcell # fi # gnocchi archive-policy rule | grep default # if [ $? -ne 0 ]; then # gnocchi archive-policy-rule delete default # fi # # ExtraDeployments-gnocchi: # type: OS::Heat::StructuredDeployments # properties: # servers: {get_param: [servers, 'Controller']} # config: {get_resource: GnocchiConfig} # # also in UPDATE? # actions: ['CREATE', 'UPDATE']