Skip to content

Commit

Permalink
update to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaerlocher committed Jul 6, 2019
1 parent c378d2e commit 62498ca
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 121 deletions.
58 changes: 24 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@
---
language: python
python: "2.7"

# Use the new container infrastructure
sudo: false

# Install ansible
addons:
apt:
packages:
- python-pip
services: docker

env:
global:
- ROLE_NAME: logrotate
matrix:
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: centos6
- MOLECULE_DISTRO: ubuntu1804
- MOLECULE_DISTRO: debian9
- MOLECULE_DISTRO: debian10

install:
# Install ansible
- pip install ansible

# Install ansible-lint
- pip install ansible-lint

# Install yamllint
- pip install yamllint
- pip install molecule docker

# Install tests rules
- git submodule add https://github.com/arillso/tests tests
- git clone https://github.com/arillso/tests molecule/default/lint

before_script:
# Check ansible version
- ansible --version

# Check ansible-lint version
- ansible-lint --version

# Check ansible-lint version
- yamllint --version
- cd ../
- mv ansible.$ROLE_NAME arillso.$ROLE_NAME
- cd arillso.$ROLE_NAME

script:
# Ansible Lint check
- ansible-lint -R -r tests/ansible-lint/ .

# YAML Lint check
- yamllint -c tests/yaml-lint/yamllint.yml .
- molecule test

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks:
urls:
- https://galaxy.ansible.com/api/v1/notifications/
on_success: always
email:
on_success: never
on_failure: always
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Changelog

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).

## 1.5.0

### Changed

- update min ansible version to 2.8
- changelog to your own file
- travis file has been updated
- Documentation has been improved

### Added

- molecule testing

## 1.4.1

### Added

- add Red Hat Support

## 1.4

### Changed

- update loop_vars

### Added

- add defaults vars

### 1.3.0

### Changed

- new role tests

### 1.2.0

### Changed

- rename role

## 1.1.0

### Added

- add become support

## 1.0.0

### Added

- inital Release
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017 Simon Bärlocher
Copyright (c) 2019 Arillso

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
124 changes: 71 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,81 +18,99 @@ None

## Role Variables

| Variable | Default | Comments (type) |
| :--------------------- | :-------------------------------------------------------------------------------------------------- | :--------------------------------------- |
| logrotate_options | [ 'weekly', 'su root syslog', 'rotate 4', 'create' ] | List of default options |
| logrotate_wtmp | { logs: ['/var/log/wtmp'], options: ['missingok', 'monthly', 'create 0664 root utmp', 'rotate 1'] } | Logrotate options for wtmp |
| logrotate_btmp | { logs: ['/var/log/btmp'], options: ['missingok', 'monthly', 'create 0660 root utmp', 'rotate 1'] } | Logrotate options for btmp |
| logrotate_applications | [] | Logrotate options for other applications |
### imclude files

## Dependencies
Path to the imclude files

None
```yml
logrotate_include_dir: /etc/logrotate.d
```
## Example Playbook
### logrotate options
List of global options.
```yml
- hosts: all
roles:
- arillso.logrotate
logrotate_options:
- weekly
- rotate 4
- create
- dateext
- su root syslog
```
### Example
### Package
package name to install logrotate.
```yml
logrotate_applications:
- name: zabbix-agent
definitions:
- logs:
- '/var/log/zabbix/zabbix_agentd.log'
options:
- weekly
- rotate 13
- compress
- delaycompress
- missingok
- notifempty
- create 0640 zabbix zabbix
- name: nginx
definitions:
- logs:
- '/var/log/nginx/nginx.log'
options:
- weekly
- rotate 13
- compress
- delaycompress
- missingok
- notifempty
- create 0640 www-data adm
logrotate_package: logrotate
```
## Changelog
### default config
logroate for wtmp
```yml
logrotate_wtmp:
logs:
- /var/log/wtmp
options:
- missingok
- monthly
- create 0664 root utmp
- rotate 1
```
### 1.4.1
logroate for btmp
- add Red Hat Support
```yml
logrotate_btmp:
logs:
- /var/log/btmp
options:
- missingok
- monthly
- create 0660 root utmp
- rotate 1
```
### 1.4
### applications config
- update loop_vars
- add defaults vars
More log files can be added that will logorate.
### 1.3
```yml
logrotate_applications: []
```
- new role tests
#### Example
### 1.2
The following options are available.
- rename role
```yml
logrotate_applications
definitions:
- logs:
- /var/log/apt/term.log
- /var/log/apt/history.log
options:
- rotate 12
- monthly
- missingok
- notifempty
```
### 1.1
## Dependencies
- add become support
None
### 1.0
## Example Playbook
- inital role
```yml
- hosts: all
roles:
- arillso.logrotate
```
## Author
Expand All @@ -104,4 +122,4 @@ This project is under the MIT License. See the [LICENSE](https://sbaerlo.ch/lice
## Copyright
(c) 2019, Simon Bärlocher
(c) 2019, Arillso
20 changes: 20 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
---
# defaults file for arillso.logrotate

# Path to the imclude files
logrotate_include_dir: /etc/logrotate.d

# package name to install logrotate.
logrotate_package: logrotate

# logroate for wtmp
logrotate_wtmp:
logs:
- /var/log/wtmp
Expand All @@ -10,6 +17,7 @@ logrotate_wtmp:
- create 0664 root utmp
- rotate 1

# logroate for btmp
logrotate_btmp:
logs:
- /var/log/btmp
Expand All @@ -19,4 +27,16 @@ logrotate_btmp:
- create 0660 root utmp
- rotate 1

# More log files can be added that will logorate.
# The following options are available.
# definitions:
# - logs:
# - /var/log/apt/term.log
# - /var/log/apt/history.log
# options:
# - rotate 12
# - monthly
# - missingok
# - notifempty
# - compress
logrotate_applications: []
29 changes: 17 additions & 12 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
---

galaxy_info:
author: 'arillso'
company: 'arillso'
description: 'Ansible role for installs and configures logratet on RHEL/CentOS or Debian/Ubuntu'
description: 'Ansible role for installs and configures logratet on Linux'
license: MIT
min_ansible_version: 2.7
min_ansible_version: 2.8
platforms:
- name: EL
versions:
- 6
- 7
- name: Fedora
versions:
- 29
- name: Ubuntu
versions:
- bionic
- cosmic
- disco
- name: Debian
versions:
- wheezy
- jessie
- stretch
- name: Ubuntu
versions:
- trusty
- xenial
- name: EL
- buster
- name: Windows
versions:
- 6
- 7
- all

galaxy_tags:
- system
Expand Down
Loading

0 comments on commit 62498ca

Please sign in to comment.