diff --git a/.gitignore b/.gitignore index 7bb6416..a5bd9d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea/ -secrets.yaml \ No newline at end of file +secrets.yaml +.env \ No newline at end of file diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg new file mode 100644 index 0000000..0626e63 --- /dev/null +++ b/ansible/ansible.cfg @@ -0,0 +1,3 @@ +[defaults] +inventory = inventory +host_key_checking = False \ No newline at end of file diff --git a/ansible/inventory b/ansible/inventory new file mode 100644 index 0000000..e82750b --- /dev/null +++ b/ansible/inventory @@ -0,0 +1,5 @@ +[nextclouds] +cloud.fuku + +[nextclouds:vars] +ansible_user=root \ No newline at end of file diff --git a/ansible/nextcloud/role-promtail.yml b/ansible/nextcloud/role-promtail.yml new file mode 100644 index 0000000..77c506c --- /dev/null +++ b/ansible/nextcloud/role-promtail.yml @@ -0,0 +1,26 @@ +- name: Install promtail + hosts: + - nextclouds + + roles: + - role: patrickjahns.promtail + vars: + promtail_version: 2.9.4 + promtail_config_clients: + - url: https://loki.fuku/loki/api/v1/push + basic_auth: + username: cloud + password: "{{ lookup('env', 'NEXTCLOUD_PROMTAIL_PASSWORD') | mandatory }}" + tls_config: + insecure_skip_verify: true + promtail_config_scrape_configs: + - job_name: system + static_configs: + - targets: + - localhost + labels: + nextcloud: cloud.fukurokuju.dev + __path__: /mnt/share/data/cloud/data/{nextcloud,audit}.log + promtail_config_limits_config: + readline_rate_enabled: true + readline_rate_drop: true \ No newline at end of file diff --git a/ansible/nextcloud/sample.env b/ansible/nextcloud/sample.env new file mode 100644 index 0000000..90a820a --- /dev/null +++ b/ansible/nextcloud/sample.env @@ -0,0 +1 @@ +NEXTCLOUD_PROMTAIL_PASSWORD=superdupersecure \ No newline at end of file diff --git a/ansible/requirements.yml b/ansible/requirements.yml new file mode 100644 index 0000000..a56717c --- /dev/null +++ b/ansible/requirements.yml @@ -0,0 +1,2 @@ +- name: patrickjahns.promtail + version: 1.26.0 \ No newline at end of file