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
35 changes: 34 additions & 1 deletion docs/book/v1/setup/installation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
# Install AlmaLinux9

Before proceeding with the installation, we need to make sure that no other WSL2 distribution (aka: _distro_) is running.
This is important because this installation will fail if required ports are already in use by another distro.

Open `Windows Terminal`.

List the available Linux distributions (aka: _distros_) by executing:
## Stop other WSL2 distros

List all installed distros:

```shell
wsl -l -v
```

If there is no other distro installed, you will see the below output (an empty list):

```text
NAME STATE VERSION
```

In this case, you can jump to the [installation](#install-almalinux9-1) section.

If you have other distros installed, the output could look similar to the below:

```text
NAME STATE VERSION
* AlmaLinux-9 Stopped 2
* AlmaLinux-10 Running 2
```

Make sure that the **STATE** column reads **Stopped** for all distros.
If any of them reads **Running**, you must stop if first by executing `wsl -t <distro-name>`, for example: `wsl -t AlmaLinux-10`.
Once you have stopped all distros, you can continue to the [installation](#install-almalinux9-1) section.

## Install AlmaLinux9

List the available Linux distros by executing:

```shell
wsl --list --online
Expand Down
35 changes: 34 additions & 1 deletion docs/book/v2/setup/installation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
# Install AlmaLinux10

Before proceeding with the installation, we need to make sure that no other WSL2 distribution (aka: _distro_) is running.
This is important because this installation will fail if required ports are already in use by another distro.

Open `Windows Terminal`.

List the available Linux distributions (aka: _distros_) by executing:
## Stop other WSL2 distros

List all installed distros:

```shell
wsl -l -v
```

If there is no other distro installed, you will see the below output (an empty list):

```text
NAME STATE VERSION
```

In this case, you can jump to the [installation](#install-almalinux10-1) section.

If you have other distros installed, the output could look similar to the below:

```text
NAME STATE VERSION
* AlmaLinux-8 Stopped 2
* AlmaLinux-9 Running 2
```

Make sure that the **STATE** column reads **Stopped** for all distros.
If any of them reads **Running**, you must stop if first by executing `wsl -t <distro-name>`, for example: `wsl -t AlmaLinux-9`.
Once you have stopped all distros, you can continue to the [installation](#install-almalinux10-1) section.

## Install AlmaLinux10

List the available Linux distros by executing:

```shell
wsl --list --online
Expand Down
2 changes: 1 addition & 1 deletion docs/book/v2/setup/setup-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Update/Upgrade system packages:
sudo dnf upgrade -y
```

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

```shell
sudo dnf install ansible-core -y
Expand Down
45 changes: 43 additions & 2 deletions wsl/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
# Install AlmaLinux10

Before proceeding with the installation, we need to make sure that no other WSL2 distribution (aka: _distro_) is running.
This is important because this installation will fail if required ports are already in use by another distro.

Open `Windows Terminal`.

List the available Linux distributions (aka: _distros_) by executing:
## Stop other WSL2 distros

List all installed distros:

```shell
wsl -l -v
```

If there is no other distro installed, you will see the below output (an empty list):

```text
NAME STATE VERSION
```

In this case, you can jump to the [installation](#install-almalinux10-1) section.

If you have other distros installed, the output could look similar to the below:

```text
NAME STATE VERSION
* AlmaLinux-8 Stopped 2
* AlmaLinux-9 Running 2
```

Make sure that the **STATE** column reads **Stopped** for all distros.
If any of them reads **Running**, you must stop if first by executing `wsl -t <distro-name>`, for example: `wsl -t AlmaLinux-9`.
Once you have stopped all distros, you can continue to the [installation](#install-almalinux10-1) section.

## Install AlmaLinux10

List the available Linux distros by executing:

```shell
wsl --list --online
Expand Down Expand Up @@ -39,6 +72,14 @@ 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-10`.

> If you try to install a distro that is already installed, the installation process will fail:
>
> Downloading: AlmaLinux OS 10
> Installing: AlmaLinux OS 10
> 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 AlmaLinux10 distro by executing the below command:

```shell
Expand Down Expand Up @@ -112,7 +153,7 @@ Update/Upgrade system packages:
sudo dnf upgrade -y
```

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

```shell
sudo dnf install ansible-core -y
Expand Down
3 changes: 2 additions & 1 deletion wsl/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
vars_files:
- ./config.yml
- ./roles/apache/vars/main.yml
- ./roles/system/vars/main.yml
tasks:
- name: Install and configure packages
include_role:
name: "{{ role }}"
tasks_from: main
loop:
- system
- apache
- php
- mariadb
- phpmyadmin
- system
- composer
- nodejs
- git
Expand Down
2 changes: 2 additions & 0 deletions wsl/roles/git/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
value: "{{ item.value }}"
scope: global
with_dict: "{{ git_config }}"
become: false
- name: Apply global user configurations
git_config:
name: "{{ item.key }}"
value: "{{ item.value }}"
scope: global
with_dict: "{{ config.git.config }}"
become: false
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"