tripleo-heat-templates/deployment/neutron/neutron-mlnx-agent-container-puppet.yaml
Takashi Kajinami c275d78703 Do not run puppet in docker_config
The docker_config is not intended for puppet execution and doesn't
automatically present the common requirements like fact cache generated
on host to run puppet inside containers.

This merges puppet execution into the base puppet_task to simplify
puppet execution. Because creating ovs bridge requires access to host
pids which is not allowed to container puppet tasks, that specific
task is re-implemented by host prep tasks.

Closes-Bug: #1958240
Change-Id: I7d647afbf26ea11aff4d51cc3ea734881bf5cd32
2022-02-18 02:24:36 +09:00

193 lines
7.1 KiB
YAML

heat_template_version: wallaby
description: >
OpenStack Neutron MLNX service
parameters:
ContainerNeutronMlnxImage:
description: The container image to use for the Neutron MLNX agent
type: string
tags:
- role_specific
ContainerNeutronConfigImage:
description: The container image to use for the neutron config_volume
type: string
tags:
- role_specific
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. Use
parameter_merge_strategies to merge it with the defaults.
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
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
NeutronPhysicalDevMappings:
description: >
List of <physical_network>:<physical device>
All physical networks listed in network_vlan_ranges
on the server should have mappings to appropriate
interfaces on each agent.
Example "tenant0:ens2f0,tenant1:ens2f1"
type: comma_delimited_list
default: ""
tags:
- role_specific
MlnxAgentPollingInterval:
default: 2
description: The number of seconds the agent will wait between
polling for local device changes
type: number
tags:
- role_specific
resources:
# Merging role-specific parameters (RoleParameters) with the default parameters.
# RoleParameters will have the precedence over the default parameters.
RoleParametersValue:
type: OS::Heat::Value
properties:
type: json
value:
map_replace:
- map_replace:
- neutron::agents::ml2::mlnx::physical_interface_mappings: NeutronPhysicalDevMappings
neutron::agents::ml2::mlnx::polling_interval: MlnxAgentPollingInterval
ContainerNeutronMlnxImage: ContainerNeutronMlnxImage
ContainerNeutronConfigImage: ContainerNeutronConfigImage
- values: {get_param: [RoleParameters]}
- values:
NeutronPhysicalDevMappings: {get_param: NeutronPhysicalDevMappings}
MlnxAgentPollingInterval: {get_param: MlnxAgentPollingInterval}
ContainerNeutronMlnxImage: {get_param: ContainerNeutronMlnxImage}
ContainerNeutronConfigImage: {get_param: ContainerNeutronConfigImage}
ContainersCommon:
type: ../containers-common.yaml
NeutronBase:
type: ./neutron-plugin-ml2.yaml
properties:
EndpointMap: {get_param: EndpointMap}
ServiceData: {get_param: ServiceData}
ServiceNetMap: {get_param: ServiceNetMap}
RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters}
MlnxAgentLogging:
type: OS::TripleO::Services::Logging::NeutronCommon
properties:
NeutronServiceName: mlnx-agent
EswitchdLogging:
type: OS::TripleO::Services::Logging::NeutronCommon
properties:
NeutronServiceName: eswitchd
outputs:
role_data:
description: Role data for Neutron MLNX service
value:
service_name: neutron_mlnx_agent
config_settings:
map_merge:
- get_attr: [NeutronBase, role_data, config_settings]
- get_attr: [RoleParametersValue, value]
- get_attr: [MlnxAgentLogging, config_settings]
puppet_config:
config_volume: 'neutron'
puppet_tags: neutron_plugin_ml2,eswitchd_config,neutron_dhcp_agent_config,neutron_l3_agent_config,neutron_mlnx_agent_config
step_config: |
include tripleo::profile::base::neutron::plugins::ml2
include tripleo::profile::base::neutron::agents::mlnx
config_image: {get_attr: [RoleParametersValue, value, ContainerNeutronConfigImage]}
kolla_config:
/var/lib/kolla/config_files/neutron_mlnx_agent.json:
command:
list_join:
- ' '
- - neutron-mlnx-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/mlnx/mlnx_conf.ini
- get_attr: [MlnxAgentLogging, cmd_extra_args]
config_files:
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"
merge: true
preserve_properties: true
permissions:
- path: /var/log/neutron
owner: neutron:neutron
recurse: true
/var/lib/kolla/config_files/eswitchd.json:
command:
list_join:
- ' '
- - eswitchd --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/eswitchd.conf
- get_attr: [EswitchdLogging, cmd_extra_args]
config_files:
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"
merge: true
preserve_properties: true
permissions:
- path: /var/log/neutron
owner: neutron:neutron
recurse: true
docker_config:
step_4:
neutron_mlnx_agent:
start_order: 10
image: {get_attr: [RoleParametersValue, value, ContainerNeutronMlnxImage]}
net: host
pid: host
privileged: true
restart: always
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- {get_attr: [MlnxAgentLogging, volumes]}
- - /var/lib/kolla/config_files/neutron_mlnx_agent.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/neutron:/var/lib/kolla/config_files/src:ro
- /lib/modules:/lib/modules:ro
- /run:/run
- /sys/class/net:/sys/class/net:rw
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
eswitchd:
start_order: 10
image: {get_attr: [RoleParametersValue, value, ContainerNeutronMlnxImage]}
net: host
pid: host
privileged: true
restart: always
healthcheck: {get_attr: [ContainersCommon, healthcheck_rpc_port]}
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- {get_attr: [EswitchdLogging, volumes]}
- - /var/lib/kolla/config_files/eswitchd.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/neutron:/var/lib/kolla/config_files/src:ro
- /lib/modules:/lib/modules:ro
- /run:/run
- /sys/class/net:/sys/class/net:rw
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
metadata_settings:
get_attr: [NeutronBase, role_data, metadata_settings]
upgrade_tasks: []