Simplify ironic service templates

Change-Id: I807466bbeeaae950286c20be148a0366d0382f30
This commit is contained in:
ramishra 2021-04-19 10:51:15 +05:30
parent 17cfe61e0b
commit 66534f0b4a
6 changed files with 119 additions and 156 deletions

View File

@ -66,11 +66,10 @@ parameters:
default: false
conditions:
internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
cors_allowed_origin_unset: {equals : [{get_param: IronicCorsAllowedOrigin}, '']}
cors_allowed_origin_set:
not: {equals : [{get_param: IronicCorsAllowedOrigin}, '']}
resources:
ApacheServiceBase:
type: ../../deployment/apache/apache-baremetal-puppet.yaml
properties:
@ -125,12 +124,11 @@ outputs:
map_merge:
- get_attr: [IronicBase, role_data, config_settings]
- get_attr: [ApacheServiceBase, role_data, config_settings]
-
if:
- cors_allowed_origin_unset
- {}
- ironic::cors::allowed_origin: {get_param: IronicCorsAllowedOrigin}
- ironic::api::authtoken::password: {get_param: IronicPassword}
- ironic::cors::allowed_origin:
if:
- cors_allowed_origin_set
- {get_param: IronicCorsAllowedOrigin}
ironic::api::authtoken::password: {get_param: IronicPassword}
ironic::api::authtoken::project_name: 'service'
ironic::api::authtoken::user_domain_name: 'Default'
ironic::api::authtoken::project_domain_name: 'Default'
@ -260,19 +258,14 @@ outputs:
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/kolla/config_files/ironic_api.json:/var/lib/kolla/config_files/config.json:ro
- - /var/lib/kolla/config_files/ironic_api.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/ironic_api:/var/lib/kolla/config_files/src:ro
- /var/log/containers/ironic:/var/log/ironic:z
- /var/log/containers/httpd/ironic-api:/var/log/httpd:z
- if:
- internal_tls_enabled
- {get_param: EnableInternalTLS}
- - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
- []
- if:
- internal_tls_enabled
- - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
- []
- /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:

View File

@ -57,9 +57,10 @@ parameters:
- allowed_values: [ '', 'oslo', 'json-rpc']
conditions:
default_rsc_unset: {equals : [{get_param: IronicDefaultResourceClass}, '']}
rpc_transport_unset: {equals : [{get_param: IronicRpcTransport}, '']}
enable_sqlalchemy_collectd: {equals : [{get_param: EnableSQLAlchemyCollectd}, true]}
default_rsc_set:
not: {equals : [{get_param: IronicDefaultResourceClass}, '']}
rpc_transport_set:
not: {equals : [{get_param: IronicRpcTransport}, '']}
outputs:
role_data:
@ -67,42 +68,35 @@ outputs:
value:
service_name: ironic_base
config_settings:
map_merge:
-
ironic::database_connection:
make_url:
scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
username: ironic
password: {get_param: IronicPassword}
host: {get_param: [EndpointMap, MysqlInternal, host]}
path: /ironic
query:
if:
- enable_sqlalchemy_collectd
-
read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
plugin: collectd
collectd_program_name: ironic
collectd_host: localhost
-
read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
ironic::logging::debug:
if:
ironic::database_connection:
make_url:
scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
username: ironic
password: {get_param: IronicPassword}
host: {get_param: [EndpointMap, MysqlInternal, host]}
path: /ironic
query:
if:
- {get_param: EnableSQLAlchemyCollectd}
- read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
plugin: collectd
collectd_program_name: ironic
collectd_host: localhost
- read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
ironic::logging::debug:
if:
- {get_param: IronicDebug}
- True
- {get_param: Debug}
-
ironic::default_resource_class:
if:
- default_rsc_unset
- {}
- ironic::default_resource_class: {get_param: IronicDefaultResourceClass}
-
- default_rsc_set
- {get_param: IronicDefaultResourceClass}
ironic::rpc_transport:
if:
- rpc_transport_unset
- {}
- ironic::rpc_transport: {get_param: IronicRpcTransport}
- rpc_transport_set
- {get_param: IronicRpcTransport}
step_config: |
include tripleo::profile::base::ironic

View File

