update..
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
# *** [ Ansible managed: DO NOT EDIT DIRECTLY ] ***
|
||||
|
||||
# Custom Values overrides/adds values in 'mariadb.service'
|
||||
#
|
||||
[Service]
|
||||
LimitNOFILE=1048576
|
||||
LimitMEMLOCK=infinity
|
@ -0,0 +1,7 @@
|
||||
# *** [ Ansible managed: DO NOT EDIT DIRECTLY ] ***
|
||||
|
||||
# Custom Values overrides/adds values in 'mariadb.service'
|
||||
#
|
||||
[Service]
|
||||
LimitNOFILE=1048576
|
||||
LimitMEMLOCK=infinity
|
@ -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
|
||||
|
||||
|
37
roles/common/tasks/apache2.yml
Normal file
37
roles/common/tasks/apache2.yml
Normal 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'
|
@ -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:
|
||||
|
37
roles/common/tasks/mysql.yml
Normal file
37
roles/common/tasks/mysql.yml
Normal 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'
|
Reference in New Issue
Block a user