diff --git a/tasks/consul.yml b/tasks/consul.yml index d160087..0b283c8 100644 --- a/tasks/consul.yml +++ b/tasks/consul.yml @@ -50,6 +50,11 @@ consul_download_uri: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_darwin_amd64.zip" when: mac_intel + - name: "set variable: Set Consul download Binary (MacOSX)" + ansible.builtin.set_fact: + consul_download_uri: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_darwin_arm64.zip" + when: mac_arm + - name: Assert that we can install Consul ansible.builtin.assert: that: @@ -227,7 +232,7 @@ - not consul_binary_file_location.stat.exists - name: Check current version of Consul - ansible.builtin.command: + ansible.builtin.shell: cmd: /usr/local/bin/consul --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' ignore_errors: true changed_when: false @@ -243,7 +248,7 @@ when: - consul_download_uri is defined - not need_consul_install - - installed_consul_version.stdout != consul_version + - installed_consul_version.stdout is version(consul_version, '<') - name: install Consul become: true diff --git a/tasks/nomad.yml b/tasks/nomad.yml index cf653e4..817e53a 100644 --- a/tasks/nomad.yml +++ b/tasks/nomad.yml @@ -162,7 +162,7 @@ - name: Install or Update Nomad block: - name: "set fact: do we need a nomad install?" - set_fact: + ansible.builtin.set_fact: need_nomad_install: false - name: Check if nomad is installed @@ -171,7 +171,7 @@ register: nomad_binary_file_location - name: "set fact: do we need a nomad install" - set_fact: + ansible.builtin.set_fact: need_nomad_install: true when: - not nomad_binary_file_location.stat.exists @@ -186,15 +186,15 @@ - not need_nomad_install - name: "set fact: do we need a nomad install" - set_fact: + ansible.builtin.set_fact: need_nomad_install: true when: - not need_nomad_install - - current_nomad_version.stdout != nomad_version + - current_nomad_version.stdout is version(nomad_version, '<') - name: install Nomad become: true - unarchive: + ansible.builtin.unarchive: src: "{{ nomad_download_file_uri }}" dest: /usr/local/bin remote_src: true