Add roles for lego, logcli, mimir, process_exporter, smokeping_prober, and vector
This commit is contained in:
11
roles/logcli/tasks/configure.yaml
Normal file
11
roles/logcli/tasks/configure.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: set logcli environment variables
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ logcli_profile_d_path }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
content: |
|
||||
{% for k, v in logcli_profile_d_env.items() %}
|
||||
export {{ k }}="{{ v }}"
|
||||
{% endfor %}
|
0
roles/logcli/tasks/default.yaml
Normal file
0
roles/logcli/tasks/default.yaml
Normal file
56
roles/logcli/tasks/install.yaml
Normal file
56
roles/logcli/tasks/install.yaml
Normal file
@ -0,0 +1,56 @@
|
||||
---
|
||||
- name: determine install status
|
||||
ansible.builtin.stat:
|
||||
path: "{{ logcli_opt_path }}/logcli"
|
||||
register: st
|
||||
|
||||
- name: create opt path
|
||||
ansible.builtin.file:
|
||||
path: "{{ logcli_opt_path }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
state: directory
|
||||
|
||||
- block:
|
||||
- name: download
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ logcli_release_url }}"
|
||||
dest: "{{ logcli_download_path }}"
|
||||
checksum: "{{ logcli_checksums[logcli_release_file] }}"
|
||||
register: dl
|
||||
until: dl is success
|
||||
retries: 5
|
||||
delay: 10
|
||||
|
||||
- name: extract
|
||||
ansible.builtin.unarchive:
|
||||
src: "{{ logcli_download_path }}"
|
||||
dest: "{{ logcli_unarchive_dest_path }}"
|
||||
remote_src: true
|
||||
|
||||
- name: install
|
||||
ansible.builtin.copy:
|
||||
src: "{{ logcli_extracted_path }}"
|
||||
dest: "{{ logcli_opt_path }}/{{ item }}"
|
||||
remote_src: true
|
||||
loop: "{{ logcli_binaries }}"
|
||||
when: not st.stat.exists
|
||||
|
||||
- name: permissions
|
||||
ansible.builtin.file:
|
||||
path: "{{ logcli_opt_path }}/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
loop: "{{ logcli_binaries }}"
|
||||
|
||||
- name: symlink
|
||||
ansible.builtin.file:
|
||||
src: "{{ logcli_opt_path }}/{{ item }}"
|
||||
dest: "/usr/local/bin/{{ item }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
state: link
|
||||
loop: "{{ logcli_binaries }}"
|
28
roles/logcli/tasks/main.yaml
Normal file
28
roles/logcli/tasks/main.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: gather os specific variables
|
||||
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
paths:
|
||||
- vars
|
||||
|
||||
- name: include os specific tasks
|
||||
ansible.builtin.include_tasks: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yaml"
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
paths:
|
||||
- tasks
|
||||
|
||||
- ansible.builtin.include_tasks: install.yaml
|
||||
|
||||
- ansible.builtin.include_tasks: configure.yaml
|
Reference in New Issue
Block a user