From 77e65a578062d2b755ca2f8bf4cfb12fc968f227 Mon Sep 17 00:00:00 2001 From: Waldek Maleska Date: Wed, 24 Feb 2021 16:03:06 +0000 Subject: [PATCH 1/4] download loki binaries on the target system this has the downside of taking up a bit of space, but at least this makes the role more idempotent when it comes to re-running it from different control nodes (e.g. in CI) --- tasks/install.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 467c5c2..3a83b08 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -49,7 +49,6 @@ retries: 5 delay: 2 loop: "{{ loki_bins }}" - delegate_to: localhost check_mode: false - name: unpack binaries @@ -59,7 +58,6 @@ dest: "/tmp" creates: "/tmp/{{ item }}-{{ loki_version }}-linux-{{ go_arch }}" loop: "{{ loki_bins }}" - delegate_to: localhost check_mode: false - name: propagate official binaries @@ -69,6 +67,7 @@ mode: 0755 owner: root group: root + remote_src: true loop: "{{ loki_bins }}" notify: - restart loki From 59617ff083893a192f31673935b1bcb89a57fcad Mon Sep 17 00:00:00 2001 From: Waldek Maleska Date: Fri, 26 Feb 2021 10:20:17 +0000 Subject: [PATCH 2/4] update download task name --- tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/install.yml b/tasks/install.yml index 3a83b08..d3beb7c 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -38,7 +38,7 @@ - "{{ loki_config_dir }}" - block: - - name: download binaries to local folder + - name: download binaries to a temporary folder become: false get_url: url: "https://github.com/grafana/loki/releases/download/v{{ loki_version }}/{{ item }}-linux-{{ go_arch }}.zip" From b3aa4d20bb921c2c569742c3ae350e5b97642d09 Mon Sep 17 00:00:00 2001 From: Waldek Maleska Date: Fri, 26 Feb 2021 10:45:01 +0000 Subject: [PATCH 3/4] update README with author information --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f32b2a0..5b522c7 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Role Name Deploy and configure [Loki/Promtail](https://github.com/grafana/loki) using Ansible. +This is a fork of a simple and extremely useful diogenxs.loki role. + Requirements ------------ @@ -16,7 +18,9 @@ Install Loki and Promtail in local machine ```yml - hosts: servers roles: - - { role: diogenxs.loki, loki_bins: ['loki', 'promtail'] } + - role: diogenxs.loki + vars: + loki_bins: ['loki', 'promtail'] } ``` License @@ -27,4 +31,6 @@ WTFPL see [LICENSE](license) Author Information ------------------ -https://diogenxs.dev \ No newline at end of file +Fork maintainer: [weakcamel](https://galaxy.ansible.com/weakcamel) + +Original author (all credits due): https://diogenxs.dev From 04511660b93ee9374ba52f1fed42c23d57bf2210 Mon Sep 17 00:00:00 2001 From: Waldek Maleska Date: Fri, 26 Feb 2021 11:00:13 +0000 Subject: [PATCH 4/4] update to Github Actions to release --- .github/workflows/ansible.yml | 22 ---------------------- .github/workflows/lint.yml | 15 +++++++++++++++ .github/workflows/publish.yml | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/ansible.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/ansible.yml b/.github/workflows/ansible.yml deleted file mode 100644 index edcef52..0000000 --- a/.github/workflows/ansible.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Ansible - -on: [push, pull_request] - -jobs: - - linter: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Lint Ansible Playbook - uses: ansible/ansible-lint-action@master - - release: - needs: - - linter - runs-on: ubuntu-latest - steps: - - name: galaxy - uses: robertdebock/galaxy-action@1.0.3 - with: - galaxy_api_key: ${{ secrets.galaxy_api_key }} \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..b343972 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,15 @@ +--- +name: Lint + +"on": + - push + - pull_request + +jobs: + + linter: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Lint Ansible Playbook + uses: ansible/ansible-lint-action@master diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..249c448 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,15 @@ +--- +name: Publish to Galaxy + +"on": + release: + types: [created] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: galaxy + uses: robertdebock/galaxy-action@1.1.0 + with: + galaxy_api_key: ${{ secrets.galaxy_api_key }}