tripleo-heat-templates/deployment/qdr/qdrouterd-container-puppet.yaml
Jose Luis Franco Arza d1035703b7 Force removal of docker container in tripleo-docker-rm.
The tripleo-docker-rm role has been replaced by tripleo-container-rm [0].
This role will identify the docker engine via the container_cli variable
and perform a deletion of that container. However, these tasks inside the
post_upgrade_tasks section were thought to remove the old docker containers
after upgrading from rocky to stein, in which podman starts to be the
container engine by default.

For that reason, we need to ensure that the container engine in which the
containers are removed is docker, as otherwise we will be removing the
podman container and the deployment steps will fail.

Closes-Bug: #1836531
[0] - 2135446a35

Depends-On: https://review.opendev.org/#/c/671698/
Change-Id: Ib139a1d77f71fc32a49c9878d1b4a6d07564e9dc
2019-07-19 12:37:35 +00:00

161 lines
5.4 KiB
YAML

heat_template_version: rocky
description: >
OpenStack containerized Qpid dispatch router service
parameters:
ContainerQdrouterdImage:
description: image
type: string
ContainerQdrouterdConfigImage:
description: The container image to use for the qdrouterd 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
RabbitUserName:
default: guest
description: The username for RabbitMQ
type: string
RabbitPassword:
description: The password for RabbitMQ
type: string
hidden: true
RabbitClientPort:
description: Set rabbit subscriber port, change this if using SSL
default: 5672
type: number
MonitoringSubscriptionQdr:
default: 'overcloud-qdr'
type: string
resources:
ContainersCommon:
type: ../containers-common.yaml
outputs:
role_data:
description: Role data for the qdrouterd service.
value:
service_name: rabbitmq
monitoring_subscription: {get_param: MonitoringSubscriptionQdr}
global_config_settings:
messaging_notify_service_name: 'amqp'
messaging_rpc_service_name: 'amqp'
keystone::messaging::amqp::amqp_pre_settled: 'notify'
config_settings:
tripleo::rabbitmq::firewall_rules:
'109 qdr':
dport:
- {get_param: RabbitClientPort}
qdr::listener_addr:
str_replace:
template:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, QdrNetwork]}
# cannot pass qdr::listener_port directly because it needs to be a string
# we do the conversion in the puppet layer
tripleo::profile::base::qdr::qdr_listener_port: {get_param: RabbitClientPort}
tripleo::profile::base::qdr::qdr_username: {get_param: RabbitUserName}
tripleo::profile::base::qdr::qdr_password: {get_param: RabbitPassword}
service_config_settings: {}
# BEGIN DOCKER SETTINGS
puppet_config:
config_volume: qdrouterd
step_config: |
include ::tripleo::profile::base::qdr
config_image: {get_param: ContainerQdrouterdConfigImage}
kolla_config:
/var/lib/kolla/config_files/qdrouterd.json:
command: /usr/sbin/qdrouterd -c /etc/qpid-dispatch/qdrouterd.conf
config_files:
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"
merge: true
preserve_properties: true
permissions:
- path: /var/lib/qdrouterd
owner: qdrouterd:qdrouterd
recurse: true
docker_config:
step_1:
qdrouterd_init_logs:
start_order: 0
detach: false
image: &qdrouterd_image {get_param: ContainerQdrouterdImage}
net: none
privileged: false
user: root
volumes:
- /var/log/containers/qdrouterd:/var/log/qdrouterd:z
command: ['/bin/bash', '-c', 'chown -R qdrouterd:qdrouterd /var/log/qdrouterd']
qdrouterd:
start_order: 1
image: *qdrouterd_image
net: host
user: qdrouterd
privileged: false
restart: always
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/kolla/config_files/qdrouterd.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/qdrouterd/:/var/lib/kolla/config_files/src:ro
- /var/lib/qdrouterd:/var/lib/qdrouterd:z
- /var/log/containers/qdrouterd:/var/log/qdrouterd:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
host_prep_tasks:
- name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
with_items:
- { 'path': /var/log/containers/qdrouterd, 'setype': svirt_sandbox_file_t }
- { 'path': /var/lib/qdrouterd, 'setype': svirt_sandbox_file_t }
- { 'path': /var/log/qdrouterd, 'setype': svirt_sandbox_file_t }
- name: qrouterd logs readme
copy:
dest: /var/log/qrouterd/readme.txt
content: |
Log files from qrouterd containers can be found under
/var/log/containers/qrouterd.
ignore_errors: true
metadata_settings: {}
post_upgrade_tasks:
- when: step|int == 1
import_role:
name: tripleo-docker-rm
vars:
containers_to_rm:
- qdrouterd
tripleo_container_cli: "docker"