diff --git a/README.md b/README.md index bb97b8f0..f400f49b 100644 --- a/README.md +++ b/README.md @@ -234,8 +234,10 @@ The role defines most of its variables in `defaults/main.yml`: ### `nomad_raft_protocol` -- Specifies the version of raft protocal, which used by nomad servers for communication -- Default value: **2** +- Specifies the version of raft protocol, which used by nomad servers for communication +- Default value: + - Nomad versions < 1.3.0: 2 + - Nomad versions => 1.3.0: 3 ### `nomad_authoritative_region` diff --git a/defaults/main.yml b/defaults/main.yml index 94de4e5f..c4007736 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -98,7 +98,12 @@ nomad_job_gc_threshold: "4h" nomad_eval_gc_threshold: "1h" nomad_deployment_gc_threshold: "1h" nomad_encrypt_enable: "{{ lookup('env','NOMAD_ENCRYPT_ENABLE') | default('false', true) }}" -nomad_raft_protocol: 2 +nomad_raft_protocol: "\ + {% if nomad_version is version_compare('1.3.0', '<') %}\ + 2\ + {% else %}\ + 3\ + {% endif %}" #### Client settings nomad_node_class: ""