docs: rewrite README with structured overview and quick start guide
Replaces the minimal project description with a comprehensive README including a component overview table, quick start instructions, common Ansible operations, and links to detailed documentation. Aligns with Red Panda Approval™ standards.
This commit is contained in:
89
ansible/loki/deploy.yml
Normal file
89
ansible/loki/deploy.yml
Normal file
@@ -0,0 +1,89 @@
|
||||
---
|
||||
- name: Deploy Loki to Prospero
|
||||
hosts: ubuntu
|
||||
become: true
|
||||
tasks:
|
||||
- name: Check if host has loki service
|
||||
ansible.builtin.set_fact:
|
||||
has_loki_service: "{{'loki' in services}}"
|
||||
|
||||
- name: Skip hosts without loki service
|
||||
ansible.builtin.meta: end_host
|
||||
when: not has_loki_service
|
||||
|
||||
- name: Add Grafana repository
|
||||
ansible.builtin.deb822_repository:
|
||||
name: grafana
|
||||
types: [deb]
|
||||
uris: https://apt.grafana.com
|
||||
suites: [stable]
|
||||
components: [main]
|
||||
signed_by: https://apt.grafana.com/gpg.key
|
||||
state: present
|
||||
|
||||
- name: Install Loki
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- loki
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Create loki group
|
||||
become: true
|
||||
ansible.builtin.group:
|
||||
name: "{{loki_group}}"
|
||||
|
||||
- name: Create loki user
|
||||
become: true
|
||||
ansible.builtin.user:
|
||||
name: "{{loki_user}}"
|
||||
comment: "{{loki_user}}"
|
||||
group: "{{loki_group}}"
|
||||
system: true
|
||||
|
||||
- name: Add group loki to ansible_user
|
||||
become: true
|
||||
ansible.builtin.user:
|
||||
name: "{{ansible_user}}"
|
||||
groups: "{{loki_group}}"
|
||||
append: true
|
||||
|
||||
- name: Create loki directories
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "{{item}}"
|
||||
owner: "{{loki_user}}"
|
||||
group: "{{loki_group}}"
|
||||
state: directory
|
||||
mode: '750'
|
||||
loop:
|
||||
- "{{loki_data_dir}}"
|
||||
- "{{loki_config_dir}}"
|
||||
|
||||
- name: Template Loki configuration
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: "{{loki_config_file}}.j2"
|
||||
dest: "{{loki_config_dir}}/{{loki_config_file}}"
|
||||
owner: "{{loki_user}}"
|
||||
group: "{{loki_group}}"
|
||||
mode: '550'
|
||||
notify: restart loki
|
||||
|
||||
- name: Reset SSH connection to apply group changes
|
||||
meta: reset_connection
|
||||
|
||||
- name: Enable and start Loki service
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: loki
|
||||
enabled: true
|
||||
state: started
|
||||
|
||||
handlers:
|
||||
- name: restart loki
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: loki
|
||||
state: restarted
|
||||
Reference in New Issue
Block a user