Flatten etcd configuration
Change-Id: Id9dd87a2ce8c8a0a68a67bc94487b9285486f819 Related-Blueprint: services-yaml-flattening
This commit is contained in:
parent
b08a44064f
commit
416f43c833
@ -1,9 +1,20 @@
|
|||||||
heat_template_version: rocky
|
heat_template_version: rocky
|
||||||
|
|
||||||
description: >
|
description: >
|
||||||
Etcd service configured with Puppet
|
Containerized etcd services
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
|
DockerEtcdImage:
|
||||||
|
description: image
|
||||||
|
type: string
|
||||||
|
DockerEtcdConfigImage:
|
||||||
|
description: The container image to use for the etcd config_volume
|
||||||
|
type: string
|
||||||
|
EndpointMap:
|
||||||
|
default: {}
|
||||||
|
description: Mapping of service endpoint -> protocol. Typically set
|
||||||
|
via parameter_defaults in the resource registry.
|
||||||
|
type: json
|
||||||
ServiceData:
|
ServiceData:
|
||||||
default: {}
|
default: {}
|
||||||
description: Dictionary packing service data
|
description: Dictionary packing service data
|
||||||
@ -25,11 +36,6 @@ parameters:
|
|||||||
default: {}
|
default: {}
|
||||||
description: Parameters specific to the role
|
description: Parameters specific to the role
|
||||||
type: json
|
type: json
|
||||||
EndpointMap:
|
|
||||||
default: {}
|
|
||||||
description: Mapping of service endpoint -> protocol. Typically set
|
|
||||||
via parameter_defaults in the resource registry.
|
|
||||||
type: json
|
|
||||||
EtcdInitialClusterToken:
|
EtcdInitialClusterToken:
|
||||||
description: Initial cluster token for the etcd cluster during bootstrap.
|
description: Initial cluster token for the etcd cluster during bootstrap.
|
||||||
type: string
|
type: string
|
||||||
@ -42,12 +48,11 @@ parameters:
|
|||||||
default: false
|
default: false
|
||||||
|
|
||||||
conditions:
|
conditions:
|
||||||
|
|
||||||
internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
|
internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
role_data:
|
role_data:
|
||||||
description: Role data for the Etcd role.
|
description: Role data for the etcd role.
|
||||||
value:
|
value:
|
||||||
service_name: etcd
|
service_name: etcd
|
||||||
monitoring_subscription: {get_param: MonitoringSubscriptionEtcd}
|
monitoring_subscription: {get_param: MonitoringSubscriptionEtcd}
|
||||||
@ -80,6 +85,7 @@ outputs:
|
|||||||
dport:
|
dport:
|
||||||
- 2379
|
- 2379
|
||||||
- 2380
|
- 2380
|
||||||
|
etcd::manage_service: false
|
||||||
-
|
-
|
||||||
if:
|
if:
|
||||||
- internal_tls_enabled
|
- internal_tls_enabled
|
||||||
@ -98,8 +104,59 @@ outputs:
|
|||||||
params:
|
params:
|
||||||
NETWORK: {get_param: [ServiceNetMap, EtcdNetwork]}
|
NETWORK: {get_param: [ServiceNetMap, EtcdNetwork]}
|
||||||
- {}
|
- {}
|
||||||
step_config: |
|
# BEGIN DOCKER SETTINGS
|
||||||
include ::tripleo::profile::base::etcd
|
puppet_config:
|
||||||
|
config_volume: etcd
|
||||||
|
config_image: &etcd_config_image {get_param: DockerEtcdConfigImage}
|
||||||
|
step_config:
|
||||||
|
list_join:
|
||||||
|
- "\n"
|
||||||
|
- - "['Etcd_key'].each |String $val| { noop_resource($val) }"
|
||||||
|
- "include ::tripleo::profile::base::etcd"
|
||||||
|
kolla_config:
|
||||||
|
/var/lib/kolla/config_files/etcd.json:
|
||||||
|
command: /usr/bin/etcd --config-file /etc/etcd/etcd.yml
|
||||||
|
config_files:
|
||||||
|
- source: "/var/lib/kolla/config_files/src/*"
|
||||||
|
dest: "/"
|
||||||
|
merge: true
|
||||||
|
preserve_properties: true
|
||||||
|
permissions:
|
||||||
|
- path: /var/lib/etcd
|
||||||
|
owner: etcd:etcd
|
||||||
|
recurse: true
|
||||||
|
docker_config:
|
||||||
|
step_2:
|
||||||
|
etcd:
|
||||||
|
image: {get_param: DockerEtcdImage}
|
||||||
|
net: host
|
||||||
|
privileged: false
|
||||||
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: /openstack/healthcheck
|
||||||
|
volumes:
|
||||||
|
- /var/lib/etcd:/var/lib/etcd
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
- /var/lib/kolla/config_files/etcd.json:/var/lib/kolla/config_files/config.json:ro
|
||||||
|
- /var/lib/config-data/puppet-generated/etcd/:/var/lib/kolla/config_files/src:ro
|
||||||
|
environment:
|
||||||
|
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
|
||||||
|
docker_puppet_tasks:
|
||||||
|
# Etcd keys initialization occurs only on single node
|
||||||
|
step_2:
|
||||||
|
config_volume: 'etcd_init_tasks'
|
||||||
|
puppet_tags: 'etcd_key'
|
||||||
|
step_config: |
|
||||||
|
include ::tripleo::profile::base::etcd
|
||||||
|
config_image: *etcd_config_image
|
||||||
|
volumes:
|
||||||
|
- /var/lib/config-data/etcd/etc/etcd/:/etc/etcd:ro
|
||||||
|
- /var/lib/etcd:/var/lib/etcd:ro
|
||||||
|
host_prep_tasks:
|
||||||
|
- name: create /var/lib/etcd
|
||||||
|
file:
|
||||||
|
path: /var/lib/etcd
|
||||||
|
state: directory
|
||||||
upgrade_tasks: []
|
upgrade_tasks: []
|
||||||
metadata_settings:
|
metadata_settings:
|
||||||
if:
|
if:
|
||||||
@ -109,3 +166,10 @@ outputs:
|
|||||||
network: {get_param: [ServiceNetMap, EtcdNetwork]}
|
network: {get_param: [ServiceNetMap, EtcdNetwork]}
|
||||||
type: node
|
type: node
|
||||||
- null
|
- null
|
||||||
|
post_upgrade_tasks:
|
||||||
|
- when: step|int == 1
|
||||||
|
import_role:
|
||||||
|
name: tripleo-docker-rm
|
||||||
|
vars:
|
||||||
|
containers_to_rm:
|
||||||
|
- etcd
|
@ -1,124 +0,0 @@
|
|||||||
heat_template_version: rocky
|
|
||||||
|
|
||||||
description: >
|
|
||||||
OpenStack containerized etcd services
|
|
||||||
|
|
||||||
parameters:
|
|
||||||
DockerEtcdImage:
|
|
||||||
description: image
|
|
||||||
type: string
|
|
||||||
DockerEtcdConfigImage:
|
|
||||||
description: The container image to use for the etcd config_volume
|
|
||||||
type: string
|
|
||||||
EndpointMap:
|
|
||||||
default: {}
|
|
||||||
description: Mapping of service endpoint -> protocol. Typically set
|
|
||||||
via parameter_defaults in the resource registry.
|
|
||||||
type: json
|
|
||||||
ServiceData:
|
|
||||||
default: {}
|
|
||||||
description: Dictionary packing service data
|
|
||||||
type: json
|
|
||||||
ServiceNetMap:
|
|
||||||
default: {}
|
|
||||||
description: Mapping of service_name -> network name. Typically set
|
|
||||||
via parameter_defaults in the resource registry. This
|
|
||||||
mapping overrides those in ServiceNetMapDefaults.
|
|
||||||
type: json
|
|
||||||
DefaultPasswords:
|
|
||||||
default: {}
|
|
||||||
type: json
|
|
||||||
RoleName:
|
|
||||||
default: ''
|
|
||||||
description: Role name on which the service is applied
|
|
||||||
type: string
|
|
||||||
RoleParameters:
|
|
||||||
default: {}
|
|
||||||
description: Parameters specific to the role
|
|
||||||
type: json
|
|
||||||
EtcdInitialClusterToken:
|
|
||||||
description: Initial cluster token for the etcd cluster during bootstrap.
|
|
||||||
type: string
|
|
||||||
hidden: true
|
|
||||||
|
|
||||||
resources:
|
|
||||||
|
|
||||||
EtcdPuppetBase:
|
|
||||||
type: ../../puppet/services/etcd.yaml
|
|
||||||
properties:
|
|
||||||
EndpointMap: {get_param: EndpointMap}
|
|
||||||
ServiceData: {get_param: ServiceData}
|
|
||||||
ServiceNetMap: {get_param: ServiceNetMap}
|
|
||||||
DefaultPasswords: {get_param: DefaultPasswords}
|
|
||||||
EtcdInitialClusterToken: {get_param: EtcdInitialClusterToken}
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
role_data:
|
|
||||||
description: Role data for the etcd role.
|
|
||||||
value:
|
|
||||||
service_name: {get_attr: [EtcdPuppetBase, role_data, service_name]}
|
|
||||||
config_settings:
|
|
||||||
map_merge:
|
|
||||||
- {get_attr: [EtcdPuppetBase, role_data, config_settings]}
|
|
||||||
- etcd::manage_service: false
|
|
||||||
# BEGIN DOCKER SETTINGS
|
|
||||||
puppet_config:
|
|
||||||
config_volume: etcd
|
|
||||||
config_image: &etcd_config_image {get_param: DockerEtcdConfigImage}
|
|
||||||
step_config:
|
|
||||||
list_join:
|
|
||||||
- "\n"
|
|
||||||
- - "['Etcd_key'].each |String $val| { noop_resource($val) }"
|
|
||||||
- get_attr: [EtcdPuppetBase, role_data, step_config]
|
|
||||||
kolla_config:
|
|
||||||
/var/lib/kolla/config_files/etcd.json:
|
|
||||||
command: /usr/bin/etcd --config-file /etc/etcd/etcd.yml
|
|
||||||
config_files:
|
|
||||||
- source: "/var/lib/kolla/config_files/src/*"
|
|
||||||
dest: "/"
|
|
||||||
merge: true
|
|
||||||
preserve_properties: true
|
|
||||||
permissions:
|
|
||||||
- path: /var/lib/etcd
|
|
||||||
owner: etcd:etcd
|
|
||||||
recurse: true
|
|
||||||
docker_config:
|
|
||||||
step_2:
|
|
||||||
etcd:
|
|
||||||
image: {get_param: DockerEtcdImage}
|
|
||||||
net: host
|
|
||||||
privileged: false
|
|
||||||
restart: always
|
|
||||||
healthcheck:
|
|
||||||
test: /openstack/healthcheck
|
|
||||||
volumes:
|
|
||||||
- /var/lib/etcd:/var/lib/etcd
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
- /var/lib/kolla/config_files/etcd.json:/var/lib/kolla/config_files/config.json:ro
|
|
||||||
- /var/lib/config-data/puppet-generated/etcd/:/var/lib/kolla/config_files/src:ro
|
|
||||||
environment:
|
|
||||||
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
|
|
||||||
docker_puppet_tasks:
|
|
||||||
# Etcd keys initialization occurs only on single node
|
|
||||||
step_2:
|
|
||||||
config_volume: 'etcd_init_tasks'
|
|
||||||
puppet_tags: 'etcd_key'
|
|
||||||
step_config:
|
|
||||||
get_attr: [EtcdPuppetBase, role_data, step_config]
|
|
||||||
config_image: *etcd_config_image
|
|
||||||
volumes:
|
|
||||||
- /var/lib/config-data/etcd/etc/etcd/:/etc/etcd:ro
|
|
||||||
- /var/lib/etcd:/var/lib/etcd:ro
|
|
||||||
host_prep_tasks:
|
|
||||||
- name: create /var/lib/etcd
|
|
||||||
file:
|
|
||||||
path: /var/lib/etcd
|
|
||||||
state: directory
|
|
||||||
upgrade_tasks: []
|
|
||||||
post_upgrade_tasks:
|
|
||||||
- when: step|int == 1
|
|
||||||
import_role:
|
|
||||||
name: tripleo-docker-rm
|
|
||||||
vars:
|
|
||||||
containers_to_rm:
|
|
||||||
- etcd
|
|
@ -5,7 +5,7 @@ resource_registry:
|
|||||||
OS::TripleO::Services::ComputeNeutronOvsAgent: OS::Heat::None
|
OS::TripleO::Services::ComputeNeutronOvsAgent: OS::Heat::None
|
||||||
# FIXME(bogdando): switch it, once it is containerized
|
# FIXME(bogdando): switch it, once it is containerized
|
||||||
OS::TripleO::Services::NeutronVppAgent: ../puppet/services/neutron-vpp-agent.yaml
|
OS::TripleO::Services::NeutronVppAgent: ../puppet/services/neutron-vpp-agent.yaml
|
||||||
OS::TripleO::Services::Etcd: ../docker/services/etcd.yaml
|
OS::TripleO::Services::Etcd: ../deployment/etcd/etcd-container-puppet.yaml
|
||||||
# FIXME(bogdando): switch it, once it is containerized
|
# FIXME(bogdando): switch it, once it is containerized
|
||||||
OS::TripleO::Services::Vpp: ../puppet/services/vpp.yaml
|
OS::TripleO::Services::Vpp: ../puppet/services/vpp.yaml
|
||||||
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
resource_registry:
|
resource_registry:
|
||||||
OS::TripleO::Services::Etcd: ../../puppet/services/etcd.yaml
|
OS::TripleO::Services::Etcd: ../../deployment/etcd/etcd-container-puppet.yaml
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
resource_registry:
|
resource_registry:
|
||||||
OS::TripleO::Services::Etcd: ../../docker/services/etcd.yaml
|
OS::TripleO::Services::Etcd: ../../deployment/etcd/etcd-container-puppet.yaml
|
||||||
|
Loading…
Reference in New Issue
Block a user