Merge "Add pre-network hook and example showing config-then-reboot"

This commit is contained in:
Jenkins 2017-01-04 19:34:27 +00:00 committed by Gerrit Code Review
commit 4a02aeb22e
8 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,48 @@
heat_template_version: 2014-10-16
description: >
Do some configuration, then reboot - sometimes needed for early-boot
changes such as modifying kernel configuration
parameters:
server:
type: string
resources:
SomeConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/bash
echo "did some config before reboot" > /root/pre-reboot-config
SomeDeployment:
type: OS::Heat::SoftwareDeployment
properties:
name: SomeDeployment
server: {get_param: server}
config: {get_resource: SomeConfig}
actions: ['CREATE'] # Only do this on CREATE
RebootConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: |
#!/bin/bash
# Stop os-collect-config to avoid any race collecting another
# deployment before reboot happens
systemctl stop os-collect-config.service
/sbin/reboot
RebootDeployment:
type: OS::Heat::SoftwareDeployment
depends_on: SomeDeployment
properties:
name: RebootDeployment
server: {get_param: server}
config: {get_resource: RebootConfig}
actions: ['CREATE'] # Only do this on CREATE
signal_transport: NO_SIGNAL

View File

@ -11,6 +11,7 @@ resource_registry:
OS::TripleO::Tasks::PackageUpdate: extraconfig/tasks/yum_update.yaml
{% for role in roles %}
OS::TripleO::{{role.name}}::PreNetworkConfig: OS::Heat::None
OS::TripleO::{{role.name}}PostDeploySteps: puppet/post.yaml
OS::TripleO::{{role.name}}: puppet/{{role.name.lower()}}-role.yaml
OS::TripleO::{{role.name}}Config: puppet/{{role.name.lower()}}-config.yaml

View File

@ -336,8 +336,14 @@ resources:
- - {get_attr: [BlockStorage, name]}
- ctlplane
PreNetworkConfig:
type: OS::TripleO::BlockStorage::PreNetworkConfig
properties:
server: {get_resource: BlockStorage}
NetworkDeployment:
type: OS::TripleO::SoftwareDeployment
depends_on: PreNetworkConfig
properties:
name: NetworkDeployment
config: {get_resource: NetworkConfig}

View File

@ -342,8 +342,14 @@ resources:
- - {get_attr: [CephStorage, name]}
- ctlplane
PreNetworkConfig:
type: OS::TripleO::CephStorage::PreNetworkConfig
properties:
server: {get_resource: CephStorage}
NetworkDeployment:
type: OS::TripleO::SoftwareDeployment
depends_on: PreNetworkConfig
properties:
name: NetworkDeployment
config: {get_resource: NetworkConfig}

View File

@ -345,6 +345,11 @@ resources:
- - {get_attr: [NovaCompute, name]}
- ctlplane
PreNetworkConfig:
type: OS::TripleO::Compute::PreNetworkConfig
properties:
server: {get_resource: NovaCompute}
NetworkConfig:
type: OS::TripleO::Compute::Net::SoftwareConfig
properties:
@ -358,6 +363,7 @@ resources:
NetworkDeployment:
type: OS::TripleO::SoftwareDeployment
depends_on: PreNetworkConfig
properties:
name: NetworkDeployment
config: {get_resource: NetworkConfig}

View File

@ -364,6 +364,11 @@ resources:
- - {get_attr: [Controller, name]}
- ctlplane
PreNetworkConfig:
type: OS::TripleO::Controller::PreNetworkConfig
properties:
server: {get_resource: Controller}
NetworkConfig:
type: OS::TripleO::Controller::Net::SoftwareConfig
properties:
@ -377,6 +382,7 @@ resources:
NetworkDeployment:
type: OS::TripleO::SoftwareDeployment
depends_on: PreNetworkConfig
properties:
name: NetworkDeployment
config: {get_resource: NetworkConfig}

View File

@ -336,8 +336,14 @@ resources:
- - {get_attr: [SwiftStorage, name]}
- ctlplane
PreNetworkConfig:
type: OS::TripleO::ObjectStorage::PreNetworkConfig
properties:
server: {get_resource: SwiftStorage}
NetworkDeployment:
type: OS::TripleO::SoftwareDeployment
depends_on: PreNetworkConfig
properties:
name: NetworkDeployment
config: {get_resource: NetworkConfig}

View File

@ -359,8 +359,14 @@ resources:
- - {get_attr: [{{role}}, name]}
- ctlplane
PreNetworkConfig:
type: OS::TripleO::{{role}}::PreNetworkConfig
properties:
server: {get_resource: {{role}}}}
NetworkDeployment:
type: OS::TripleO::SoftwareDeployment
depends_on: PreNetworkConfig
properties:
name: NetworkDeployment
config: {get_resource: NetworkConfig}