Skip to content

Commit

Permalink
Merge pull request #15 from idealista/develop
Browse files Browse the repository at this point in the history
Develop To Master Release 3.0.3
  • Loading branch information
santi-eidu authored May 22, 2024
2 parents 4d31586 + 38b2826 commit 1996400
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.yml linguist-detectable=true
*.yaml linguist-detectable=true
*.html linguist-detectable=false
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ python: "3.9"
os: linux
services:
- docker
before_install:
- echo '{"default-cgroupns-mode":"host"}' | sudo tee /etc/docker/daemon.json
- sudo systemctl restart docker
install:
- pip install pipenv
- pipenv sync
Expand All @@ -20,6 +23,9 @@ env:
- MOLECULE_DISTRO=debian:bullseye-slim SCENARIO=default
- MOLECULE_DISTRO=debian:bullseye-slim SCENARIO=timer-create-config
- MOLECULE_DISTRO=debian:bullseye-slim SCENARIO=timer-to-hourly
- MOLECULE_DISTRO=debian:bookworm-slim SCENARIO=default
- MOLECULE_DISTRO=debian:bookworm-slim SCENARIO=timer-create-config
- MOLECULE_DISTRO=debian:bookworm-slim SCENARIO=timer-to-hourly
script:
- pipenv run molecule test --scenario-name=${SCENARIO}

Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog).

