Merge "Configure CephStorage services via resource chains"

This commit is contained in:
Jenkins 2016-05-27 08:49:36 +00:00 committed by Gerrit Code Review
commit 7cd061a856
4 changed files with 83 additions and 36 deletions

View File

@ -733,7 +733,12 @@ parameters:
type: json
description: Optional scheduler hints to pass to nova
default: {}
CephStorageServices:
default: []
description: A list of service resources (configured in the Heat
resource_registry) which represent nested stacks
for each service that should get installed on the CephStorage nodes.
type: comma_delimited_list
# Hostname format for each role
# Note %index% is translated into the index of the node, e.g 0/1/2 etc
@ -1143,6 +1148,13 @@ resources:
SchedulerHints: {get_param: ObjectStorageSchedulerHints}
NodeIndex: '%index%'
CephStorageServiceChain:
type: OS::TripleO::Services
properties:
Services: {get_param: CephStorageServices}
EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
MysqlVirtualIPUri: {get_attr: [VipMap, net_ip_uri_map, {get_param: [ServiceNetMap, MysqlNetwork]}]}
CephStorage:
type: OS::Heat::ResourceGroup
depends_on: Networks
@ -1170,6 +1182,7 @@ resources:
ServerMetadata: {get_param: ServerMetadata}
SchedulerHints: {get_param: CephStorageSchedulerHints}
NodeIndex: '%index%'
ServiceConfigSettings: {get_attr: [CephStorageServiceChain, config_settings]}
ControllerIpListMap:
type: OS::TripleO::Network::Ports::NetIpListMap
@ -1574,6 +1587,7 @@ resources:
allnodes_extra: {get_attr: [AllNodesExtraConfig, config_identifier]}
cephstorage_config: {get_attr: [CephStorage, attributes, config_identifier]}
deployment_identifier: {get_param: DeployIdentifier}
StepConfig: {get_attr: [CephStorageServiceChain, step_config]}
outputs:
KeystoneURL:

View File

@ -13,6 +13,10 @@ parameters:
NodeConfigIdentifiers:
type: json
description: Value which changes if the node configuration may need to be re-applied
StepConfig:
type: string
description: Config manifests that will be used to step through the deployment.
default: ''
resources:
@ -33,26 +37,44 @@ resources:
group: puppet
options:
enable_debug: {get_param: ConfigDebug}
enable_hiera: True
enable_facter: False
inputs:
- name: step
outputs:
- name: result
config:
get_file: manifests/overcloud_cephstorage.pp
list_join:
- ''
- - get_file: manifests/overcloud_cephstorage.pp
- {get_param: StepConfig}
CephStorageDeployment_Step1:
CephStorageDeployment_Step2:
type: OS::Heat::StructuredDeployments
depends_on: CephStorageArtifactsDeploy
properties:
name: CephStorageDeployment_Step1
name: CephStorageDeployment_Step2
servers: {get_param: servers}
config: {get_resource: CephStoragePuppetConfig}
input_values:
step: 2
update_identifier: {get_param: NodeConfigIdentifiers}
CephStorageDeployment_Step3:
type: OS::Heat::StructuredDeployments
depends_on: CephStorageDeployment_Step2
properties:
name: CephStorageDeployment_Step3
servers: {get_param: servers}
config: {get_resource: CephStoragePuppetConfig}
input_values:
step: 3
update_identifier: {get_param: NodeConfigIdentifiers}
# Note, this should come last, so use depends_on to ensure
# this is created after any other resources.
ExtraConfig:
depends_on: CephStorageDeployment_Step1
depends_on: CephStorageDeployment_Step3
type: OS::TripleO::NodeExtraConfigPost
properties:
servers: {get_param: servers}

View File

@ -96,6 +96,9 @@ parameters:
NodeIndex:
type: number
default: 0
ServiceConfigSettings:
type: json
default: {}
resources:
CephStorage:
@ -247,6 +250,7 @@ resources:
- heat_config_%{::deploy_config_name}
- ceph_extraconfig
- extraconfig
- service_configs
- ceph_cluster # provided by CephClusterConfig
- ceph
- '"%{::osfamily}"'
@ -254,6 +258,8 @@ resources:
- network
merge_behavior: deeper
datafiles:
service_configs:
mapped_data: {get_param: ServiceConfigSettings}
common:
raw_data: {get_file: hieradata/common.yaml}
network:

View File

@ -16,41 +16,46 @@
include ::tripleo::packages
include ::tripleo::firewall
create_resources(kmod::load, hiera('kernel_modules'), {})
create_resources(sysctl::value, hiera('sysctl_settings'), {})
Exec <| tag == 'kmod::load' |> -> Sysctl <| |>
if hiera('step') >= 1 {
if count(hiera('ntp::servers')) > 0 {
include ::ntp
create_resources(kmod::load, hiera('kernel_modules'), {})
create_resources(sysctl::value, hiera('sysctl_settings'), {})
Exec <| tag == 'kmod::load' |> -> Sysctl <| |>
include ::timezone
if count(hiera('ntp::servers')) > 0 {
include ::ntp
}
}
include ::timezone
if hiera('step') >= 3 {
if str2bool(hiera('ceph_osd_selinux_permissive', true)) {
exec { 'set selinux to permissive on boot':
command => "sed -ie 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config",
onlyif => "test -f /etc/selinux/config && ! grep '^SELINUX=permissive' /etc/selinux/config",
path => ['/usr/bin', '/usr/sbin'],
}
if str2bool(hiera('ceph_osd_selinux_permissive', true)) {
exec { 'set selinux to permissive on boot':
command => "sed -ie 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config",
onlyif => "test -f /etc/selinux/config && ! grep '^SELINUX=permissive' /etc/selinux/config",
path => ['/usr/bin', '/usr/sbin'],
exec { 'set selinux to permissive':
command => 'setenforce 0',
onlyif => "which setenforce && getenforce | grep -i 'enforcing'",
path => ['/usr/bin', '/usr/sbin'],
} -> Class['ceph::profile::osd']
}
exec { 'set selinux to permissive':
command => 'setenforce 0',
onlyif => "which setenforce && getenforce | grep -i 'enforcing'",
path => ['/usr/bin', '/usr/sbin'],
} -> Class['ceph::profile::osd']
}
if str2bool(hiera('ceph_ipv6', false)) {
$mon_host = hiera('ceph_mon_host_v6')
} else {
$mon_host = hiera('ceph_mon_host')
}
class { '::ceph::profile::params':
mon_host => $mon_host,
}
include ::ceph::conf
include ::ceph::profile::client
include ::ceph::profile::osd
if str2bool(hiera('ceph_ipv6', false)) {
$mon_host = hiera('ceph_mon_host_v6')
} else {
$mon_host = hiera('ceph_mon_host')
hiera_include('ceph_classes')
package_manifest{'/var/lib/tripleo/installed-packages/overcloud_ceph': ensure => present}
}
class { '::ceph::profile::params':
mon_host => $mon_host,
}
include ::ceph::conf
include ::ceph::profile::client
include ::ceph::profile::osd
hiera_include('ceph_classes')
package_manifest{'/var/lib/tripleo/installed-packages/overcloud_ceph': ensure => present}