From 8432aea690eeda2ea59eaac434c817142e3355e8 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 25 Dec 2017 02:16:26 +0100 Subject: [PATCH] Switch to different repo, improve installation Signed-off-by: Knut Ahlers --- defaults/main.yml | 2 ++ tasks/main.yml | 20 +++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index ecb3037..695e583 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,4 +3,6 @@ instance_status_apt_required: [] instance_status_checks: {} +instance_status_version: v0.5.2 + ... diff --git a/tasks/main.yml b/tasks/main.yml index f1065ce..928aa52 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,19 +11,17 @@ dest: /etc/elb-instance-status.yml register: instance_status_config +- name: Get current elb-instance-status version + command: /usr/local/bin/elb-instance-status --version + register: instance_status_version_cmd + - name: Download elb-instance-status release get_url: - url: https://github.com/Jimdo/elb-instance-status/releases/download/v0.5.1/elb-instance-status_linux_amd64 - dest: /usr/local/bin/elb-instance-status_v0.5.1 - sha256sum: 3ce2fa44296e2ff5b2cca2e9b2348bbd49884eadfe66389ec6d201f5e71650c0 - mode: 0755 - -- name: Link elb-instance-status - file: + url: 'https://github.com/Luzifer/elb-instance-status/releases/download/{{ instance_status_version }}/elb-instance-status_linux_amd64' dest: /usr/local/bin/elb-instance-status - src: /usr/local/bin/elb-instance-status_v0.5.1 - state: link - register: instance_status_link + mode: 0755 + when: instance_status_version not in instance_status_version_cmd.output + register: instance_status_binary - name: Install system.d service copy: @@ -53,4 +51,4 @@ name: elb-instance-status state: restarted enabled: yes - when: instance_status_config.changed or instance_status_service.changed or instance_status_service.changed + when: instance_status_config.changed or instance_status_binary.changed or instance_status_service.changed