Skip to content

Commit

Permalink
Merge pull request #38 from idealista/develop
Browse files Browse the repository at this point in the history
Develop To Master
  • Loading branch information
santi-eidu authored Jan 19, 2023
2 parents 85d02da + c6b511e commit 5d065ca
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.

## [Unreleased](https://github.com/idealista/rsyslog_role/tree/develop)

## [2.2.2](https://github.com/idealista/rsyslog_role/tree/2.2.2)
[Full Changelog](https://github.com/idealista/rsyslog_role/compare/2.2.1...2.2.2)
### Changed
- *[#36](https://github.com/idealista/rsyslog_role/issues/36) Parameterize config template and file permissions* @santi-eidu

## [2.2.1](https://github.com/idealista/rsyslog_role/tree/2.2.1)
[Full Changelog](https://github.com/idealista/rsyslog_role/compare/2.2.0...2.2.1)

### Added
- [#33](https://github.com/idealista/rsyslog_role/issues/33) *[FEATURE] multifunctional role* @marcelogalmor

Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
rsyslog_package: "rsyslog"
rsyslog_use_pidfile: true
rsyslog_pidfile: /var/run/rsyslogd.pid
__rsyslog_force_apt: false
# If you want to set a package version; else the role will install the latest version:
# Debian Buster
# rsyslog_package: "rsyslog=8.1901.0-1"
Expand All @@ -23,13 +24,15 @@ rsyslog_service_state: started
# Owner defaults to root; there is a more secure configuration below
# rsyslog_user: rsyslog
# rsyslog_group: rsyslog
# rsyslog_permissions: 0640
# rsyslog_extra_groups: systemd-journal
# rsyslog_user_shell: /bin/false

# Files & Paths
# WARNING: ownership will change to match rsyslog user and group
rsyslog_work_directory: /var/spool/rsyslog
rsyslog_logs_directory: /var/log
rsyslog_template_config_file: etc/rsyslog.conf.j2
rsyslog_config_file: /etc/rsyslog.conf
rsyslog_include_config_path: /etc/rsyslog.d
rsyslog_include_config_matcher: "{{ rsyslog_include_config_path }}/*.conf"
Expand Down
9 changes: 9 additions & 0 deletions molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ FROM {{ item.registry.url }}/{{ item.image }}
FROM {{ item.image }}
{% endif %}

# install minimal packages for debian slim images
{% if item.image == 'debian:jessie-slim' %}
RUN if [ $(command -v apt-get) ]; then \
apt-get update \
&& apt-get install -y --force-yes python systemd systemd-sysv sudo bash ca-certificates iproute2 \
&& apt-get clean; \
fi
{% else %}
RUN if [ $(command -v apt-get) ]; then \
apt-get update \
&& apt-get install -y python systemd systemd-sysv sudo bash ca-certificates iproute2 \
&& apt-get clean; \
fi
{% endif %}
2 changes: 1 addition & 1 deletion tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- name: RSYSLOG | Deploy rsyslog configuration
template:
src: etc/rsyslog.conf.j2
src: "{{ rsyslog_template_config_file }}"
dest: "{{ rsyslog_config_file }}"
owner: "{{ rsyslog_user | default('root') }}"
group: "{{ rsyslog_group | default('root') }}"
Expand Down
2 changes: 2 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
name: "{{ rsyslog_package }}"
state: present
update_cache: true
force: "{{ __rsyslog_force_apt }}"
cache_valid_time: 3600
register: rsyslog_core_package_installed
until: rsyslog_core_package_installed is succeeded
Expand All @@ -52,6 +53,7 @@
name: "{{ rsyslog_feature_packages }}"
state: present
update_cache: true
force: "{{ __rsyslog_force_apt }}"
cache_valid_time: 3600
register: rsyslog_feature_packages_installed
until: rsyslog_feature_packages_installed is succeeded
Expand Down
7 changes: 7 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
---
- name: Consul | Gather OS specific variables
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
ignore_errors: true
tags:
- install

- name: RSYSLOG | Install
import_tasks: install.yml
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/rsyslog.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $PrivDropToGroup {{ rsyslog_group | default('root') }}
#
$FileOwner {{ rsyslog_user | default('root') }}
$FileGroup {{ rsyslog_user | default('adm') }}
$FileCreateMode 0640
$FileCreateMode {{ rsyslog_permissions | default('0640') }}
$DirCreateMode 0755
$Umask 0022

Expand Down
2 changes: 2 additions & 0 deletions vars/Debian-8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
__rsyslog_force_apt: true

0 comments on commit 5d065ca

Please sign in to comment.