@ -255,14 +255,15 @@ parameters:
type: string
conditions:
default_deploy_interface_unset: {equals : [{get_param: IronicDefaultDeployInterface}, '']}
default_inspect_interface_unset: {equals : [{get_param: IronicDefaultInspectInterface}, '']}
default_deploy_interface_set:
not: {equals : [{get_param: IronicDefaultDeployInterface}, '']}
default_inspect_interface_set:
not: {equals : [{get_param: IronicDefaultInspectInterface}, '']}
service_debug:
or:
- {get_param: IronicDebug}
- {get_param: Debug}
enable_architecture_ppc64le: {contains: ['ppc64le', {get_param: AdditionalArchitectures}]}
configure_swift_temp_url: {equals: [{get_param: IronicConfigureSwiftTempUrlKey}, true]}
ironic_conductor_group:
or:
- not: {equals: [{get_param: IronicConductorGroup}, '']}
@ -324,24 +325,18 @@ outputs:
map_merge:
- get_attr: [IronicBase, role_data, config_settings]
- get_attr: [RoleParametersValue, value]
-
if:
- default_deploy_interface_unset
- {}
- if:
- default_deploy_interface_set
- ironic::drivers::interfaces::default_deploy_interface: {get_param: IronicDefaultDeployInterface}
-
if:
- default_inspect_interface_unset
- {}
- if:
- default_inspect_interface_set
- ironic::drivers::interfaces::default_inspect_interface: {get_param: IronicDefaultInspectInterface}
-
if:
- if:
- enable_architecture_ppc64le
- ironic::pxe::enable_ppc64le: true
ironic::conductor::power_state_change_timeout: 60
ironic::drivers::ipmi::command_retry_timeout: 120
ironic::drivers::ipmi::min_command_interval: 15
- {}
- ironic::conductor::cleaning_disk_erase: {get_param: IronicCleaningDiskErase}
ironic::conductor::default_boot_option: {get_param: IronicDefaultBootOption}
ironic::conductor::automated_clean: {get_param: IronicAutomatedClean}
@ -541,44 +536,40 @@ outputs:
docker_config:
step_4:
map_merge:
- if:
- configure_swift_temp_url
- create_swift_temp_url_key:
start_order: 70
image: &ironic_conductor_image {get_param: ContainerIronicConductorImage}
net: host
detach: false
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/config-data/puppet-generated/ironic/etc/ironic:/etc/ironic:ro
- /var/lib/container-config-scripts/create_swift_temp_url_key.sh:/create_swift_temp_url_key.sh:ro
user: root
command: "/usr/bin/bootstrap_host_exec ironic_conductor /create_swift_temp_url_key.sh"
- {}
- ironic_conductor:
start_order: 80
image: *ironic_conductor_image
create_swift_temp_url_key:
if:
- {get_param: IronicConfigureSwiftTempUrlKey}
- start_order: 70
image: &ironic_conductor_image {get_param: ContainerIronicConductorImage}
net: host
privileged: true
restart: always
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
detach: false
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/kolla/config_files/ironic_conductor.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/ironic:/var/lib/kolla/config_files/src:ro
- /lib/modules:/lib/modules:ro
- /sys:/sys
- /dev:/dev
- /run:/run #shared?
- /var/lib/ironic:/var/lib/ironic:z
- /var/log/containers/ironic:/var/log/ironic:z
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
- - /var/lib/config-data/puppet-generated/ironic/etc/ironic:/etc/ironic:ro
- /var/lib/container-config-scripts/create_swift_temp_url_key.sh:/create_swift_temp_url_key.sh:ro
user: root
command: "/usr/bin/bootstrap_host_exec ironic_conductor /create_swift_temp_url_key.sh"
ironic_conductor:
start_order: 80
image: *ironic_conductor_image
net: host
privileged: true
restart: always
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- - /var/lib/kolla/config_files/ironic_conductor.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/ironic:/var/lib/kolla/config_files/src:ro
- /lib/modules:/lib/modules:ro
- /sys:/sys
- /dev:/dev
- /run:/run #shared?
- /var/lib/ironic:/var/lib/ironic:z
- /var/log/containers/ironic:/var/log/ironic:z
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
host_prep_tasks:
- name: load iscsi_tcp module
import_role:

View File

