✨ Prettier
This commit is contained in:
parent
92eed52d35
commit
03bd964f37
9
.github/workflows/ansible.yml
vendored
9
.github/workflows/ansible.yml
vendored
@ -3,13 +3,12 @@ name: Ansible
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
|
||||
linter:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Lint Ansible Playbook
|
||||
uses: ansible/ansible-lint-action@master
|
||||
- uses: actions/checkout@v2
|
||||
- name: Lint Ansible Playbook
|
||||
uses: ansible/ansible-lint-action@master
|
||||
|
||||
release:
|
||||
needs:
|
||||
@ -19,4 +18,4 @@ jobs:
|
||||
- name: galaxy
|
||||
uses: robertdebock/galaxy-action@1.0.3
|
||||
with:
|
||||
galaxy_api_key: ${{ secrets.galaxy_api_key }}
|
||||
galaxy_api_key: ${{ secrets.galaxy_api_key }}
|
||||
|
6
.vscode/extensions.json
vendored
6
.vscode/extensions.json
vendored
@ -1,3 +1,7 @@
|
||||
{
|
||||
"recommendations": ["redhat.ansible", "dhoeric.ansible-vault", "esbenp.prettier-vscode"]
|
||||
"recommendations": [
|
||||
"redhat.ansible",
|
||||
"dhoeric.ansible-vault",
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
||||
|
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -4,6 +4,6 @@
|
||||
"hosts": "yaml",
|
||||
"*.yml": "ansible"
|
||||
},
|
||||
"ansible.ansible.useFullyQualifiedCollectionNames": true,
|
||||
"editor.formatOnSave": true
|
||||
"ansible.ansible.useFullyQualifiedCollectionNames": true,
|
||||
"editor.formatOnSave": true
|
||||
}
|
||||
|
25
README.md
25
README.md
@ -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
|
||||
- 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'] }
|
||||
- hosts: servers
|
||||
roles:
|
||||
- { role: diogenxs.loki, loki_bins: ["loki", "promtail"] }
|
||||
```
|
||||
|
||||
License
|
||||
-------
|
||||
## License
|
||||
|
||||
WTFPL see [LICENSE](license)
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
## Author Information
|
||||
|
||||
https://diogenxs.dev
|
||||
https://diogenxs.dev
|
||||
|
@ -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 }}"
|
||||
@ -52,18 +52,18 @@ loki_chunk_store_config:
|
||||
|
||||
loki_schema_config:
|
||||
configs:
|
||||
- from: 2020-01-01
|
||||
store: boltdb
|
||||
object_store: filesystem
|
||||
schema: v11
|
||||
index:
|
||||
prefix: index_
|
||||
period: 168h
|
||||
- from: 2020-01-01
|
||||
store: boltdb
|
||||
object_store: filesystem
|
||||
schema: v11
|
||||
index:
|
||||
prefix: index_
|
||||
period: 168h
|
||||
|
||||
chunks:
|
||||
prefix: index_
|
||||
period: 168h
|
||||
row_shards: 16
|
||||
chunks:
|
||||
prefix: index_
|
||||
period: 168h
|
||||
row_shards: 16
|
||||
|
||||
loki_limits_config:
|
||||
enforce_metric_name: false
|
||||
@ -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"
|
||||
|
||||
@ -94,13 +93,12 @@ promtail_scrape_config:
|
||||
host: "{{ ansible_hostname }}"
|
||||
max_age: 12h
|
||||
relabel_configs:
|
||||
- source_labels:
|
||||
- __journal__systemd_unit
|
||||
target_label: unit
|
||||
- source_labels:
|
||||
- __journal__systemd_unit
|
||||
target_label: unit
|
||||
|
||||
promtail_target_config: []
|
||||
promtail_positions_config:
|
||||
filename: /tmp/positions.yaml
|
||||
|
||||
|
||||
loki_docker_driver: false
|
||||
loki_docker_driver: false
|
||||
|
@ -36,4 +36,4 @@
|
||||
- name: Restart Docker
|
||||
ansible.builtin.service:
|
||||
name: docker
|
||||
state: restarted
|
||||
state: restarted
|
||||
|
@ -22,4 +22,4 @@ galaxy_info:
|
||||
- monitoring
|
||||
- grafana
|
||||
- prometheus
|
||||
dependencies: []
|
||||
dependencies: []
|
||||
|
@ -21,4 +21,4 @@
|
||||
mode: 0640
|
||||
notify:
|
||||
- reload promtail
|
||||
when: ('promtail' in loki_bins)
|
||||
when: ('promtail' in loki_bins)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -50,6 +50,6 @@
|
||||
|
||||
- name: Install dnspython
|
||||
pip:
|
||||
name:
|
||||
name:
|
||||
- dnspython
|
||||
- docker
|
||||
- docker
|
||||
|
@ -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) }}"
|
||||
|
Loading…
Reference in New Issue
Block a user