Fix gluster play_hosts

If using the last play host we cannot grow the cluster since the
`gluster peer probe` command needs to be executed on a running node.

Change-Id: I9cfbf53a66f9488b6cbd22c880fb7e9dc1752ef6
This commit is contained in:
Marc Gariepy 2022-07-20 11:13:05 -04:00
parent d8d6391b03
commit 13b6397285
2 changed files with 3 additions and 3 deletions

View File

@ -111,7 +111,7 @@
- name: Create gluster peers
gluster.gluster.gluster_peer:
nodes: "{{ glusterfs_server_cluster_members }}"
when: _glusterfs_is_last_play_host
when: _glusterfs_is_first_play_host
- name: Ensure glusterfs backing directory exists
file:
@ -151,5 +151,5 @@
replicas: "{{ cluster_has_replicas | ternary(num_cluster_members, omit) }}"
cluster: "{{ glusterfs_server_cluster_members | map('regex_replace', '_', '-') | list }}"
force: true
when: _glusterfs_is_last_play_host
when: _glusterfs_is_first_play_host

View File

@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
_glusterfs_is_last_play_host: "{{ (inventory_hostname == (ansible_play_hosts | last)) | bool }}"
_glusterfs_is_first_play_host: "{{ (inventory_hostname == (ansible_play_hosts | first)) | bool }}"