From 2458c29cfc0c556c2267ea7fa5c438b3cfd6818a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=A4b?= <alexander.kaeb@h-da.de> Date: Wed, 1 Mar 2023 15:52:09 +0100 Subject: [PATCH] Change to download the repository file to localhost first --- tasks/main.yml | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 9fd895d..a72b514 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -12,24 +12,48 @@ when: ansible_os_family == 'Debian' become: true block: - - name: Download repository file + - name: Download repository file (Debian | Ubuntu) ansible.builtin.get_url: url: "{{ sidecar_repo_urls['Debian'] }}" dest: /tmp/graylog-sidecar-repository.deb mode: 0644 + delegate_to: localhost + run_once: true - - name: Add repository using dpkg + - name: Copy DEB to nodes (Debian | Ubuntu) + ansible.builtin.copy: + src: /tmp/graylog-sidecar-repository.deb + dest: /tmp/graylog-sidecar-repository.deb + mode: 0644 + + - name: Add repository using dpkg (Debian | Ubuntu) ansible.builtin.command: cmd: dpkg -i /tmp/graylog-sidecar-repository.deb changed_when: false - name: Add sidecar repo (RedHat) - ansible.builtin.yum: - name: "{{ sidecar_repo_urls['RedHat'] }}" - state: present - disable_gpg_check: true # Here, we are installing the package that contains the gpg key when: ansible_os_family == 'RedHat' become: true + block: + - name: Download rpm file (RedHat) + ansible.builtin.get_url: + url: "{{ sidecar_repo_urls['RedHat'] }}" + dest: /tmp/graylog-sidecar-repository.rpm + mode: 0644 + delegate_to: localhost + run_once: true + + - name: Copy RPM to nodes (RedHat) + ansible.builtin.copy: + src: /tmp/graylog-sidecar-repository.rpm + dest: /tmp/graylog-sidecar-repository.rpm + mode: 0644 + + - name: Install rpm (RedHat) + ansible.builtin.yum: + name: /tmp/graylog-sidecar-repository.rpm + state: present + disable_gpg_check: true # Here, we are installing the package that contains the gpg key - name: Install sidecar package ansible.builtin.package: -- GitLab