This commit is contained in:
2025-02-14 11:36:24 +01:00
parent 6e60b3718e
commit 70c0c3bb7c
12 changed files with 542 additions and 1 deletions

View File

@ -0,0 +1,7 @@
# *** [ Ansible managed: DO NOT EDIT DIRECTLY ] ***
# Custom Values overrides/adds values in 'mariadb.service'
#
[Service]
LimitNOFILE=1048576
LimitMEMLOCK=infinity

View File

@ -0,0 +1,7 @@
# *** [ Ansible managed: DO NOT EDIT DIRECTLY ] ***
# Custom Values overrides/adds values in 'mariadb.service'
#
[Service]
LimitNOFILE=1048576
LimitMEMLOCK=infinity

View File

@ -99,3 +99,16 @@
name: ntpsec
daemon_reload: yes
state: restarted
- name: Restart mariadb
service:
name: mariadb
daemon_reload: yes
state: restarted
- name: Restart apache2
service:
name: apache2
daemon_reload: yes
state: restarted

View File

@ -0,0 +1,37 @@
---
# ---
# Apache2 Server
# ---
- name: Populate service facts
ansible.builtin.service_facts:
#- name: Print service facts
# ansible.builtin.debug:
# var: ansible_facts.services
# when:
# - ansible_facts['services']['apache2.service']['name'] | default('not-found') != 'not-found'
- name: (apache2.yml) Ensure directory '/etc/systemd/system/apache2.service.d' is present
file:
path: /etc/systemd/system/apache2.service.d
state: directory
owner: root
group: root
mode: '0755'
when:
- ansible_facts['services']['apache2.service']['name'] | default('not-found') != 'not-found'
- name: (apache2.yml) Ensure file '/etc/systemd/system/apache2.service.d/limits.conf' exists
copy:
src: 'etc/systemd/system/apache2.service.d/limits.conf'
dest: '/etc/systemd/system/apache2.service.d/limits.conf'
owner: root
group: root
mode: '0644'
notify: "Restart apache2"
when:
- ansible_facts['services']['apache2.service']['name'] | default('not-found') != 'not-found'

View File

@ -280,6 +280,16 @@
when: groups['caching_nameserver']|string is search(inventory_hostname)
tags: caching-nameserver
- import_tasks: mysql.yml
when: groups['mysql_server']|string is search(inventory_hostname)
tags:
- mysql
- mariadb
- import_tasks: apache2.yml
when: groups['apache2_webserver']|string is search(inventory_hostname)
tags:
- apache2
- import_tasks: systemd-services_debian_based_OS.yml
when:

View File

@ -0,0 +1,37 @@
---
# ---
# MySQL / MariaDB Server
# ---
- name: Populate service facts
ansible.builtin.service_facts:
#- name: Print service facts
# ansible.builtin.debug:
# var: ansible_facts.services
# when:
# - ansible_facts['services']['mariadb.service']['name'] | default('not-found') != 'not-found'
- name: (mysql.yml) Ensure directory '/etc/systemd/system/mariadb.service.d' is present
file:
path: /etc/systemd/system/mariadb.service.d
state: directory
owner: root
group: root
mode: '0755'
when:
- ansible_facts['services']['mariadb.service']['name'] | default('not-found') != 'not-found'
- name: (mysql.yml) Ensure file '/etc/systemd/system/mariadb.service.d/limits.conf' exists
copy:
src: 'etc/systemd/system/mariadb.service.d/limits.conf'
dest: '/etc/systemd/system/mariadb.service.d/limits.conf'
owner: root
group: root
mode: '0644'
notify: "Restart mariadb"
when:
- ansible_facts['services']['mariadb.service']['name'] | default('not-found') != 'not-found'