@ -193,19 +193,16 @@ parameter_groups:
- IronicInspectorUseSwift
conditions:
enable_ipxe: {equals : [{get_param: IronicInspectorIPXEEnabled}, true]}
use_swift:
or:
- equals: [{get_param: IronicInspectorUseSwift}, true]
- {get_param: IronicInspectorUseSwift}
- equals: [{get_param: IronicInspectorStorageBackend}, 'swift']
enable_node_discovery: {equals : [{get_param: IronicInspectorEnableNodeDiscovery}, true]}
ironic_inspection_subnets_not_set: {equals : [{get_param: IronicInspectorSubnets}, {}]}
ironic_inspection_subnets_set:
not: {equals : [{get_param: IronicInspectorSubnets}, {}]}
enable_architecture_ppc64le: {contains: ['ppc64le', {get_param: AdditionalArchitectures}]}
ipa_images: {not: {equals: [{get_param: IPAImageURLs}, []]}}
enable_sqlalchemy_collectd: {equals : [{get_param: EnableSQLAlchemyCollectd}, true]}
resources:
ContainersCommon:
type: ../containers-common.yaml
@ -276,9 +273,9 @@ outputs:
$NETWORK: {get_param: [ServiceNetMap, IronicInspectorNetwork]}
tripleo::profile::base::ironic_inspector::inspection_subnets:
if:
- ironic_inspection_subnets_not_set
- [{ip_range: {get_param: IronicInspectorIpRange}}]
- ironic_inspection_subnets_set
- get_param: IronicInspectorSubnets
- [{ip_range: {get_param: IronicInspectorIpRange}}]
ironic::inspector::dnsmasq_interface: {get_param: IronicInspectorInterface}
ironic::inspector::dnsmasq_dhcp_hostsdir: /var/lib/ironic-inspector/dhcp-hostsdir
ironic::inspector::pxe_filter::dnsmasq::purge_dhcp_hostsdir: false
@ -323,48 +320,41 @@ outputs:
path: /ironic-inspector
query:
if:
- enable_sqlalchemy_collectd
-
read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
plugin: collectd
collectd_program_name: ironic_inspector
collectd_host: localhost
-
read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
- {get_param: EnableSQLAlchemyCollectd}
- read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
plugin: collectd
collectd_program_name: ironic_inspector
collectd_host: localhost
- read_default_file: /etc/my.cnf.d/tripleo.cnf
read_default_group: tripleo
-
if:
- enable_architecture_ppc64le
- ironic::inspector::enable_ppc64le: true
- {}
-
if:
- enable_ipxe
- ironic::inspector::pxe_transfer_protocol: 'http'
- {}
-
if:
- use_swift
- ironic::inspector::store_data: 'swift'
ironic::inspector::swift::username: 'ironic'
ironic::inspector::swift::password: {get_param: IronicPassword}
ironic::inspector::swift::project_name: 'service'
ironic::inspector::swift::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
ironic::inspector::swift::user_domain_name: 'Default'
ironic::inspector::swift::project_domain_name: 'Default'
ironic::inspector::swift::region_name: {get_param: KeystoneRegion}
- ironic::inspector::store_data: {get_param: IronicInspectorStorageBackend}
-
if:
- enable_node_discovery
- ironic::inspector::node_not_found_hook: 'enroll'
ironic::inspector::discovery_default_driver: {get_param: IronicInspectorDiscoveryDefaultDriver}
- {}
# Match what we do for Ironic containers
ironic::inspector::enable_ppc64le:
if:
- enable_architecture_ppc64le
- true
ironic::inspector::pxe_transfer_protocol:
if:
- {get_param: IronicInspectorIPXEEnabled}
- 'http'
- if:
- use_swift
- ironic::inspector::store_data: 'swift'
ironic::inspector::swift::username: 'ironic'
ironic::inspector::swift::password: {get_param: IronicPassword}
ironic::inspector::swift::project_name: 'service'
ironic::inspector::swift::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
ironic::inspector::swift::user_domain_name: 'Default'
ironic::inspector::swift::project_domain_name: 'Default'
ironic::inspector::swift::region_name: {get_param: KeystoneRegion}
- ironic::inspector::store_data: {get_param: IronicInspectorStorageBackend}
- if:
- {get_param: IronicInspectorEnableNodeDiscovery}
- ironic::inspector::node_not_found_hook: 'enroll'
ironic::inspector::discovery_default_driver: {get_param: IronicInspectorDiscoveryDefaultDriver}
# Match what we do for Ironic containers
- ironic::inspector::tftp_root: /var/lib/ironic/tftpboot
- ironic::inspector::http_root: /var/lib/ironic/httpboot
ironic::inspector::http_root: /var/lib/ironic/httpboot
service_config_settings:
mysql:
ironic::inspector::db::mysql::password: {get_param: IronicPassword}

View File

@ -43,7 +43,6 @@ parameters:
description: Keystone region for endpoint
resources:
ContainersCommon:
type: ../containers-common.yaml
@ -109,8 +108,7 @@ outputs:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- {get_attr: [NeutronLogging, volumes]}
-
- /var/lib/kolla/config_files/ironic_neutron_agent.json:/var/lib/kolla/config_files/config.json:ro
- - /var/lib/kolla/config_files/ironic_neutron_agent.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/neutron:/var/lib/kolla/config_files/src:ro
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS

View File

@ -35,7 +35,6 @@ parameters:
type: json
resources:
ContainersCommon:
type: ../containers-common.yaml
@ -135,8 +134,7 @@ outputs:
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/kolla/config_files/ironic_pxe_tftp.json:/var/lib/kolla/config_files/config.json:ro
- - /var/lib/kolla/config_files/ironic_pxe_tftp.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/ironic:/var/lib/kolla/config_files/src:ro
- /var/lib/ironic:/var/lib/ironic/:shared,z
- /var/log/containers/ironic:/var/log/ironic:z
@ -155,8 +153,7 @@ outputs:
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/kolla/config_files/ironic_pxe_http.json:/var/lib/kolla/config_files/config.json:ro
- - /var/lib/kolla/config_files/ironic_pxe_http.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/ironic:/var/lib/kolla/config_files/src:ro
- /var/lib/ironic:/var/lib/ironic/:shared,z
- /var/log/containers/ironic:/var/log/ironic:z