summaryrefslogtreecommitdiffstats
path: root/extraconfig
diff options
context:
space:
mode:
Diffstat (limited to 'extraconfig')
-rw-r--r--extraconfig/controller/cinder-netapp.yaml38
-rw-r--r--extraconfig/controller/noop.yaml3
-rw-r--r--extraconfig/post_deploy/example.yaml2
-rw-r--r--extraconfig/post_deploy/rhel-registration/environment-rhel-registration.yaml22
-rw-r--r--extraconfig/post_deploy/rhel-registration/rhel-registration-resource-registry.yaml2
-rw-r--r--extraconfig/post_deploy/rhel-registration/rhel-registration.yaml113
-rw-r--r--extraconfig/post_deploy/rhel-registration/scripts/rhel-registration120
-rw-r--r--extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration19
-rwxr-xr-xextraconfig/tasks/yum_update.sh41
-rw-r--r--extraconfig/tasks/yum_update.yaml26
10 files changed, 385 insertions, 1 deletions
diff --git a/extraconfig/controller/cinder-netapp.yaml b/extraconfig/controller/cinder-netapp.yaml
new file mode 100644
index 00000000..223ceacd
--- /dev/null
+++ b/extraconfig/controller/cinder-netapp.yaml
@@ -0,0 +1,38 @@
+heat_template_version: 2015-04-30
+
+description: >
+ Configure hieradata for Cinder Netapp configuration
+
+resources:
+ CinderNetappConfig:
+ type: OS::Heat::StructuredConfig
+ properties:
+ group: os-apply-config
+ config:
+ hiera:
+ datafiles:
+ cinder_netapp_data:
+ mapped_data:
+ cinder_enable_netapp_backend: {get_param: CinderEnableNetappBackend}
+ cinder::backend::netapp::title: {get_param: CinderNetappBackendName}
+ cinder::backend::netapp::netapp_login: {get_param: CinderNetappLogin}
+ cinder::backend::netapp::netapp_password: {get_param: CinderNetappPassword}
+ cinder::backend::netapp::netapp_hostname: {get_param: CinderNetappServerHostname}
+ cinder::backend::netapp::netapp_server_port: {get_param: CinderNetappServerPort}
+ cinder::backend::netapp::netapp_size_multiplier: {get_param: CinderNetappSizeMultiplier}
+ cinder::backend::netapp::netapp_storage_family: {get_param: CinderNetappStorageFamily}
+ cinder::backend::netapp::netapp_storage_protocol: {get_param: CinderNetappStorageProtocol}
+ cinder::backend::netapp::netapp_transport_type: {get_param: CinderNetappTransportType}
+ cinder::backend::netapp::netapp_vfiler: {get_param: CinderNetappVfiler}
+ cinder::backend::netapp::netapp_volume_list: {get_param: CinderNetappVolumeList}
+ cinder::backend::netapp::netapp_vserver: {get_param: CinderNetappVserver}
+ cinder::backend::netapp::netapp_partner_backend_name: {get_param: CinderNetappPartnerBackendName}
+ cinder::backend::netapp::nfs_shares: {get_param: CinderNetappNfsShares}
+ cinder::backend::netapp::nfs_shares_config: {get_param: CinderNetappNfsSharesConfig}
+ cinder::backend::netapp::nfs_mount_options: {get_param: CinderNetappNfsMountOptions}
+ cinder::backend::netapp::netapp_copyoffload_tool_path: {get_param: CinderNetappCopyOffloadToolPath}
+ cinder::backend::netapp::netapp_controller_ips: {get_param: CinderNetappControllerIps}
+ cinder::backend::netapp::netapp_sa_password: {get_param: CinderNetappSaPassword}
+ cinder::backend::netapp::netapp_storage_pools: {get_param: CinderNetappStoragePools}
+ cinder::backend::netapp::netapp_eseries_host_type: {get_param: CinderNetappEseriesHostType}
+ cinder::backend::netapp::netapp_webservice_path: {get_param: CinderNetappWebservicePath}
diff --git a/extraconfig/controller/noop.yaml b/extraconfig/controller/noop.yaml
new file mode 100644
index 00000000..2eb35763
--- /dev/null
+++ b/extraconfig/controller/noop.yaml
@@ -0,0 +1,3 @@
+heat_template_version: 2015-04-30
+
+description: A stack which doesn't configure anything.
diff --git a/extraconfig/post_deploy/example.yaml b/extraconfig/post_deploy/example.yaml
index 6b816d40..1d3dca25 100644
--- a/extraconfig/post_deploy/example.yaml
+++ b/extraconfig/post_deploy/example.yaml
@@ -20,7 +20,7 @@ resources:
echo "extra" > /root/extra
ExtraDeployments:
- type: OS::Heat::StructuredDeployments
+ type: OS::Heat::SoftwareDeployments
properties:
servers: {get_param: servers}
config: {get_resource: ExtraConfig}
diff --git a/extraconfig/post_deploy/rhel-registration/environment-rhel-registration.yaml b/extraconfig/post_deploy/rhel-registration/environment-rhel-registration.yaml
new file mode 100644
index 00000000..70437a8a
--- /dev/null
+++ b/extraconfig/post_deploy/rhel-registration/environment-rhel-registration.yaml
@@ -0,0 +1,22 @@
+# Note this can be specified either in the call
+# to heat stack-create via an additional -e option
+# or via the global environment on the seed in
+# /etc/heat/environment.d/default.yaml
+parameter_defaults:
+ rhel_reg_activation_key: ""
+ rhel_reg_auto_attach: ""
+ rhel_reg_base_url: ""
+ rhel_reg_environment: ""
+ rhel_reg_force: ""
+ rhel_reg_machine_name: ""
+ rhel_reg_org: ""
+ rhel_reg_password: ""
+ rhel_reg_pool_id: ""
+ rhel_reg_release: ""
+ rhel_reg_repos: ""
+ rhel_reg_sat_url: ""
+ rhel_reg_server_url: ""
+ rhel_reg_service_level: ""
+ rhel_reg_user: ""
+ rhel_reg_type: ""
+ rhel_reg_method: ""
diff --git a/extraconfig/post_deploy/rhel-registration/rhel-registration-resource-registry.yaml b/extraconfig/post_deploy/rhel-registration/rhel-registration-resource-registry.yaml
new file mode 100644
index 00000000..7b48392d
--- /dev/null
+++ b/extraconfig/post_deploy/rhel-registration/rhel-registration-resource-registry.yaml
@@ -0,0 +1,2 @@
+resource_registry:
+ OS::TripleO::NodeExtraConfigPost: rhel-registration.yaml
diff --git a/extraconfig/post_deploy/rhel-registration/rhel-registration.yaml b/extraconfig/post_deploy/rhel-registration/rhel-registration.yaml
new file mode 100644
index 00000000..bf6c88cd
--- /dev/null
+++ b/extraconfig/post_deploy/rhel-registration/rhel-registration.yaml
@@ -0,0 +1,113 @@
+heat_template_version: 2014-10-16
+
+description: >
+ RHEL Registration and unregistration software deployments.
+
+# Note extra parameters can be defined, then passed data via the
+# environment parameter_defaults, without modifying the parent template
+parameters:
+ servers:
+ type: json
+ # To be defined via a local or global environment in parameter_defaults
+ rhel_reg_activation_key:
+ type: string
+ rhel_reg_auto_attach:
+ type: string
+ rhel_reg_base_url:
+ type: string
+ rhel_reg_environment:
+ type: string
+ rhel_reg_force:
+ type: string
+ rhel_reg_machine_name:
+ type: string
+ rhel_reg_org:
+ type: string
+ rhel_reg_password:
+ type: string
+ rhel_reg_pool_id:
+ type: string
+ rhel_reg_release:
+ type: string
+ rhel_reg_repos:
+ type: string
+ rhel_reg_sat_url:
+ type: string
+ rhel_reg_server_url:
+ type: string
+ rhel_reg_service_level:
+ type: string
+ rhel_reg_user:
+ type: string
+ rhel_reg_type:
+ type: string
+ rhel_reg_method:
+ type: string
+
+resources:
+
+ RHELRegistration:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ inputs:
+ - name: REG_ACTIVATION_KEY
+ - name: REG_AUTO_ATTACH
+ - name: REG_BASE_URL
+ - name: REG_ENVIRONMENT
+ - name: REG_FORCE
+ - name: REG_MACHINE_NAME
+ - name: REG_ORG
+ - name: REG_PASSWORD
+ - name: REG_POOL_ID
+ - name: REG_RELEASE
+ - name: REG_REPOS
+ - name: REG_SAT_URL
+ - name: REG_SERVER_URL
+ - name: REG_SERVICE_LEVEL
+ - name: REG_USER
+ - name: REG_TYPE
+ - name: REG_METHOD
+ config: {get_file: scripts/rhel-registration}
+
+ RHELRegistrationDeployment:
+ type: OS::Heat::SoftwareDeployments
+ properties:
+ servers: {get_param: servers}
+ config: {get_resource: RHELRegistration}
+ actions: ['CREATE'] # Only do this on CREATE
+ input_values:
+ REG_ACTIVATION_KEY: {get_param: rhel_reg_activation_key}
+ REG_AUTO_ATTACH: {get_param: rhel_reg_auto_attach}
+ REG_BASE_URL: {get_param: rhel_reg_base_url}
+ REG_ENVIRONMENT: {get_param: rhel_reg_environment}
+ REG_FORCE: {get_param: rhel_reg_force}
+ REG_MACHINE_NAME: {get_param: rhel_reg_machine_name}
+ REG_ORG: {get_param: rhel_reg_org}
+ REG_PASSWORD: {get_param: rhel_reg_password}
+ REG_POOL_ID: {get_param: rhel_reg_pool_id}
+ REG_RELEASE: {get_param: rhel_reg_release}
+ REG_REPOS: {get_param: rhel_reg_repos}
+ REG_SAT_URL: {get_param: rhel_reg_sat_url}
+ REG_SERVER_URL: {get_param: rhel_reg_server_url}
+ REG_SERVICE_LEVEL: {get_param: rhel_reg_service_level}
+ REG_USER: {get_param: rhel_reg_user}
+ REG_TYPE: {get_param: rhel_reg_type}
+ REG_METHOD: {get_param: rhel_reg_method}
+
+ RHELUnregistration:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config: {get_file: scripts/rhel-unregistration}
+ inputs:
+ - name: REG_METHOD
+
+ RHELUnregistrationDeployment:
+ type: OS::Heat::SoftwareDeployments
+ properties:
+ servers: {get_param: servers}
+ config: {get_resource: RHELUnregistration}
+ actions: ['DELETE'] # Only do this on DELETE
+ input_values:
+ REG_METHOD: {get_param: rhel_reg_method}
diff --git a/extraconfig/post_deploy/rhel-registration/scripts/rhel-registration b/extraconfig/post_deploy/rhel-registration/scripts/rhel-registration
new file mode 100644
index 00000000..c2bf1894
--- /dev/null
+++ b/extraconfig/post_deploy/rhel-registration/scripts/rhel-registration
@@ -0,0 +1,120 @@
+#!/bin/bash
+
+# dib-lint: disable=setu sete setpipefail dibdebugtrace
+
+set -eu
+set -o pipefail
+
+OK=/mnt/state/var/lib/rhsm/rhsm.ok
+
+if [ -e $OK ] ; then
+ exit 0
+fi
+
+opts=
+attach_opts=
+repos="repos --enable rhel-7-server-rpms"
+satellite_repo="rhel-7-server-rh-common-rpms"
+if [ -n "${REG_AUTO_ATTACH:-}" ]; then
+ opts="$opts --auto-attach"
+
+ if [ -n "${REG_SERVICE_LEVEL:-}" ]; then
+ opts="$opts --servicelevel $REG_SERVICE_LEVEL"
+ fi
+
+ if [ -n "${REG_RELEASE:-}" ]; then
+ opts="$opts --release=$REG_RELEASE"
+ fi
+else
+ if [ -n "${REG_SERVICE_LEVEL:-}" ]; then
+ echo "WARNING: REG_SERVICE_LEVEL set without REG_AUTO_ATTACH."
+ fi
+
+ if [ -n "${REG_RELEASE:-}" ]; then
+ echo "WARNING: REG_RELEASE set without REG_AUTO_ATTACH."
+ fi
+
+ if [ -n "${REG_POOL_ID:-}" ]; then
+ attach_opts="$attach_opts --pool=$REG_POOL_ID"
+ fi
+fi
+
+if [ -n "${REG_BASE_URL:-}" ]; then
+ opts="$opts --baseurl=$REG_BASE_URL"
+fi
+
+if [ -n "${REG_ENVIRONMENT:-}" ]; then
+ opts="$opts --env=$REG_ENVIRONMENT"
+fi
+
+if [ -n "${REG_FORCE:-}" ]; then
+ opts="$opts --force"
+fi
+
+if [ -n "${REG_SERVER_URL:-}" ]; then
+ opts="$opts --serverurl=$REG_SERVER_URL"
+fi
+
+if [ -n "${REG_ACTIVATION_KEY:-}" ]; then
+ opts="$opts --activationkey=$REG_ACTIVATION_KEY"
+
+ if [ -z "${REG_ORG:-}" ]; then
+ echo "WARNING: REG_ACTIVATION_KEY set without REG_ORG."
+ fi
+else
+ echo "WARNING: Support for registering with a username and password is deprecated."
+ echo "Please use activation keys instead. See the README for more information."
+ if [ -n "${REG_PASSWORD:-}" ]; then
+ opts="$opts --password $REG_PASSWORD"
+ fi
+
+ if [ -n "${REG_USER:-}" ]; then
+ opts="$opts --username $REG_USER"
+ fi
+fi
+
+if [ -n "${REG_MACHINE_NAME:-}" ]; then
+ opts="$opts --name $REG_MACHINE_NAME"
+fi
+
+if [ -n "${REG_ORG:-}" ]; then
+ opts="$opts --org=$REG_ORG"
+fi
+
+if [ -n "${REG_REPOS:-}" ]; then
+ for repo in $(echo $REG_REPOS | tr ',' '\n'); do
+ repos="$repos --enable $repo"
+ done
+fi
+
+if [ -n "${REG_TYPE:-}" ]; then
+ opts="$opts --type=$REG_TYPE"
+fi
+
+case "${REG_METHOD:-}" in
+ portal)
+ subscription-manager register $opts
+ if [ -z "${REG_AUTO_ATTACH:-}" ]; then
+ subscription-manager attach $attach_opts
+ fi
+ subscription-manager $repos
+ ;;
+ satellite)
+ repos="$repos --enable ${satellite_repo}"
+ rpm -Uvh "$REG_SAT_URL/pub/katello-ca-consumer-latest.noarch.rpm" || true
+ subscription-manager register $opts
+ subscription-manager $repos
+ yum install -y katello-agent || true # needed for errata reporting to satellite6
+ katello-package-upload
+ subscription-manager repos --disable ${satellite_repo}
+ ;;
+ disable)
+ echo "Disabling RHEL registration"
+ ;;
+ *)
+ echo "WARNING: only 'portal', 'satellite', and 'disable' are valid values for REG_METHOD."
+ exit 0
+esac
+
+mkdir -p $(dirname $OK)
+touch $OK
diff --git a/extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration b/extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration
new file mode 100644
index 00000000..1e72e0a6
--- /dev/null
+++ b/extraconfig/post_deploy/rhel-registration/scripts/rhel-unregistration
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -eux
+set -o pipefail
+
+case "${REG_METHOD:-}" in
+ portal|satellite)
+ # Allow unregistration to fail.
+ # We don't want to fail stack deletes if unregistration fails.
+ subscription-manager unregister || true
+ subscription-manager clean || true
+ ;;
+ disable)
+ echo "Disabling RHEL unregistration"
+ ;;
+ *)
+ echo "WARNING: only 'portal', 'satellite', and 'disable' are valid values for REG_METHOD."
+ exit 0
+esac
diff --git a/extraconfig/tasks/yum_update.sh b/extraconfig/tasks/yum_update.sh
new file mode 100755
index 00000000..3d4c772b
--- /dev/null
+++ b/extraconfig/tasks/yum_update.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+# A heat-config-script which runs yum update during a stack-update.
+# Inputs:
+# deploy_action - yum will only be run if this is UPDATE
+# update_identifier - yum will only run for previously unused values of update_identifier
+# command - yum sub-command to run, defaults to "update"
+# command_arguments - yum command arguments, defaults to ""
+
+echo "Started yum_update.sh on server $deploy_server_id at `date`"
+
+if [[ -z "$update_identifier" ]]; then
+ echo "Not running due to unset update_identifier"
+ exit 0
+fi
+
+timestamp_dir=/var/lib/overcloud-yum-update
+mkdir -p $timestamp_dir
+
+# sanitise to remove unusual characters
+update_identifier=${update_identifier//[^a-zA-Z0-9-_]/}
+
+timestamp_file="$timestamp_dir/$update_identifier"
+if [[ -a "$timestamp_file" ]]; then
+ echo "Not running for already-run timestamp \"$update_identifier\""
+ exit 0
+fi
+touch "$timestamp_file"
+
+command=${command:-update}
+full_command="yum -y $command $command_arguments"
+echo "Running: $full_command"
+
+result=$($full_command)
+return_code=$?
+echo "$result"
+echo "yum return code: $return_code"
+
+echo "Finished yum_update.sh on server $deploy_server_id at `date`"
+
+exit $return_code
diff --git a/extraconfig/tasks/yum_update.yaml b/extraconfig/tasks/yum_update.yaml
new file mode 100644
index 00000000..e918149e
--- /dev/null
+++ b/extraconfig/tasks/yum_update.yaml
@@ -0,0 +1,26 @@
+heat_template_version: 2014-10-16
+
+description: >
+ Software-config for performing package updates using yum
+
+resources:
+
+ config:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ config: {get_file: yum_update.sh}
+ inputs:
+ - name: update_identifier
+ description: yum will only run for previously unused values of update_identifier
+ default: ''
+ - name: command
+ description: yum sub-command to run, defaults to "update"
+ default: update
+ - name: command_arguments
+ description: yum command arguments, defaults to ""
+ default: ''
+
+outputs:
+ OS::stack_id:
+ value: {get_resource: config} \ No newline at end of file