Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for state warning in ansible 2.6.5 #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
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/).

## [Unreleased]

- Added role requirements for gathered facts.

## 1.5.2

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Installs and configures logrotate

## Requirements

None
* The role requires `gathered_facts: true` to be set.

## Role Variables

Expand Down
15 changes: 7 additions & 8 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
# tasks file for arillso.logrotate

- name: add OS specific variables
- name: Main | Add OS specific variables
include_vars: '{{ loop_vars }}'
with_first_found:
- files:
Expand All @@ -23,7 +22,7 @@
- configuration
- packages

- name: 'install logrotate packages'
- name: Main | Manage logrotate packages
become: true
package:
name: '{{ logrotate_package }}'
Expand All @@ -34,7 +33,7 @@
tags:
- packages

- name: 'create logrotate configuration file'
- name: Main | Create logrotate configuration file
become: true
template:
src: 'etc/logrotate.conf.j2'
Expand All @@ -45,7 +44,7 @@
tags:
- configuration

- name: 'create logrotate application configuration files'
- name: Main | Create logrotate application configuration files
become: true
template:
src: 'etc/logrotate.d/application.j2'
Expand All @@ -58,8 +57,8 @@
tags:
- configuration

- name: Symlink for hourly rotation
file:
- name: Main | Symlink for hourly rotation
ansible.builtin.file:
path: "/etc/cron.hourly/logrotate"
src: "/etc/cron.daily/logrotate"
state: "{{ 'link' if logrotate_use_hourly_rotation else 'absent' }}"
state: "{{ 'link' if logrotate_use_hourly_rotation is defined | default('absent') }}"