File tree Expand file tree Collapse file tree 7 files changed +45
-26
lines changed
Expand file tree Collapse file tree 7 files changed +45
-26
lines changed Original file line number Diff line number Diff line change 1414 name : " {{ role }}"
1515 tasks_from : main
1616 loop :
17- - system
1817 - apache
1918 - php
2019 - mariadb
2120 - phpmyadmin
21+ - system
2222 - composer
2323 - nodejs
2424 - git
Original file line number Diff line number Diff line change 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"
188- name : Enable and start Apache service
199 command : systemctl enable --now httpd
2010- name : Fix Apache home directory ownership
Original file line number Diff line number Diff line change 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"
144- name : Enable and start MariaDB service
155 command : systemctl enable --now mariadb
166- name : Set MariaDB root password
Original file line number Diff line number Diff line change 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'
25+ - name : Add create runtime directories script
26+ template :
27+ src : runtime-directories.sh.j2
28+ dest : " {{ runtime_directories_script_path }}"
29+ mode : " 0755"
30+ - name : Add create runtime directories service
31+ template :
32+ src : runtime-directories.service.j2
33+ dest : " {{ runtime_directories_service_path }}"
34+ mode : " 0755"
35+ - name : Reload systemd
36+ ansible.builtin.systemd :
37+ daemon_reload : yes
38+ - name : Enable runtime-directories.service
39+ ansible.builtin.systemd :
40+ name : runtime-directories.service
41+ enabled : yes
42+ - name : Start runtime-directories.service
43+ ansible.builtin.systemd :
44+ name : runtime-directories.service
45+ state : started
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description=Create runtime directories for Apache and MariaDB
3+ DefaultDependencies=no
4+ After=local-fs.target
5+ Before=httpd.service mariadb.service
6+
7+ [Service]
8+ Type=oneshot
9+ ExecStart={{ runtime_directories_script_path }}
10+ RemainAfterExit=true
11+
12+ [Install]
13+ WantedBy=multi-user.target
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ # Create /run/httpd with correct ownership and permissions
5+ install -d -o apache -g apache -m 0755 /run/httpd
6+
7+ # Create /run/mariadb with correct ownership and permissions
8+ install -d -o mysql -g mysql -m 0755 /run/mariadb
Original file line number Diff line number Diff line change 11---
22wsl_config_dest : /etc/wsl.conf
33bash_profile_dest : " /home/{{ config.system.username }}/.bash_profile"
4- etc_rc_d_rc_local_path : " /etc/rc.d/rc.local"
4+ runtime_directories_script_path : " /usr/local/bin/runtime-directories.sh"
5+ runtime_directories_service_path : " /etc/systemd/system/runtime-directories.service"
You can’t perform that action at this time.
0 commit comments