diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f7278a..fbeb546 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,14 +44,13 @@ jobs: fail-fast: false matrix: include: - - distro: debian8 - - distro: debian9 - distro: debian10 - - distro: ubuntu1604 - ansible-version: '>=2.10, <2.11' - - distro: ubuntu1604 + - distro: debian11 + - distro: debian12 - distro: ubuntu1804 - distro: ubuntu2004 + - distro: ubuntu2004 + - distro: ubuntu2204 steps: - name: Check out the codebase @@ -65,8 +64,8 @@ jobs: python-version: '3.x' - name: Install test dependencies - run: pip install 'ansible${{ matrix.ansible-version }}' molecule[docker] docker - + run: | + pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker - name: Run Molecule tests run: | molecule test diff --git a/README.md b/README.md index 87c8699..d265ce4 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ None - `fail2ban_bantime`: [default: `600`]: Sets the bantime - `fail2ban_maxretry`: [default: `3`]: Maximum number of retries before the host is put into jail - `fail2ban_findtime`: [default: `600`]: A host is banned if it has generated `fail2ban_maxretry` during the last `fail2ban_findtime` -- `fail2ban_backend`: [default: `auto`]: Specifies the backend used to get files modification. For Debian 12, `systemd` is required. +- `fail2ban_backend`: [default: `auto`]: Specifies the backend used to get files modification. For Debian 12, `systemd` is required - `fail2ban_banaction`: [default: `iptables-multiport`]: Sets the global/default banaction - `fail2ban_banaction_allports`: [default: `iptables-allports`]: Sets the global/default banaction for allports - `fail2ban_mta`: [default: `sendmail`]: Email action diff --git a/Vagrantfile b/Vagrantfile index a0182a0..5daa6bf 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,13 +4,6 @@ role = File.basename(File.expand_path(File.dirname(__FILE__))) boxes = [ - { - :name => "ubuntu-1604", - :box => "bento/ubuntu-16.04", - :ip => '10.0.0.12', - :cpu => "50", - :ram => "256" - }, { :name => "ubuntu-1804", :box => "bento/ubuntu-18.04", @@ -23,26 +16,33 @@ boxes = [ :box => "bento/ubuntu-20.04", :ip => '10.0.0.14', :cpu => "50", - :ram => "384" + :ram => "512" + }, + { + :name => "ubuntu-2204", + :box => "bento/ubuntu-22.04", + :ip => '10.0.0.15', + :cpu => "50", + :ram => "512" }, { - :name => "debian-8", - :box => "bento/debian-8", - :ip => '10.0.0.16', + :name => "debian-10", + :box => "bento/debian-10", + :ip => '10.0.0.18', :cpu => "50", :ram => "256" }, { - :name => "debian-9", - :box => "bento/debian-9", - :ip => '10.0.0.17', + :name => "debian-11", + :box => "bento/debian-11", + :ip => '10.0.0.19', :cpu => "50", :ram => "256" }, { - :name => "debian-10", - :box => "bento/debian-10", - :ip => '10.0.0.18', + :name => "debian-12", + :box => "bento/debian-12", + :ip => '10.0.0.20', :cpu => "50", :ram => "256" }, diff --git a/meta/main.yml b/meta/main.yml index 4869a24..2c31e1c 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -10,14 +10,14 @@ galaxy_info: platforms: - name: Ubuntu versions: - - xenial - bionic - focal + - jammy - name: Debian versions: - - jessie - - stretch - buster + - bullseye + - bookworm galaxy_tags: - system - networking diff --git a/molecule/default/collections.yml b/molecule/default/collections.yml index c3d7e2a..1062b36 100644 --- a/molecule/default/collections.yml +++ b/molecule/default/collections.yml @@ -1,6 +1,2 @@ --- -collections: - - name: community.docker - version: '>=1.2.0,<2' - - name: community.general - version: '>=2,<3' +collections: [] diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 8841165..908aaf6 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -5,7 +5,7 @@ driver: name: docker platforms: - name: instance - image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest" + image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest" command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw diff --git a/tasks/main.yml b/tasks/main.yml index 3f6103c..da69a5c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,7 +2,7 @@ --- - name: install ansible.builtin.apt: - name: "{{ fail2ban_dependencies }}" + name: "{{ ' '.join(fail2ban_dependencies).split() }}" state: "{{ apt_install_state | default('latest') }}" update_cache: true cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" @@ -11,18 +11,6 @@ - fail2ban - fail2ban-install -- name: Install python3-systemd for systemd backend - ansible.builtin.apt: - name: python3-systemd - state: "{{ apt_install_state | default('latest') }}" - update_cache: true - cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}" - when: fail2ban_backend == 'systemd' - tags: - - configuration - - fail2ban - - fail2ban-install - - name: get fail2ban version ansible.builtin.command: > fail2ban-server -V diff --git a/vars/main.yml b/vars/main.yml index 8d841fc..88f7ac3 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -2,3 +2,4 @@ --- fail2ban_dependencies: - fail2ban + - "{{ (fail2ban_backend == 'systemd') | ternary('python' + (ansible_python_version is version('3', '>=') | ternary('3', '')) + '-systemd', '') }}"