Skip to content

Commit

Permalink
add checksum and disable gpg check
Browse files Browse the repository at this point in the history
  • Loading branch information
FuHsinyu committed Feb 26, 2025
1 parent e7f6306 commit 5b67d02
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions roles/apache/tasks/main-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,25 @@
- name: Enable mod_evasive module

Check failure on line 32 in roles/apache/tasks/main-tasks.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.

Check failure on line 32 in roles/apache/tasks/main-tasks.yml

View workflow job for this annotation

GitHub Actions / build

no-changed-when

Commands should not change things if nothing needs doing.
ansible.builtin.command:
cmd: a2enmod evasive

when: ansible_os_family == 'Debian'


- name: Ensure Apache mod_evasive is installed (EL9)

Check failure on line 39 in roles/apache/tasks/main-tasks.yml

View workflow job for this annotation

GitHub Actions / build

key-order[task]

You can improve the task key order to: name, become, when, block

Check failure on line 39 in roles/apache/tasks/main-tasks.yml

View workflow job for this annotation

GitHub Actions / build

key-order[task]

You can improve the task key order to: name, become, when, block
become: true
block:
- name: Install wget
ansible.builtin.package:
name: wget
state: present

- name: Download mod_evasive RPM package
ansible.builtin.get_url:
url: https://pkgs.sysadmins.ws/el9/modular/x86_64/httpd/mod_evasive-1.10.1-33.el9.x86_64.rpm
dest: /tmp/mod_evasive-1.10.1-33.el9.x86_64.rpm
mode: '0644'

checksum: "sha256:e2741df78705d51561c0bdd3219fe2d4bad1a7946b94eb3fed19ed8ca4e593d2" # actual checksum of the file
- name: Install mod_evasive package
ansible.builtin.package:
name: /tmp/mod_evasive-1.10.1-33.el9.x86_64.rpm
state: present
disable_gpg_check: true

when: ansible_os_family == 'RedHat'


Expand Down Expand Up @@ -95,15 +93,15 @@
when: ansible_os_family == 'Debian'


- name: Ensure config for Apache mod_evasive is present (EL9)
ansible.builtin.template:
src: evasive.conf.el9.j2
dest: /etc/httpd/conf.d/mod_evasive.conf
mode: '0600'
owner: root
group: root
notify: Restart Apache webserver
when: ansible_os_family == 'RedHat'
#- name: Ensure config for Apache mod_evasive is present (EL9)

Check failure on line 96 in roles/apache/tasks/main-tasks.yml

View workflow job for this annotation

GitHub Actions / build

yaml[comments]

Missing starting space in comment

Check failure on line 96 in roles/apache/tasks/main-tasks.yml

View workflow job for this annotation

GitHub Actions / build

yaml[comments]

Missing starting space in comment
# ansible.builtin.template:
# src: evasive.conf.el9.j2
# dest: /etc/httpd/conf.d/mod_evasive.conf
# mode: '0600'
# owner: root
# group: root
# notify: Restart Apache webserver
# when: ansible_os_family == 'RedHat'


- name: Ensure config for other VHosts is present (Ubuntu)
Expand Down

0 comments on commit 5b67d02

Please # to comment.