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.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_rally/+/849227

Change-Id: I9cfbf53a66f9488b6cbd22c880fb7e9dc1752ef6
(cherry picked from commit 13b6397285)
This commit is contained in:
Marc Gariepy
2022-07-20 11:13:05 -04:00
committed by Dmitriy Rabotyagov
parent 73d1cad765
commit 18e0bbc63d
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 }}"