main.yml 581 Bytes
Newer Older
1
2
3
---

- name: install rsyslog
4
  yum: name=rsyslog state=present
5
6
7
8
9
  become: true
  become_user: root
  when: ansible_os_family == 'RedHat'

- name: install rsyslog
10
  apt: name=rsyslog state=present
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  become: true
  become_user: root
  when: ansible_os_family == 'Debian'

- name: install rsyslogd.conf
  template: src=rsyslog.conf.j2 dest=/etc/rsyslog.conf owner=root group=root mode=644
  become: true
  become_user: root
  register: config_changed

- name: restart rsyslog
  service: name=rsyslog state=restarted
  become: true
  become_user: root
Trung Nguyen's avatar
Trung Nguyen committed
25
  when: config_changed is changed