blob: d50e9de411f7e6cd0cf9b829cf6aef63c43b44bf [file] [log] [blame]
{# get cluster.max-op-version #}
{% set max_op_version = salt['cmd.shell']("gluster volume get all cluster.max-op-version 2>/dev/null | awk '/max-op-version/ {print $2}'") %}
{% set current_op_version = salt['cmd.shell']("gluster volume get all cluster.op-version 2>/dev/null | awk '/op-version/ {print $2}'") %}
{# set cluster.op-version #}
{% if max_op_version and current_op_version and max_op_version != current_op_version %}
glusterfs_set_cluster_op_version:
cmd.run:
- name: gluster volume set all cluster.op-version {{ max_op_version }}
- unless: "gluster volume get all cluster.op-version 2>/dev/null | grep -q {{ max_op_version }}"
{% else %}
glusterfs_no_update_op_version:
test.nop
{% endif %}