To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

main.yml 1.02 KB
Newer Older
Bengt Giger's avatar
Bengt Giger committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
# - name: Get OS specific variables
#   include_vars: "{{ ansible_distribution | lower }}.yml"

- name: Update apt cache
  apt:
    update_cache: true
  when: ansible_distribution | lower == "debian" or ansible_distribution | lower == "ubuntu"
  changed_when: false

- name: Ensure rsyslog is installed
  package:
    name: rsyslog
    state: latest
  notify: restart rsyslog

- name: Ensure rsyslog.d directory exists
  file:
    name: /etc/rsyslog.d
    state: directory
21
    mode: "0755"
Bengt Giger's avatar
Bengt Giger committed
22
23
24
25
26
27
28
29
30
31
32

- name: Ensure rsyslogd is running and enabled
  service:
    name: rsyslog
    enabled: true
    state: started

- name: Configure local logging
  template:
    src: rsyslog_local.conf.j2
    dest: /etc/rsyslog.d/rsyslog_local.conf
33
34
    mode: "0644"
  when: rsyslog_local_targets_active
Bengt Giger's avatar
Bengt Giger committed
35
36
37
38
39
40
  notify: restart rsyslog

- name: Remote logging
  template:
    src: rsyslog_remote.conf.j2
    dest: "/etc/rsyslog.d/{{ target.name }}.conf"
41
    mode: "0644"
Bengt Giger's avatar
Bengt Giger committed
42
43
44
45
  loop: "{{ rsyslog_remote_targets }}"
  loop_control:
    loop_var: target
  notify: restart rsyslog