Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/book/v1/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
* **Apache**: free and open-source cross-platform web server software
* **MariaDB**: community-developed, commercially supported fork of the MySQL relational database management system
* **Git**: distributed version control system
* **Composer**: application-level dependency manager for the PHP
* **Composer**: application-level dependency manager
* **Node.js**: JavaScript runtime environment
* **PhpMyAdmin**: open source administration tool for MySQL and MariaDB
14 changes: 12 additions & 2 deletions docs/book/v1/setup/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,23 @@ OracleLinux_9_1 Oracle Linux 9.1

Note the two columns: **NAME** and **FRIENDLY NAME**.
To install a specific distro, use the value from the **NAME** column, in this case: `AlmaLinux-9`.

> If you try to install a distro that is already installed, the installation process will fail:

```text
Downloading: AlmaLinux OS 9
Installing: AlmaLinux OS 9
A distribution with the supplied name already exists. Use --name to choose a different name.
Error code: Wsl/InstallDistro/Service/RegisterDistro/ERROR_ALREADY_EXISTS
```

Install the AlmaLinux9 distro by executing the below command:

```shell
wsl --install -d AlmaLinux-9
```

You should see the download progress - once finished, the output should look like this:
You should see the download progressonce finished, the output should look like this:

```text
Downloading: AlmaLinux OS 9
Expand All @@ -101,7 +111,7 @@ Changing password for user dotkernel.
New password:
```

Depending on the strength of your password, you might get a `BAD PASSWORD: <some-reason>` message (if you want to choose a different password, hit `Enter` and you are taken back to previous step - else, continue with retyping your password):
Depending on the strength of your password, you might get a `BAD PASSWORD: <some-reason>` message (if you want to choose a different password, hit `Enter` and you are taken back to the previous stepelse, continue with retyping your password):

Next, you are asked to retype your password:

Expand Down
2 changes: 1 addition & 1 deletion docs/book/v1/virtualhosts/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Using this tool, you configure a virtualhost for each of your applications, and
**Example**:

* `api.dotkernel.localhost`: this could be the endpoint where you host your website's API
* `frontend.dotkernel.localhost`: this could be domain you host your website's frontend that will consume the API
* `frontend.dotkernel.localhost`: this could be the subdomain you host your website's frontend that will consume the API

In the above example, the URLs are built like this:

Expand Down
14 changes: 12 additions & 2 deletions wsl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,23 @@ OracleLinux_9_1 Oracle Linux 9.1

Note the two columns: **NAME** and **FRIENDLY NAME**.
To install a specific distro, use the value from the **NAME** column, in this case: `AlmaLinux-9`.

> If you try to install a distro that is already installed, the installation process will fail:

```text
Downloading: AlmaLinux OS 9
Installing: AlmaLinux OS 9
A distribution with the supplied name already exists. Use --name to choose a different name.
Error code: Wsl/InstallDistro/Service/RegisterDistro/ERROR_ALREADY_EXISTS
```

Install the AlmaLinux9 distro by executing the below command:

```shell
wsl --install -d AlmaLinux-9
```

You should see the download progress - once finished, the output should look like this:
You should see the download progress-once finished, the output should look like this:

```text
Downloading: AlmaLinux OS 9
Expand All @@ -101,7 +111,7 @@ Changing password for user dotkernel.
New password:
```

Depending on the strength of your password, you might get a `BAD PASSWORD: <some-reason>` message (if you want to choose a different password, hit `Enter` and you are taken back to previous step - else, continue with retyping your password):
Depending on the strength of your password, you might get a `BAD PASSWORD: <some-reason>` message (if you want to choose a different password, hit `Enter` and you are taken back to the previous stepelse, continue with retyping your password):

Next, you are asked to retype your password:

Expand Down
21 changes: 21 additions & 0 deletions wsl/roles/system/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,24 @@
template:
src: bash_profile.j2
dest: "{{ bash_profile_dest }}"
- name: Add create runtime directories script
template:
src: runtime-directories.sh.j2
dest: "{{ runtime_directories_script_path }}"
mode: "0755"
- name: Add create runtime directories service
template:
src: runtime-directories.service.j2
dest: "{{ runtime_directories_service_path }}"
mode: "0755"
- name: Reload systemd
ansible.builtin.systemd:
daemon_reload: yes
- name: Enable runtime-directories.service
ansible.builtin.systemd:
name: runtime-directories.service
enabled: yes
- name: Start runtime-directories.service
ansible.builtin.systemd:
name: runtime-directories.service
state: started
13 changes: 13 additions & 0 deletions wsl/roles/system/templates/runtime-directories.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Create runtime directories for Apache and MariaDB
DefaultDependencies=no
After=local-fs.target
Before=httpd.service mariadb.service

[Service]
Type=oneshot
ExecStart={{ runtime_directories_script_path }}
RemainAfterExit=true

[Install]
WantedBy=multi-user.target
8 changes: 8 additions & 0 deletions wsl/roles/system/templates/runtime-directories.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

# Create /run/httpd with correct ownership and permissions
install -d -o apache -g apache -m 0755 /run/httpd

# Create /run/mariadb with correct ownership and permissions
install -d -o mysql -g mysql -m 0755 /run/mariadb
2 changes: 2 additions & 0 deletions wsl/roles/system/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
wsl_config_dest: /etc/wsl.conf
bash_profile_dest: "/home/{{ config.system.username }}/.bash_profile"
runtime_directories_script_path: "/usr/local/bin/runtime-directories.sh"
runtime_directories_service_path: "/etc/systemd/system/runtime-directories.service"