-
Notifications
You must be signed in to change notification settings - Fork 7
/
lamp_stack.yml
44 lines (38 loc) · 933 Bytes
/
lamp_stack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- name: Install LAMP Stack on RHEL 9
hosts: all
become: true
tasks:
- name: Install Apache
ansible.builtin.dnf:
name: httpd
state: present
- name: Start and enable Apache
ansible.builtin.systemd:
name: httpd
state: started
enabled: true
- name: Install MariaDB
ansible.builtin.dnf:
name: mariadb-server
state: present
- name: Start and enable MariaDB
ansible.builtin.systemd:
name: mariadb
state: started
enabled: true
- name: Install PHP and common modules
ansible.builtin.dnf:
name:
- php
- php-mysqlnd
- php-fpm
- php-opcache
- php-gd
- php-xml
- php-mbstring
state: present
- name: Restart Apache to load PHP modules
ansible.builtin.systemd:
name: httpd
state: restarted