## Added
- *[#12](https://github.com/idealista/logrotate_role/pull/12) (2024-01-17)- Add ".gitattributes" file for linguist detection.* @ygomezsaiz

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

<!-- ### Fixed
Expand All @@ -13,6 +16,18 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch
### Removed -->

## [3.0.3](https://github.com/idealista/logrotate_role/tree/3.0.3)

### Fixed

### Added

- Add Debian 12 support

### Changed

### Removed

## [3.0.2](https://github.com/idealista/logrotate_role/tree/3.0.2)

### Fixed
Expand Down
13 changes: 13 additions & 0 deletions molecule/cron-create-config/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ FROM {{ item.registry.url }}/{{ item.image }}
FROM {{ item.image }}
{% endif %}

{% if item.image == 'debian:stretch-slim' %}
RUN rm /etc/apt/sources.list.d/* || true
RUN echo "deb http://archive.debian.org/debian/ stretch main contrib non-free" > /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --force-yes python3 sudo bash ca-certificates iproute2 systemd systemd-sysv && \
apt-get clean
{% endif %}

# install minimal packages for debian slim images
RUN apt-get update && \
apt-get install -y python sudo bash ca-certificates iproute2 systemd systemd-sysv python-pip && \
Expand Down
2 changes: 1 addition & 1 deletion molecule/cron-create-config/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ platforms:
- /run
- /run/lock
volumes:
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
- '/sys/fs/cgroup:/sys/fs/cgroup'
command: '/lib/systemd/systemd'
stop_signal: 'RTMIN+3'

Expand Down
13 changes: 13 additions & 0 deletions molecule/cron-default/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ FROM {{ item.registry.url }}/{{ item.image }}
FROM {{ item.image }}
{% endif %}

{% if item.image == 'debian:stretch-slim' %}
RUN rm /etc/apt/sources.list.d/* || true
RUN echo "deb http://archive.debian.org/debian/ stretch main contrib non-free" > /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --force-yes python3 sudo bash ca-certificates iproute2 systemd systemd-sysv && \
apt-get clean
{% endif %}

# install minimal packages for debian slim images
RUN apt-get update && \
apt-get install -y python sudo bash ca-certificates iproute2 systemd systemd-sysv python-pip && \
Expand Down
2 changes: 1 addition & 1 deletion molecule/cron-default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ platforms:
- /run
- /run/lock
volumes:
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
- '/sys/fs/cgroup:/sys/fs/cgroup'
command: '/lib/systemd/systemd'
stop_signal: 'RTMIN+3'

Expand Down
13 changes: 13 additions & 0 deletions molecule/cron-to-hourly/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ FROM {{ item.registry.url }}/{{ item.image }}
FROM {{ item.image }}
{% endif %}

{% if item.image == 'debian:stretch-slim' %}
RUN rm /etc/apt/sources.list.d/* || true
RUN echo "deb http://archive.debian.org/debian/ stretch main contrib non-free" > /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian-security stretch/updates main contrib non-free" >> /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \
echo "deb-src http://archive.debian.org/debian/ stretch-backports main contrib non-free" >> /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --force-yes python3 sudo bash ca-certificates iproute2 systemd systemd-sysv && \
apt-get clean
{% endif %}

# install minimal packages for debian slim images
RUN apt-get update && \
apt-get install -y python sudo bash ca-certificates iproute2 systemd systemd-sysv python-pip && \
Expand Down
2 changes: 1 addition & 1 deletion molecule/cron-to-hourly/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ platforms:
- /run
- /run/lock
volumes:
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
- '/sys/fs/cgroup:/sys/fs/cgroup'
command: '/lib/systemd/systemd'
stop_signal: 'RTMIN+3'

Expand Down
2 changes: 1 addition & 1 deletion molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM {{ item.image }}
{% endif %}

# install minimal packages for debian slim images
{% if item.image == 'debian:bullseye-slim' %}
{% if item.image == 'debian:bullseye-slim' or item.image == 'debian:bookworm-slim' %}
RUN apt-get update && \
apt-get install -y python3 sudo bash ca-certificates iproute2 systemd systemd-sysv python3-pip && \
apt-get clean
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ platforms:
- /run
- /run/lock
volumes:
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
- '/sys/fs/cgroup:/sys/fs/cgroup'
command: '/lib/systemd/systemd'
stop_signal: 'RTMIN+3'

Expand Down
2 changes: 1 addition & 1 deletion molecule/timer-create-config/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM {{ item.image }}
{% endif %}

# install minimal packages for debian slim images
{% if item.image == 'debian:bullseye-slim' %}
{% if item.image == 'debian:bullseye-slim' or item.image == 'debian:bookworm-slim' %}
RUN apt-get update && \
apt-get install -y python3 sudo bash ca-certificates iproute2 systemd systemd-sysv python3-pip && \
apt-get clean
Expand Down
2 changes: 1 addition & 1 deletion molecule/timer-create-config/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ platforms:
- /run
- /run/lock
volumes:
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
- '/sys/fs/cgroup:/sys/fs/cgroup'
command: '/lib/systemd/systemd'
stop_signal: 'RTMIN+3'

Expand Down
2 changes: 1 addition & 1 deletion molecule/timer-to-hourly/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM {{ item.image }}
{% endif %}

# install minimal packages for debian slim images
{% if item.image == 'debian:bullseye-slim' %}
{% if item.image == 'debian:bullseye-slim' or item.image == 'debian:bookworm-slim' %}
RUN apt-get update && \
apt-get install -y python3 sudo bash ca-certificates iproute2 systemd systemd-sysv python3-pip && \
apt-get clean
Expand Down
2 changes: 1 addition & 1 deletion molecule/timer-to-hourly/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ platforms:
- /run
- /run/lock
volumes:
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
- '/sys/fs/cgroup:/sys/fs/cgroup'
command: '/lib/systemd/systemd'
stop_signal: 'RTMIN+3'

Expand Down
30 changes: 30 additions & 0 deletions tasks/config-Debian-12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

- name: LOGROTATE | Set facts
set_fact:
options: "{{ options|default([]) + item }}"
with_items:
- "{{ logrotate_config_file | json_query( '[*].options' ) }}"
tags:
- config
- config-frequency

- name: LOGROTATE | Changing timer to hourly
set_fact:
logrotate_timer_oncalendar: "{{ logrotate_timer_oncalendar_hourly }}"
logrotate_timer_accuracysec: "{{ logrotate_timer_accuracysec_hourly }}"
when: "'hourly' in options"
tags:
- config
- config-frequency

- name: LOGROTATE | Add timer
template:
src: "{{ logrotate_j2_timer }}"
dest: "{{ logrotate_systemd_path }}/{{ logrotate_timer }}"
mode: 0644
become: true
notify: start timer
tags:
- config
- config-frequency

0 comments on commit 1996400

Please sign in to comment.