Closed rhmk closed 1 year ago
The solution approach would be to introduce the following variables:
sap_hana_preconfigure_primary_host: host1
sap_hana_preconfigure_add_hosts:
- hana2:role=worker
- hana3:role=worker
- hana4:role=standby
The variables are defined as unset/empty in the defaults/main.yml
compile the add_host variable back in an additional parameter
--add_hosts="hana2:role=worker,hana3:role=worker,hana4:role=standby"
In the role then following decisions can be executed like this
run a module when: sap_hana_preconfigure_primary host == sap_hostname or sap_hana_preconfigure_primary_host is unset
CAUTION: We cannot cover a cluster extension or exchange of a broken node with that
Another possible option would be to create the inventory with role variables:
[my_hana_cluster]
hana1 scaleout_role=primary
hana2 scaleout_role=worker
hana3 scaleout_role=worker
hana4 scaleout_role=standby
then it could be easier to extend if possible, the when statement to execute install is:
when scaleout_role is undefined or scaleout_role == "primary"
Drawback: it is more difficult to compile the add_hosts parameter: You get the names of the group, but maybe not of particular variables
Hi @rhmk - Would the solution I proposed in https://github.com/berndfinger/sap-hana-deployment/commit/c5ec9616544f42009d4547feac40693502844e74 solve this problem? You just would have to provide a supported argument to the --addhosts parameter, which then would be copied as it is into the configfile.
The goal is to deploy Hana scaleout with the same role. The difference is one parameter:
--add_hosts="hana2:role=worker,hana3:role=worker,hana4:role=standby"
It would be nice if we can define the complete cluster name
my_hana_cluster
in one file ingroup_vars/my_hana_cluster
and the inventory looks like