tripleo-heat-templates/deployment/deprecated/keepalived/keepalived-container-puppet...

154 lines
5.3 KiB
YAML

heat_template_version: wallaby
description: >
DEPRECATED - OpenStack containerized Keepalived service
parameters:
ContainerKeepalivedImage:
description: image
type: string
ContainerKeepalivedConfigImage:
description: The container image to use for the keepalived 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
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
ControlVirtualInterface:
default: ''
description: >
Interface where virtual ip will be assigned. This value will be
automatically set by the deployment tool. Overriding here will
override automatic setting.
type: string
PublicVirtualInterface:
default: ''
description: >
Interface where virtual ip will be assigned. This value will be
automatically set by the deployment tool. Overriding here will
override automatic setting.
type: string
MonitoringSubscriptionKeepalived:
default: 'overcloud-keepalived'
type: string
# DEPRECATED: the following options are deprecated and are currently maintained
# for backwards compatibility. They will be removed in future release.
KeepalivedRestart:
default: false
description: Whether or not restart Keepalived. Deprecated and no effect.
type: boolean
parameter_groups:
- label: deprecated
description: |
The following parameters are deprecated and will be removed. They should not
be relied on for new deployments. If you have concerns regarding deprecated
parameters, please contact the TripleO development team on IRC or the
OpenStack mailing list.
parameters:
- KeepalivedRestart
conditions:
control_iface_empty: {equals : [{get_param: ControlVirtualInterface}, '']}
public_iface_empty: {equals : [{get_param: PublicVirtualInterface}, '']}
resources:
ContainersCommon:
type: ../../containers-common.yaml
outputs:
role_data:
description: Role data for the Keepalived role.
value:
service_name: keepalived
firewall_rules:
'106 keepalived vrrp':
proto: vrrp
monitoring_subscription: {get_param: MonitoringSubscriptionKeepalived}
config_settings:
map_merge:
- tripleo::keepalived:custom_vrrp_script: 'test -S /var/lib/haproxy/stats && echo "show info" | socat /var/lib/haproxy/stats stdio'
-
if:
- control_iface_empty
- {}
- tripleo::keepalived::control_virtual_interface: {get_param: ControlVirtualInterface}
-
if:
- public_iface_empty
- {}
- tripleo::keepalived::public_virtual_interface: {get_param: PublicVirtualInterface}
service_config_settings: {}
# BEGIN DOCKER SETTINGS
puppet_config:
config_volume: 'keepalived'
puppet_tags: 'file'
step_config: |
include tripleo::profile::base::keepalived
config_image: {get_param: ContainerKeepalivedConfigImage}
kolla_config:
/var/lib/kolla/config_files/keepalived.json:
command: "/bin/bash -c $* -- eval exec /usr/sbin/keepalived -nldD &>>/var/log/keepalived.log"
config_files:
- source: "/var/lib/kolla/config_files/src/*"
dest: "/"
merge: true
preserve_properties: true
docker_config:
step_1:
keepalived:
start_order: 0
image: {get_param: ContainerKeepalivedImage}
net: host
privileged: true
restart: always
# FIXME: needs to be added to the container first
#healthcheck:
#test: /openstack/healthcheck
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/kolla/config_files/keepalived.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/keepalived:/var/lib/kolla/config_files/src:ro
- /var/log/containers/keepalived/:/var/log/:z
- /lib/modules/:/lib/modules/:ro
- /var/lib/haproxy/:/var/lib/haproxy/:z
environment:
KOLLA_CONFIG_STRATEGY: COPY_ALWAYS
command: /usr/local/bin/kolla_start
host_prep_tasks:
- name: load ip_vs module
import_role:
name: tripleo_module_load
vars:
modules:
- name: ip_vs
- name: create persistent directories
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
mode: "{{ item.mode }}"
with_items:
- { 'path': /var/log/containers/keepalived, 'setype': container_file_t, 'mode': '0750' }