From 3ea27a74266d1dc009a56cd95fc3cd91742fb84f Mon Sep 17 00:00:00 2001 From: phil Date: Wed, 28 Jul 2021 03:11:08 +0200 Subject: [PATCH] Apache2-Rolle --- defaults/main.yml | 2 ++ handlers/main.yml | 5 +++++ meta/main.yml | 10 ++++++++++ tasks/configuration.yml | 10 ++++++++++ tasks/main.yml | 3 +++ tasks/packages.yml | 5 +++++ 6 files changed, 35 insertions(+) create mode 100644 defaults/main.yml create mode 100644 handlers/main.yml create mode 100644 meta/main.yml create mode 100644 tasks/configuration.yml create mode 100644 tasks/main.yml create mode 100644 tasks/packages.yml diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..0381169 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for apache2 diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..6866dc8 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: reload apache2 + service: + name: apache2 + state: reloaded diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..b5e2219 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,10 @@ +galaxy_info: + author: systemausfall.org + description: Role to setup Apache2 + company: Sense.Lab + license: GPLv3 + min_ansible_version: 2.9 + plaforms: + - name: Debian + versions: + - Buster diff --git a/tasks/configuration.yml b/tasks/configuration.yml new file mode 100644 index 0000000..ffeb6d3 --- /dev/null +++ b/tasks/configuration.yml @@ -0,0 +1,10 @@ +- name: "configuration: Server-Tokens deaktivieren" + lineinfile: + path: /etc/apache2/conf-enabled/security.conf + regexp: '^ServerTokens OS' + line: ServerTokens Prod + notify: reload apache2 + +- name: "configuration: Deaktiviere access-Logs" + command: a2disconf other-vhosts-access-log + notify: reload apache2 diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..828bc4d --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- import_tasks: packages.yml +- import_tasks: configuration.yml diff --git a/tasks/packages.yml b/tasks/packages.yml new file mode 100644 index 0000000..adea42d --- /dev/null +++ b/tasks/packages.yml @@ -0,0 +1,5 @@ +--- +- name: "packages: Abhängigkeiten installieren" + apt: + pkg: + - apache2