Skip to content

Commit

Permalink
Merge pull request #3 from benformosa/cis
Browse files Browse the repository at this point in the history
Add configuration for file and dir modes
  • Loading branch information
robertdebock authored Feb 27, 2020
2 parents 7ae4a72 + 2ff8605 commit b3ff323
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Install and configure rsyslog on your system.

|Travis|GitHub|Quality|Downloads|
|------|------|-------|---------|
|[![travis](https://travis-ci.org/robertdebock/ansible-role-rsyslog.svg?branch=master)](https://travis-ci.org/robertdebock/ansible-role-rsyslog)|[![github](https://github.com/robertdebock/ansible-role-rsyslog/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-rsyslog/actions)|![quality](https://img.shields.io/ansible/quality/22988)|![downloads](https://img.shields.io/ansible/role/d/22988)|
|[![travis](https://travis-ci.org/robertdebock/ansible-role-rsyslog.svg?branch=master)](https://travis-ci.org/robertdebock/ansible-role-rsyslog)|[![github](https://github.com/robertdebock/ansible-role-rsyslog/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-rsyslog/actions)|![quality](https://img.shields.io/ansible/quality/)|![downloads](https://img.shields.io/ansible/role/d/)|

Example Playbook
----------------
Expand Down Expand Up @@ -65,6 +65,12 @@ These variables are set in `defaults/main.yml`:
# the ipaddress of the receiving rsyslog server.
# Not setting this variable will not forward logs.
# rsyslog_remote: server1.example.com
# Set the mode for new directories
rsyslog_dircreatemode: "0700"
# Set the mode for new files
rsyslog_filecreatemode: "0644"
```

Requirements
Expand Down
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@
# the ipaddress of the receiving rsyslog server.
# Not setting this variable will not forward logs.
# rsyslog_remote: server1.example.com

# Set the mode for new directories
rsyslog_dircreatemode: "0700"

# Set the mode for new files
rsyslog_filecreatemode: "0644"
3 changes: 3 additions & 0 deletions templates/rsyslog.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ $OmitLocalLogging on
# File to store the position in the journal
$IMJournalStateFile imjournal.state

# Set mode for new files and directories
$DirCreateMode {{ rsyslog_dircreatemode }}
$FileCreateMode {{ rsyslog_filecreatemode }}

#### RULES ####

Expand Down

0 comments on commit b3ff323

Please sign in to comment.