In the /etc/clustershell/groups.conf
file I like to put the following definitions:
[mygroup]
map: sed -n '1,/$GROUP/d;/\[/,$d;/^$/d;p' /etc/clustershell/groups.conf.d/mygroup_poc_cluster.hosts | awk '{print $1}'
all: grep -v "^\[" /etc/clustershell/groups.conf.d/mygroup_poc_cluster.hosts | grep -v ^$
list: grep "^\[" /etc/clustershell/groups.conf.d/mygroup_poc_cluster.hosts | sed -e "s/\[//" -e "s/\]//"
The cluster.hosts
file is generated from the mapr-ansible-roles and looks like this: