mirror of
https://github.com/prometheus-community/ansible
synced 2024-11-26 05:40:18 +00:00
32d15d4361
Signed-off-by: Mark Tomich <tomichms@nih.gov>
69 lines
2.4 KiB
YAML
69 lines
2.4 KiB
YAML
---
|
|
- name: Create the smokeping_prober group
|
|
ansible.builtin.group:
|
|
name: "{{ smokeping_prober_system_group }}"
|
|
state: present
|
|
system: true
|
|
when: smokeping_prober_system_group != "root"
|
|
|
|
- name: Create the smokeping_prober user
|
|
ansible.builtin.user:
|
|
name: "{{ smokeping_prober_system_user }}"
|
|
groups: "{{ smokeping_prober_system_group }}"
|
|
append: true
|
|
shell: /usr/sbin/nologin
|
|
system: true
|
|
create_home: false
|
|
home: /
|
|
when: smokeping_prober_system_user != "root"
|
|
|
|
- name: Get binary
|
|
when:
|
|
- smokeping_prober_binary_local_dir | length == 0
|
|
- not smokeping_prober_skip_install
|
|
block:
|
|
|
|
- name: Download smokeping_prober binary to local folder
|
|
become: false
|
|
ansible.builtin.get_url:
|
|
url: "{{ smokeping_prober_binary_url }}"
|
|
dest: "{{ smokeping_archive_path }}/smokeping_prober-{{ smokeping_prober_version }}.linux-{{ go_arch }}.tar.gz"
|
|
checksum: "sha256:{{ __smokeping_prober_checksum }}"
|
|
mode: '0644'
|
|
register: _download_binary
|
|
until: _download_binary is succeeded
|
|
retries: 5
|
|
delay: 2
|
|
delegate_to: localhost
|
|
check_mode: false
|
|
|
|
- name: Unpack smokeping_prober binary
|
|
become: false
|
|
ansible.builtin.unarchive:
|
|
src: "{{ smokeping_archive_path }}/smokeping_prober-{{ smokeping_prober_version }}.linux-{{ go_arch }}.tar.gz"
|
|
dest: "{{ smokeping_archive_path }}"
|
|
creates: "{{ smokeping_archive_path }}/smokeping_prober-{{ smokeping_prober_version }}.linux-{{ go_arch }}/smokeping_prober"
|
|
delegate_to: localhost
|
|
check_mode: false
|
|
|
|
- name: Propagate smokeping_prober binaries
|
|
ansible.builtin.copy:
|
|
src: "{{ smokeping_archive_path }}/smokeping_prober-{{ smokeping_prober_version }}.linux-{{ go_arch }}/smokeping_prober"
|
|
dest: "{{ smokeping_prober_binary_install_dir }}/smokeping_prober"
|
|
mode: 0755
|
|
owner: root
|
|
group: root
|
|
notify: restart smokeping_prober
|
|
when: not ansible_check_mode
|
|
|
|
- name: Propagate locally distributed smokeping_prober binary
|
|
ansible.builtin.copy:
|
|
src: "{{ smokeping_prober_binary_local_dir }}/smokeping_prober"
|
|
dest: "{{ smokeping_prober_binary_install_dir }}/smokeping_prober"
|
|
mode: 0755
|
|
owner: root
|
|
group: root
|
|
when:
|
|
- smokeping_prober_binary_local_dir | length > 0
|
|
- not smokeping_prober_skip_install
|
|
notify: restart smokeping_prober
|