You've already forked ansible-role-rsyslog
Update project - add molecule
This commit is contained in:
@@ -17,7 +17,9 @@
|
||||
- default.yml
|
||||
|
||||
- include: main_rh.yml
|
||||
when: ansible_os_family == 'RedHat'
|
||||
when: >
|
||||
ansible_os_family == 'RedHat' or
|
||||
ansible_os_family == 'Rocky'
|
||||
|
||||
- include: main_deb.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
@@ -37,7 +39,7 @@
|
||||
mode={{ rsyslog_file_mode }}
|
||||
notify:
|
||||
- restart rsyslog
|
||||
when: rsyslog_os_supported == True
|
||||
when: rsyslog_os_supported
|
||||
|
||||
- name: remove existing (custom/additional) configurations
|
||||
tags:
|
||||
@@ -46,7 +48,7 @@
|
||||
file:
|
||||
state: absent
|
||||
path: "{{ rsyslog_include_path }}/"
|
||||
when: purge_config == True
|
||||
when: purge_config
|
||||
|
||||
- name: create additional configuration directory
|
||||
tags:
|
||||
@@ -58,7 +60,7 @@
|
||||
group={{ rsyslog_file_group }}
|
||||
mode={{ rsyslog_file_mode }}
|
||||
state=directory
|
||||
when: rsyslog_os_supported == True
|
||||
when: rsyslog_os_supported
|
||||
|
||||
- name: setup default additional configuration
|
||||
tags:
|
||||
@@ -66,7 +68,7 @@
|
||||
- files
|
||||
template: >
|
||||
src=rsyslog.snippet.conf.j2
|
||||
dest={{ rsyslog_include_path }}/{{item.name}}.conf
|
||||
dest={{ rsyslog_include_path }}/{{ item.name }}.conf
|
||||
owner={{ rsyslog_file_owner }}
|
||||
group={{ rsyslog_file_group }}
|
||||
mode={{ rsyslog_file_mode }}
|
||||
@@ -85,7 +87,9 @@
|
||||
- '*.* /var/log/uncategorized.log'
|
||||
notify:
|
||||
- restart rsyslog
|
||||
when: rsyslog_default_config == "True" and rsyslog_os_supported == True
|
||||
when: >
|
||||
rsyslog_default_config and
|
||||
rsyslog_os_supported
|
||||
|
||||
- name: setup additional configurations
|
||||
tags:
|
||||
@@ -93,7 +97,7 @@
|
||||
- files
|
||||
template: >
|
||||
src=rsyslog.snippet.conf.j2
|
||||
dest={{ rsyslog_include_path }}/{{item.name}}.conf
|
||||
dest={{ rsyslog_include_path }}/{{ item.name }}.conf
|
||||
owner={{ rsyslog_file_owner }}
|
||||
group={{ rsyslog_file_group }}
|
||||
mode={{ rsyslog_file_mode }}
|
||||
@@ -101,7 +105,7 @@
|
||||
- "{{ items }}"
|
||||
notify:
|
||||
- restart rsyslog
|
||||
when: rsyslog_os_supported == True
|
||||
when: rsyslog_os_supported
|
||||
|
||||
- name: Reload systemd
|
||||
systemd:
|
||||
@@ -112,5 +116,4 @@
|
||||
- rsyslog
|
||||
- configuration
|
||||
service: name={{ rsyslog_service_name }} enabled=yes state=started
|
||||
when: rsyslog_os_supported == True
|
||||
|
||||
when: rsyslog_os_supported
|
||||
|
||||
@@ -7,5 +7,7 @@
|
||||
tags:
|
||||
- rsyslog
|
||||
- packages
|
||||
pacman: pkg={{item}} state=installed
|
||||
pacman:
|
||||
pkg: '{{ rsyslog_package_names }}'
|
||||
state: installed
|
||||
with_items: '{{ rsyslog_package_names }}'
|
||||
@@ -3,23 +3,29 @@
|
||||
|
||||
- name: Import Adiscon rsyslog Key for apt
|
||||
apt_key: keyserver=keys.gnupg.net id=AEF0CF8E state=present
|
||||
when: use_repo == True and ansible_distribution == 'Debian'
|
||||
when: >
|
||||
use_repo and
|
||||
ansible_distribution == 'Debian'
|
||||
|
||||
## TODO: v8-stable for debian wheezy only available at this time, sanitize selection
|
||||
## http://www.rsyslog.com/debian-repository/
|
||||
- name: Enable Adiscon rsyslog apt repo
|
||||
apt_repository: repo='deb http://debian.adiscon.com/v8-stable wheezy/' state=present filename='rsyslog' update_cache='yes'
|
||||
when: use_repo == True and ansible_distribution == 'Debian'
|
||||
when: >
|
||||
use_repo and
|
||||
ansible_distribution == 'Debian'
|
||||
|
||||
## TODO: v8-stable/v7-stable available, for "ubuntu versions not yet reached end of life".. sanitize selection
|
||||
## http://www.rsyslog.com/ubuntu-repository/
|
||||
- name: Enable Adiscon rsyslog apt repo
|
||||
apt_repository: repo='ppa:adiscon/v{{ repo_releasever }}-stable'
|
||||
when: use_repo == True and ansible_distribution == 'Ubuntu'
|
||||
when: >
|
||||
use_repo and
|
||||
ansible_distribution == 'Ubuntu'
|
||||
|
||||
- name: install packages for Debian
|
||||
tags:
|
||||
- rsyslog
|
||||
- packages
|
||||
apt: pkg={{item}} state=installed update_cache=yes
|
||||
apt: pkg={{ item }} state=installed update_cache=yes
|
||||
with_items: '{{ rsyslog_package_names }}'
|
||||
@@ -13,18 +13,24 @@
|
||||
- rsyslog
|
||||
- packages
|
||||
rpm_key: key=http://rpms.adiscon.com/RPM-GPG-KEY-Adiscon state=present
|
||||
when: adiscon_gpg_key.stat.exists == False and use_repo == True
|
||||
when: >
|
||||
not adiscon_gpg_key.stat.exists and
|
||||
use_repo
|
||||
|
||||
- name: Enable Adiscon rsyslog yum repo
|
||||
tags:
|
||||
- rsyslog
|
||||
- packages
|
||||
template: src=rsyslog.yum.repo.j2 dest=/etc/yum.repos.d/rsyslog.repo
|
||||
when: use_repo == True
|
||||
template:
|
||||
src: rsyslog.yum.repo.j2
|
||||
dest: /etc/yum.repos.d/rsyslog.repo
|
||||
mode: 0644
|
||||
when: use_repo
|
||||
|
||||
- name: install packages for RHEL
|
||||
tags:
|
||||
- rsyslog
|
||||
- packages
|
||||
yum: pkg={{item}} state=latest
|
||||
with_items: '{{ rsyslog_package_names }}'
|
||||
package:
|
||||
name: '{{ rsyslog_package_names }}'
|
||||
state: latest
|
||||
Reference in New Issue
Block a user