Skip to content

Commit 0103bbb

Browse files
committed
Issue #69: Unable to start Apache/MariaDB on startup
Signed-off-by: alexmerlin <[email protected]>
1 parent fef7e6b commit 0103bbb

File tree

7 files changed

+28
-2
lines changed

7 files changed

+28
-2
lines changed

docs/book/v2/setup/setup-packages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Update/Upgrade system packages:
2929
sudo dnf upgrade -y
3030
```
3131

32-
Now, install the latest version of **Ansible Core** and run **ansible-galaxy** in order to install collections:
32+
Now, install the latest version of **Ansible Core** and run **ansible-galaxy** to install collections:
3333

3434
```shell
3535
sudo dnf install ansible-core -y

wsl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Update/Upgrade system packages:
112112
sudo dnf upgrade -y
113113
```
114114

115-
Now, install the latest version of **Ansible Core** and run **ansible-galaxy** in order to install collections:
115+
Now, install the latest version of **Ansible Core** and run **ansible-galaxy** to install collections:
116116

117117
```shell
118118
sudo dnf install ansible-core -y

wsl/install.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
vars_files:
88
- ./config.yml
99
- ./roles/apache/vars/main.yml
10+
- ./roles/system/vars/main.yml
1011
tasks:
1112
- name: Install and configure packages
1213
include_role:

wsl/roles/apache/tasks/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
- httpd
66
- httpd-tools
77
state: latest
8+
- name: Ensure /run/httpd directory exists on Apache startup
9+
ansible.builtin.lineinfile:
10+
path: "{{ etc_rc_d_rc_local_path }}"
11+
line: "{{ item }}"
12+
create: yes
13+
insertafter: EOF
14+
loop:
15+
- "# Ensure /run/httpd directory exists on Apache startup"
16+
- "/usr/bin/mkdir -p /run/httpd"
17+
- "/usr/bin/install -d -o apache -g apache -m 0755 /run/httpd"
818
- name: Enable and start Apache service
919
command: systemctl enable --now httpd
1020
- name: Fix Apache home directory ownership

wsl/roles/mariadb/tasks/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
---
22
- name: Install MariaDB 11.4
33
command: "dnf install python3-mysqlclient mariadb-server -y"
4+
- name: Ensure /run/mariadb directory exists on MariaDB startup
5+
ansible.builtin.lineinfile:
6+
path: "{{ etc_rc_d_rc_local_path }}"
7+
line: "{{ item }}"
8+
create: yes
9+
insertafter: EOF
10+
loop:
11+
- "# Ensure /run/mariadb directory exists on MariaDB startup"
12+
- "/usr/bin/mkdir -p /run/mariadb"
13+
- "/usr/bin/chown mysql:mysql /run/mariadb"
414
- name: Enable and start MariaDB service
515
command: systemctl enable --now mariadb
616
- name: Set MariaDB root password

wsl/roles/system/tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@
2222
template:
2323
src: bash_profile.j2
2424
dest: "{{ bash_profile_dest }}"
25+
- name: Ensure /etc/rc.d/rc.local is executable
26+
file:
27+
path: "{{ etc_rc_d_rc_local_path }}"
28+
mode: '0755'

wsl/roles/system/vars/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
---
22
wsl_config_dest: /etc/wsl.conf
33
bash_profile_dest: "/home/{{ config.system.username }}/.bash_profile"
4+
etc_rc_d_rc_local_path: "/etc/rc.d/rc.local"

0 commit comments

Comments
 (0)