From ad95ac04e2725cea4cbd1660f0faf412788bf79d Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Mon, 17 May 2021 17:38:48 +0200 Subject: [PATCH] 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 --- .../clustercheck-container-puppet.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/deployment/pacemaker/clustercheck-container-puppet.yaml b/deployment/pacemaker/clustercheck-container-puppet.yaml index a10f4984f1..13c11acb89 100644 --- a/deployment/pacemaker/clustercheck-container-puppet.yaml +++ b/deployment/pacemaker/clustercheck-container-puppet.yaml @@ -35,6 +35,12 @@ parameters: default: {} description: Parameters specific to the role type: json + ClustercheckListener: + default: 'socat' + description: How to expose the clustercheck service over TCP + type: string + constraints: + - allowed_values: ['socat', 'xinetd'] resources: @@ -50,6 +56,9 @@ resources: RoleName: {get_param: RoleName} RoleParameters: {get_param: RoleParameters} +conditions: + socat_listener: {equals: [{get_param: ClustercheckListener}, 'socat']} + outputs: role_data: description: Containerized service clustercheck using composable services. @@ -61,8 +70,9 @@ outputs: - tripleo::profile::pacemaker::clustercheck::bind_address: str_replace: template: - "%{hiera('fqdn_$NETWORK')}" + "%{hiera('$FQDN$NETWORK')}" params: + $FQDN: {if: ["socat_listener", "", "fqdn_"]} $NETWORK: {get_param: [ServiceNetMap, MysqlNetwork]} # BEGIN DOCKER SETTINGS # puppet_config: @@ -72,7 +82,12 @@ outputs: config_image: {get_param: ContainerClustercheckConfigImage} kolla_config: /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: - source: "/var/lib/kolla/config_files/src/*" dest: "/"