Prettier

This commit is contained in:
SebClem 2022-03-04 14:43:35 +01:00
parent 92eed52d35
commit 03bd964f37
No known key found for this signature in database
GPG Key ID: 3D8E353F900B1305
12 changed files with 51 additions and 59 deletions

View File

@ -3,7 +3,6 @@ name: Ansible
on: [push, pull_request]
jobs:
linter:
runs-on: ubuntu-latest
steps:

View File

@ -1,3 +1,7 @@
{
"recommendations": ["redhat.ansible", "dhoeric.ansible-vault", "esbenp.prettier-vscode"]
"recommendations": [
"redhat.ansible",
"dhoeric.ansible-vault",
"esbenp.prettier-vscode"
]
}

View File

@ -1,30 +1,25 @@
Role Name
=========
# Role Name
Deploy and configure [Loki/Promtail](https://github.com/grafana/loki) using Ansible.
Requirements
------------
## Requirements
- Ansible >= 2.9
Example Playbook
------------
## Example Playbook
Install Loki and Promtail in local machine
```yml
- hosts: servers
roles:
- { role: diogenxs.loki, loki_bins: ['loki', 'promtail'] }
- { role: diogenxs.loki, loki_bins: ["loki", "promtail"] }
```
License
-------
## License
WTFPL see [LICENSE](license)
Author Information
------------------
## Author Information
https://diogenxs.dev

View File

@ -1,6 +1,6 @@
---
# loki version to install
loki_version: 'latest'
loki_version: "latest"
# loki bins to install
loki_bins:
@ -19,10 +19,10 @@ loki_listen_address: 127.0.0.1
loki_listen_port: 3100
promtail_listen_address: "{{ loki_listen_address }}"
loki_binary_local_dir: ''
loki_binary_local_dir: ""
loki_target: all
loki_auth_enabled: 'false'
loki_auth_enabled: "false"
loki_server_config:
http_listen_address: "{{ loki_listen_address }}"
http_listen_port: "{{ loki_listen_port }}"
@ -76,7 +76,6 @@ loki_table_manager_config:
retention_deletes_enabled: false
retention_period: 0s
promtail_client_config:
- url: "http://{{ loki_listen_address }}:{{ loki_listen_port }}/loki/api/v1/push"
@ -102,5 +101,4 @@ promtail_target_config: []
promtail_positions_config:
filename: /tmp/positions.yaml
loki_docker_driver: false

View File

@ -1,5 +1,4 @@
---
- name: Install Loki docker driver
community.docker.docker_plugin:
plugin_name: grafana/loki-docker-driver:latest
@ -11,7 +10,6 @@
plugin_name: loki
state: enable
- name: Add docker deamon.json
ansible.builtin.template:
src: daemon.json.j2

View File

@ -79,7 +79,6 @@
loop: "{{ loki_bins }}"
when: _download_archive is changed
- name: Create systemd service unit
template:
src: "{{ item }}.service.j2"
@ -91,13 +90,12 @@
loop: "{{ loki_bins }}"
when: item == 'loki' or item == 'promtail'
- name: Find temps files to del
find:
paths: /tmp
file_type: file
patterns: 'loki-*-linux-{{ go_arch }}.zip,promtail-*-linux-{{ go_arch }}.zip'
excludes: 'loki-{{ loki_version }}-linux-{{ go_arch }}.zip,promtail-{{ loki_version }}-linux-{{ go_arch }}.zip'
patterns: "loki-*-linux-{{ go_arch }}.zip,promtail-*-linux-{{ go_arch }}.zip"
excludes: "loki-{{ loki_version }}-linux-{{ go_arch }}.zip,promtail-{{ loki_version }}-linux-{{ go_arch }}.zip"
register: to_del
- name: Clean temp files

View File

@ -1,9 +1,9 @@
---
go_arch_map:
i386: '386'
x86_64: 'amd64'
aarch64: 'arm64'
armv7l: 'armv7'
armv6l: 'armv6'
i386: "386"
x86_64: "amd64"
aarch64: "arm64"
armv7l: "armv7"
armv6l: "armv6"
go_arch: "{{ go_arch_map[ansible_architecture] | default(ansible_architecture) }}"