From 09f7750206cd960ff02c852c9eb94a1e23d5291b Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Sat, 29 Oct 2022 18:02:17 +0000 Subject: [PATCH] apache: ansible-lint fixes --- roles/apache/handlers/main.yml | 4 ++-- roles/apache/tasks/main.yml | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/roles/apache/handlers/main.yml b/roles/apache/handlers/main.yml index 1280944..5761259 100644 --- a/roles/apache/handlers/main.yml +++ b/roles/apache/handlers/main.yml @@ -1,5 +1,5 @@ --- -- name: restart apache - service: +- name: Restart apache + ansible.builtin.service: name: httpd state: restarted diff --git a/roles/apache/tasks/main.yml b/roles/apache/tasks/main.yml index f892fb5..d52f393 100644 --- a/roles/apache/tasks/main.yml +++ b/roles/apache/tasks/main.yml @@ -1,5 +1,5 @@ --- -- name: install apache +- name: Install apache ansible.builtin.package: name: "{{ item }}" state: installed @@ -7,7 +7,7 @@ - httpd - mod_ssl -- name: disable plain http and default included configs +- name: Disable plain http and default included configs ansible.builtin.lineinfile: path: /etc/httpd/conf/httpd.conf line: "#{{ item }}" @@ -15,28 +15,28 @@ with_items: - "Listen 80" - "IncludeOptional conf.d/*.conf" - notify: restart apache + notify: Restart apache -- name: set server admin address +- name: Set server admin address ansible.builtin.lineinfile: path: /etc/httpd/conf/httpd.conf line: "ServerAdmin webmaster@{{ mail_domain }}" regexp: "#?ServerAdmin .*" - notify: restart apache + notify: Restart apache -- name: include local configs +- name: Include local configs ansible.builtin.lineinfile: path: /etc/httpd/conf/httpd.conf line: "IncludeOptional conf.local.d/*.conf" - notify: restart apache + notify: Restart apache -- name: fix selinux contexts from data directory +- name: Fix SELinux contexts from data directory community.general.sefcontext: path: /srv/web(/.*)? setype: httpd_sys_content_t when: ansible_selinux_python_present -- name: create data and config directories +- name: Create data and config directories ansible.builtin.file: state: directory path: "{{ item }}" @@ -50,25 +50,25 @@ - "/srv/web/{{ inventory_hostname }}" - "/etc/httpd/conf.local.d" -- name: create ssl config +- name: Create SSL config ansible.builtin.template: src: ssl.conf.j2 dest: /etc/httpd/conf.local.d/ssl.conf mode: 0644 owner: root group: "{{ ansible_wheel }}" - notify: restart apache + notify: Restart apache -- name: create site config +- name: Create site config ansible.builtin.template: src: site.conf.j2 dest: "/etc/httpd/conf.local.d/{{ inventory_hostname }}.conf" mode: 0644 owner: root group: "{{ ansible_wheel }}" - notify: restart apache + notify: Restart apache -- name: fix log directory permissions +- name: Fix log directory permissions ansible.builtin.file: path: /var/log/httpd state: directory @@ -76,7 +76,7 @@ owner: root group: "{{ ansible_wheel }}" -- name: import sftpuser role +- name: Import sftpuser role ansible.builtin.import_role: name: sftpuser vars: @@ -84,7 +84,7 @@ user: logsync publickeys: "{{ logsync_publickeys }}" -- name: enable apache +- name: Enable apache ansible.builtin.service: name: httpd state: started