Make clustercheck service accessible over socat

Allow clustercheck to be started on-demand by socat in addition
to xinetd. Make socat the new default as xinetd will get deprecated
eventually.

Depends-On: Ie7ede82a755e729d66e077f97e87b3d6c816ed3c
Change-Id: I7d87b5861a576cf4849a25cd1d3f5e77568de1e4
Closes-Bug: #1928693
This commit is contained in:
Damien Ciabrini 2021-05-17 17:38:48 +02:00
parent ba1d7b2768
commit d6c2740a8f
1 changed files with 17 additions and 2 deletions

View File

@ -35,6 +35,12 @@ parameters:
default: {} default: {}
description: Parameters specific to the role description: Parameters specific to the role
type: json type: json
ClustercheckListener:
default: 'socat'
description: How to expose the clustercheck service over TCP
type: string
constraints:
- allowed_values: ['socat', 'xinetd']
resources: resources:
@ -50,6 +56,9 @@ resources:
RoleName: {get_param: RoleName} RoleName: {get_param: RoleName}
RoleParameters: {get_param: RoleParameters} RoleParameters: {get_param: RoleParameters}
conditions:
socat_listener: {equals: [{get_param: ClustercheckListener}, 'socat']}
outputs: outputs:
role_data: role_data:
description: Containerized service clustercheck using composable services. description: Containerized service clustercheck using composable services.
@ -61,8 +70,9 @@ outputs:
- tripleo::profile::pacemaker::clustercheck::bind_address: - tripleo::profile::pacemaker::clustercheck::bind_address:
str_replace: str_replace:
template: template:
"%{hiera('fqdn_$NETWORK')}" "%{hiera('$FQDN$NETWORK')}"
params: params:
$FQDN: {if: ["socat_listener", "", "fqdn_"]}
$NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]} $NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]}
# BEGIN DOCKER SETTINGS # # BEGIN DOCKER SETTINGS #
puppet_config: puppet_config:
@ -72,7 +82,12 @@ outputs:
config_image: {get_param: ContainerClustercheckConfigImage} config_image: {get_param: ContainerClustercheckConfigImage}
kolla_config: kolla_config:
/var/lib/kolla/config_files/clustercheck.json: /var/lib/kolla/config_files/clustercheck.json:
command: /usr/sbin/xinetd -dontfork command:
if:
- socat_listener
# Note: we can't quotes multiple parameters in kolla command, hence the workaround
- bash -c $* -- eval source /etc/sysconfig/clustercheck; exec socat "$TRIPLEO_SOCAT_BIND" exec:/usr/bin/clustercheck,nofork
- /usr/sbin/xinetd -dontfork
config_files: config_files:
- source: "/var/lib/kolla/config_files/src/*" - source: "/var/lib/kolla/config_files/src/*"
dest: "/" dest: "/"