From bbf1eaf0028f0d9a068e0c4462a5da6431712de8 Mon Sep 17 00:00:00 2001 From: alexmerlin Date: Fri, 6 Jun 2025 17:51:20 +0300 Subject: [PATCH 1/2] Issue #58: Implement one distro per branch structure Signed-off-by: alexmerlin --- README.md | 61 +++++- docs/book/v1/faq.md | 2 +- docs/book/v1/setup/installation.md | 71 ++++-- docs/book/v1/setup/setup-packages.md | 76 +++---- docs/book/v1/setup/system-requirements.md | 25 ++- .../v1/virtualhosts/create-virtualhost.md | 6 +- wsl/README.md | 202 ++++++++++++++++-- wsl/create-virtualhost.yml | 24 +-- wsl/hosts | 2 +- wsl/install.yml | 37 ++-- wsl/os/almalinux9/FAQ.md | 192 ----------------- wsl/os/almalinux9/README.md | 201 ----------------- wsl/os/almalinux9/create-virtualhost.yml | 11 - wsl/os/almalinux9/install.yml | 40 ---- wsl/os/almalinux9/roles/system/tasks/main.yml | 21 -- .../roles/system/templates/wsl.conf.j2 | 2 - .../roles/apache/tasks/main.yml | 0 .../roles/apache/vars/main.yml | 0 .../roles/composer/tasks/main.yml | 0 .../roles/composer/vars/main.yml | 0 .../almalinux9 => }/roles/git/tasks/main.yml | 0 .../almalinux9 => }/roles/git/vars/main.yml | 0 .../roles/mariadb/tasks/main.yml | 0 .../roles/mariadb/templates/MariaDB.repo.j2 | 0 .../roles/mariadb/vars/main.yml | 0 .../roles/nodejs/tasks/main.yml | 0 .../almalinux9 => }/roles/php/tasks/main.yml | 0 .../roles/php/templates/info.php.j2 | 0 .../almalinux9 => }/roles/php/vars/main.yml | 0 .../roles/phpmyadmin/tasks/main.yml | 0 wsl/roles/system/tasks/main.yml | 24 +++ .../roles/system/templates/bash_profile.j2 | 0 .../roles/system/vars/main.yml | 0 .../roles/virtualhost/tasks/create.yml | 4 +- .../roles/virtualhost/tasks/default.yml | 0 .../roles/virtualhost/tasks/main.yml | 0 .../virtualhost/templates/default.conf.j2 | 0 .../virtualhost/templates/virtualhost.conf.j2 | 0 38 files changed, 402 insertions(+), 599 deletions(-) delete mode 100644 wsl/os/almalinux9/FAQ.md delete mode 100644 wsl/os/almalinux9/README.md delete mode 100644 wsl/os/almalinux9/create-virtualhost.yml delete mode 100644 wsl/os/almalinux9/install.yml delete mode 100644 wsl/os/almalinux9/roles/system/tasks/main.yml delete mode 100644 wsl/os/almalinux9/roles/system/templates/wsl.conf.j2 rename wsl/{os/almalinux9 => }/roles/apache/tasks/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/apache/vars/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/composer/tasks/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/composer/vars/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/git/tasks/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/git/vars/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/mariadb/tasks/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/mariadb/templates/MariaDB.repo.j2 (100%) rename wsl/{os/almalinux9 => }/roles/mariadb/vars/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/nodejs/tasks/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/php/tasks/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/php/templates/info.php.j2 (100%) rename wsl/{os/almalinux9 => }/roles/php/vars/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/phpmyadmin/tasks/main.yml (100%) create mode 100644 wsl/roles/system/tasks/main.yml rename wsl/{os/almalinux9 => }/roles/system/templates/bash_profile.j2 (100%) rename wsl/{os/almalinux9 => }/roles/system/vars/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/virtualhost/tasks/create.yml (94%) rename wsl/{os/almalinux9 => }/roles/virtualhost/tasks/default.yml (100%) rename wsl/{os/almalinux9 => }/roles/virtualhost/tasks/main.yml (100%) rename wsl/{os/almalinux9 => }/roles/virtualhost/templates/default.conf.j2 (100%) rename wsl/{os/almalinux9 => }/roles/virtualhost/templates/virtualhost.conf.j2 (100%) diff --git a/README.md b/README.md index 8c12052..a7b31f0 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,60 @@ -# Development environment +# WSL2 development environment -This is a collection of Ansible scripts allowing the creation and maintenance of your WSL2 development environment. +This is a collection of Ansible scripts helping with the creation and maintenance of your WSL2 development environment. -## Prerequisites +If you're not already using it, we recommend you to install [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701?hl=en-US&gl=US). +It is a modern tool that incorporates the power of multiple already known command-line applications like `Windows PowerShell`, `Linux shell`, and more... -If you're not already using it, we recommend you to install [Windows Terminal](https://www.microsoft.com/en-US/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab). +## Check if WLS2 is already available -It's a modern tool that incorporates the power of multiple already known command-line applications like `Windows PowerShell`, `Linux shell`, and more... +Open `Windows Terminal` and execute the following command: -## Setup +```shell +wsl -v +``` -Go to the [WSL2](wsl/README.md) setup page. +The output should look similar to this: + +```text +WSL version: 2.2.4.0 +Kernel version: 5.15.153.1-2 +WSLg version: 1.0.61 +MSRDC version: 1.2.5326 +Direct3D version: 1.611.1-81528511 +DXCore version: 10.0.26091.1-240325-1447.ge-release +Windows version: 10.0.22631.3737 +``` + +If the output starts with `WSL version: 2.x.x.x`, you are ready to use **WSL2** and can proceed to [install AlmaLinux9](wsl/README.md). + +## Install WSL2 + +Before proceeding with the installation, please consult Microsoft's [documentation](https://learn.microsoft.com/en-us/windows/wsl/install#prerequisites) regarding the minimum requirements for running WSL2. + +Once you identified that your machine can run WSL2, open the `Run` prompt by pressing `Win` + `r`, type `OptionalFeatures` in the dialog and press `Enter`. +This will open a window where you can turn Windows features on/off. +Make sure that the below features are activated (checked): + +* `Hyper-V` (including its sub-features) +* `Virtual Machine Platform` +* `Windows Subsystem for Linux` + +> If any of the above features are missing, then first you need to install them manually using [this guide](https://docs.microsoft.com/en-us/windows/wsl/install-manual) and then continue with the below steps. + +Click `Ok` and restart your computer. + +Open Microsoft Store, search for `Windows Subsystem for Linux` and install it. + +Make sure that version **2** of WSL is set as default by executing the below command in Windows Terminal: + +```shell +wsl --set-default-version 2 +``` + +To test, run again the following command: + +```shell +wsl -v +``` + +This time the output should display `WSL version: 2.x.x.x`, which means that your system is ready for using **WSL2** and you can proceed to [install AlmaLinux9](wsl/README.md). diff --git a/docs/book/v1/faq.md b/docs/book/v1/faq.md index 442ceda..604a9af 100644 --- a/docs/book/v1/faq.md +++ b/docs/book/v1/faq.md @@ -16,7 +16,7 @@ The aliases are the following: * `php81`: switch to PHP 8.1 * `php82`: switch to PHP 8.2 * `php83`: switch to PHP 8.3 -* `php83`: switch to PHP 8.4 +* `php84`: switch to PHP 8.4 After switching to a different PHP version, test with the following command: diff --git a/docs/book/v1/setup/installation.md b/docs/book/v1/setup/installation.md index b6f5ec3..08bdbc3 100644 --- a/docs/book/v1/setup/installation.md +++ b/docs/book/v1/setup/installation.md @@ -1,38 +1,74 @@ -# Installation +# Install AlmaLinux9 -## Install AlmaLinux9 +Open `Windows Terminal`. -Open Microsoft Store, in the search box type in: `AlmaLinux` and hit `Enter`. +List the available Linux distributions (aka: _distros_) by executing: -From the results, select **AlmaLinux OS 9** this will take you to **AlmaLinux9**'s app page. +```shell +wsl --list --online +``` + +Depending on the list of distros available at the moment you run the command, the output should look similar to the below: + +```text +The following is a list of valid distributions that can be installed. +Install using 'wsl.exe --install '. + +NAME FRIENDLY NAME +AlmaLinux-8 AlmaLinux OS 8 +AlmaLinux-9 AlmaLinux OS 9 +AlmaLinux-Kitten-10 AlmaLinux OS Kitten 10 +AlmaLinux-10 AlmaLinux OS 10 +Debian Debian GNU/Linux +FedoraLinux-42 Fedora Linux 42 +SUSE-Linux-Enterprise-15-SP5 SUSE Linux Enterprise 15 SP5 +SUSE-Linux-Enterprise-15-SP6 SUSE Linux Enterprise 15 SP6 +Ubuntu Ubuntu +Ubuntu-24.04 Ubuntu 24.04 LTS +archlinux Arch Linux +kali-linux Kali Linux Rolling +openSUSE-Tumbleweed openSUSE Tumbleweed +openSUSE-Leap-15.6 openSUSE Leap 15.6 +Ubuntu-18.04 Ubuntu 18.04 LTS +Ubuntu-20.04 Ubuntu 20.04 LTS +Ubuntu-22.04 Ubuntu 22.04 LTS +OracleLinux_7_9 Oracle Linux 7.9 +OracleLinux_8_7 Oracle Linux 8.7 +OracleLinux_9_1 Oracle Linux 9.1 +``` -On this page, locate and click the `Install` button - this will download **AlmaLinux9** WSL2 image on your system. +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`. +Install the AlmaLinux9 distro by executing the below command: -Once the download has finished, the `Install` button is replaced by an `Open` button - clicking it will open `Windows Terminal`. +```shell +wsl --install -d AlmaLinux-9 +``` -Here you will be asked to fill in your username (for example `dotkernel`): +You should see the download progress - once finished, the output should look like this: ```text -Installing, this may take a few minutes... +Downloading: AlmaLinux OS 9 +Installing: AlmaLinux OS 9 +Distribution successfully installed. It can be launched via 'wsl.exe -d AlmaLinux-9' +Launching AlmaLinux-9... Please create a default UNIX user account. The username does not need to match your Windows username. For more information visit: https://aka.ms/wslusers Enter new UNIX username: ``` -Next, you are prompted to enter a password to use with your username (you will not see what you are typing, that's a security measure in Linux regarding passwords): +As per the last line, the installation process now prompts you to enter a username. +This is the username you will use inside AlmaLinux9, and it can be any alphanumeric string (for example `dotkernel`): -```text +Next, you are prompted to change the password associated with your chosen username (you will not see what you are typing, that's a security measure in Linux regarding passwords): + +```shell Enter new UNIX username: dotkernel. Changing password for user dotkernel. New password: ``` -Depending on the strength of your password, you might see one of the following messages (if you want to choose a different password, hit `Enter` and you are taken back to previous step - else, continue with retyping your password). - -```text -BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word -BAD PASSWORD: The password is a palindrome -``` +Depending on the strength of your password, you might get a `BAD PASSWORD: ` 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): Next, you are asked to retype your password: @@ -44,6 +80,5 @@ Finally, you should see the following message: ```text passwd: all authentication tokens updated successfully. -Installation successful! -[dotkernel@hostname:~]$ +[@ ]$ ``` diff --git a/docs/book/v1/setup/setup-packages.md b/docs/book/v1/setup/setup-packages.md index 8ff6df7..d1b2fd2 100644 --- a/docs/book/v1/setup/setup-packages.md +++ b/docs/book/v1/setup/setup-packages.md @@ -1,97 +1,97 @@ -# Setup the packages in AlmaLinux9 +# Setup AlmaLinux9 -Install system requirements: +Install system packages: ```shell sudo dnf install epel-release dnf-utils https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y ``` -Update/Upgrade system packages: +You should see the below message, shown the first time you execute a command which requires elevated permissions (hence the `sudo` modifier at the beginning of the command). -```shell -sudo dnf upgrade -y -``` +```text +We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: -Now, install the latest version of **Ansible**: + #1) Respect the privacy of others. + #2) Think before you type. + #3) With great power comes great responsibility. -```shell -sudo dnf install ansible -y +[sudo] password for dotkernel: ``` -Clone `dotkernel/development` into your home directory: +Input your AlmaLinux9 password and hit `Enter`. + +Update/Upgrade system packages: ```shell -git clone https://github.com/dotkernel/development.git +sudo dnf upgrade -y ``` -Move inside the directory `development/wsl`: +Now, install the latest version of **Ansible**: ```shell -cd ~/development/wsl/ +sudo dnf install ansible -y ``` -Duplicate `config.yml.dist` as `config.yml`. - -Using your preferred text editor, open `config.yml` and fill in the empty fields. - -Save and close the file. - -Install requirements and initialize systemd by running the below Ansible command: +Move inside your home directory (it is `/home/` followed by your AlmaLinux9 username, for example: `/home/dotkernel`): ```shell -ansible-playbook -i hosts install.yml --ask-become-pass +cd ~ ``` -The installation process will ask for your password (set during the installation process) and will iterate over each task in the playbook and will output a short summary with the results. - -At this step, **AlmaLinux9** needs to be restarted; quit it by pressing `Control` + `d`. - -Open `Windows Terminal`. - -Stop **AlmaLinux9**: +Clone the `almalinux9` branch of the `dotkernel/development` repository: ```shell -wsl -t AlmaLinux9 +git clone --branch almalinux9 --single-branch https://github.com/dotkernel/development.git ``` -Start **AlmaLinux9**: +Move inside the directory `development/wsl`: ```shell -wsl -d AlmaLinux9 +cd development/wsl/ ``` -Move inside the directory `development/wsl`: +Duplicate `config.yml.dist` as `config.yml`: ```shell -cd ~/development/wsl/ +cp config.yml.dist config.yml ``` -Continue the installation by running the below Ansible command: +Using your preferred text editor, open `config.yml` and fill in the empty fields. +Save and close the file. + +Install components by running the below Ansible command: ```shell ansible-playbook -i hosts install.yml --ask-become-pass ``` -The installation process will ask for your password (set during the installation process) and will iterate over each task in the playbook and will output a short summary with the results. +The installation process will ask for your AlmaLinux9 password, then iterate over each task in the playbook and output a short summary with the results. -Now check if everything works by opening in your browser: +Once finished, check if everything works by opening in your browser: * [http://localhost/](http://localhost/): Apache's default home page * [http://localhost/info.php](http://localhost/info.php): PHP info page * [http://localhost/phpmyadmin/](http://localhost/phpmyadmin/): PhpMyAdmin (login with `root` + the root password you configured in `config.yml` under `mariadb` -> `root_password`) -The installation is complete, your **AlmaLinux9** development environment is ready to use. +The installation is complete, your AlmaLinux9 development environment is ready to use. + +> Restart your `Windows Terminal` to find a new option in the tab selector, called **AlmaLinux-9** - clicking it will open a new tab connected to **AlmaLinux9**. ## Running AlmaLinux9 Open `Windows Terminal`. -Start **AlmaLinux9**: +Start AlmaLinux9 by executing: ```shell wsl -d AlmaLinux9 ``` +OR + +Locate the app selector dropdown in `Windows Terminal`'s title bar and click `AlmaLinux-9`. +This will open a new tab connected to AlmaLinux9. + ### Note > To run your applications using WSL2, you always need to be connected to your AlmaLinux9 distribution. diff --git a/docs/book/v1/setup/system-requirements.md b/docs/book/v1/setup/system-requirements.md index 9c41426..1191920 100644 --- a/docs/book/v1/setup/system-requirements.md +++ b/docs/book/v1/setup/system-requirements.md @@ -1,6 +1,11 @@ -# System Requirements +# System requirements -First, you need to check if your system is ready for using **WSL2**. Open `Windows Terminal` and execute the following command: +If you're not already using it, we recommend you to install [Windows Terminal](https://apps.microsoft.com/detail/9n0dx20hk701?hl=en-US&gl=US). +It is a modern tool that incorporates the power of multiple already known command-line applications like `Windows PowerShell`, `Linux shell`, and more... + +## Check if WLS2 is already available + +Open `Windows Terminal` and execute the following command: ```shell wsl -v @@ -18,17 +23,15 @@ DXCore version: 10.0.26091.1-240325-1447.ge-release Windows version: 10.0.22631.3737 ``` -If the output starts with `WSL version: 2.x`, you are ready to use **WSL2** and can continue with [the installation](installation.md). +If the output starts with `WSL version: 2.x.x.x`, you are ready to use **WSL2** and can proceed to [install AlmaLinux9](installation.md). -Else, you need to install **WSL2** and its components as shown below. +## Install WSL2 -Before proceeding with the installation, please consult Microsoft's [documentation](https://learn.microsoft.com/en-us/windows/wsl/install#prerequisites) regarding the minimum requirements for running **WSL2**. - -Once you know that your system can run **WSL2**, open the `Run` prompt by pressing `Win`+`r` and type in the dialog `OptionalFeatures`, then press `Enter`. +Before proceeding with the installation, please consult Microsoft's [documentation](https://learn.microsoft.com/en-us/windows/wsl/install#prerequisites) regarding the minimum requirements for running WSL2. +Once you identified that your machine can run WSL2, open the `Run` prompt by pressing `Win` + `r`, type `OptionalFeatures` in the dialog and press `Enter`. This will open a window where you can turn Windows features on/off. - -Make sure the next features are activated (checked): +Make sure that the below features are activated (checked): * `Hyper-V` (including its sub-features) * `Virtual Machine Platform` @@ -40,7 +43,7 @@ Click `Ok` and restart your computer. Open Microsoft Store, search for `Windows Subsystem for Linux` and install it. -Make sure **WSL2** is set as default by executing the below command in `Windows Terminal`: +Make sure that version **2** of WSL is set as default by executing the below command in Windows Terminal: ```shell wsl --set-default-version 2 @@ -52,4 +55,4 @@ To test, run again the following command: wsl -v ``` -This time the output should display `WSL version: 2.x`, which means that your system is ready for using **WSL2** and you can continue with the [installation](installation.md). +This time the output should display `WSL version: 2.x.x.x`, which means that your system is ready for using **WSL2** and you can proceed to [install AlmaLinux9](installation.md). diff --git a/docs/book/v1/virtualhosts/create-virtualhost.md b/docs/book/v1/virtualhosts/create-virtualhost.md index f93f49b..de66f92 100644 --- a/docs/book/v1/virtualhosts/create-virtualhost.md +++ b/docs/book/v1/virtualhosts/create-virtualhost.md @@ -35,6 +35,6 @@ You will install your project under the `html` directory of your project, for ex * To run your installed projects, you need to start AlmaLinux9 first. * If you work with virtualhosts, your projects are created under `/var/www/`. * You can still run PHP scripts under the default Apache project directory, located at `/var/www/html/`. -* If you encounter write permission issues, see [this guide](../faq.md#how-do-i-fix-common-permission-issues). -* This tool installs PHP 8.3 by default. If you need a different version, see [this guide](../faq.md#how-do-i-switch-to-a-different-version-of-php). -* This tool installs Node.js 22 by default. If you need a different version, see [this guide](../faq.md#how-do-i-switch-to-a-different-version-of-nodejs). +* If you encounter write permission issues, see [this guide](https://docs.dotkernel.org/development/almalinux9/faq/#how-do-i-fix-common-permission-issues). +* We install PHP 8.3 by default - if you need a different version, see [this guide](https://docs.dotkernel.org/development/almalinux9/faq/#how-do-i-switch-to-a-different-version-of-php). +* We install Node.js 22 by default - if you need a different version, see [this guide](https://docs.dotkernel.org/development/almalinux9/faq/#how-do-i-switch-to-a-different-version-of-nodejs). diff --git a/wsl/README.md b/wsl/README.md index 3964fc9..3b1b8cd 100644 --- a/wsl/README.md +++ b/wsl/README.md @@ -1,33 +1,201 @@ -# Install WSL2 development environment +# Install AlmaLinux9 -[< Back](../README.md) +Open `Windows Terminal`. -## Prerequisites +List the available Linux distributions (aka: _distros_) by executing: -Before proceeding with the installation, please consult Microsoft's [documentation](https://learn.microsoft.com/en-us/windows/wsl/install#prerequisites) regarding the minimum requirements for running WSL2. +```shell +wsl --list --online +``` + +Depending on the list of distros available at the moment you run the command, the output should look similar to the below: + +```text +The following is a list of valid distributions that can be installed. +Install using 'wsl.exe --install '. + +NAME FRIENDLY NAME +AlmaLinux-8 AlmaLinux OS 8 +AlmaLinux-9 AlmaLinux OS 9 +AlmaLinux-Kitten-10 AlmaLinux OS Kitten 10 +AlmaLinux-10 AlmaLinux OS 10 +Debian Debian GNU/Linux +FedoraLinux-42 Fedora Linux 42 +SUSE-Linux-Enterprise-15-SP5 SUSE Linux Enterprise 15 SP5 +SUSE-Linux-Enterprise-15-SP6 SUSE Linux Enterprise 15 SP6 +Ubuntu Ubuntu +Ubuntu-24.04 Ubuntu 24.04 LTS +archlinux Arch Linux +kali-linux Kali Linux Rolling +openSUSE-Tumbleweed openSUSE Tumbleweed +openSUSE-Leap-15.6 openSUSE Leap 15.6 +Ubuntu-18.04 Ubuntu 18.04 LTS +Ubuntu-20.04 Ubuntu 20.04 LTS +Ubuntu-22.04 Ubuntu 22.04 LTS +OracleLinux_7_9 Oracle Linux 7.9 +OracleLinux_8_7 Oracle Linux 8.7 +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`. +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: + +```text +Downloading: AlmaLinux OS 9 +Installing: AlmaLinux OS 9 +Distribution successfully installed. It can be launched via 'wsl.exe -d AlmaLinux-9' +Launching AlmaLinux-9... +Please create a default UNIX user account. The username does not need to match your Windows username. +For more information visit: https://aka.ms/wslusers +Enter new UNIX username: +``` + +As per the last line, the installation process now prompts you to enter a username. +This is the username you will use inside AlmaLinux9, and it can be any alphanumeric string (for example `dotkernel`): + +Next, you are prompted to change the password associated with your chosen username (you will not see what you are typing, that's a security measure in Linux regarding passwords): + +```shell +Enter new UNIX username: dotkernel. +Changing password for user dotkernel. +New password: +``` + +Depending on the strength of your password, you might get a `BAD PASSWORD: ` 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): + +Next, you are asked to retype your password: + +```text +Retype new password: +``` + +Finally, you should see the following message: + +```text +passwd: all authentication tokens updated successfully. +[@ ]$ +``` + +## Setup AlmaLinux9 + +Install system packages: + +```shell +sudo dnf install epel-release dnf-utils https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y +``` + +You should see the below message, shown the first time you execute a command which requires elevated permissions (hence the `sudo` modifier at the beginning of the command). + +```text +We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: + + #1) Respect the privacy of others. + #2) Think before you type. + #3) With great power comes great responsibility. + +[sudo] password for dotkernel: +``` + +Input your AlmaLinux9 password and hit `Enter`. + +Update/Upgrade system packages: -Once you know that your machine can run WSL2, open the `Run` prompt by pressing `Win`+`r` and type in the dialog `OptionalFeatures`, then press `Enter`. +```shell +sudo dnf upgrade -y +``` -This will open a window where you can turn Windows features on/off. +Now, install the latest version of **Ansible**: -Make sure the next features are activated (checked): +```shell +sudo dnf install ansible -y +``` -* `Hyper-V` (including its sub-features) -* `Virtual Machine Platform` -* `Windows Subsystem for Linux` +Move inside your home directory (it is `/home/` followed by your AlmaLinux9 username, for example: `/home/dotkernel`): -> If any of the above features are missing, then first you need to install them manually using [this guide](https://docs.microsoft.com/en-us/windows/wsl/install-manual) and then continue with the below steps. +```shell +cd ~ +``` -Click `Ok` and restart your computer. +Clone the `almalinux9` branch of the `dotkernel/development` repository: -Open Microsoft Store, search for `Windows Subsystem for Linux` and install it. +```shell +git clone --branch almalinux9 --single-branch https://github.com/dotkernel/development.git +``` -Make sure WSL2 is set as default by executing the below command in Windows Terminal: +Move inside the directory `development/wsl`: ```shell -wsl --set-default-version 2 +cd development/wsl/ ``` -## Choose the Operating System you want to use for development: +Duplicate `config.yml.dist` as `config.yml`: + +```shell +cp config.yml.dist config.yml +``` + +Using your preferred text editor, open `config.yml` and fill in the empty fields. +Save and close the file. + +Install components by running the below Ansible command: + +```shell +ansible-playbook -i hosts install.yml --ask-become-pass +``` + +The installation process will ask for your AlmaLinux9 password, then iterate over each task in the playbook and output a short summary with the results. + +Once finished, check if everything works by opening in your browser: + +* [http://localhost/](http://localhost/): Apache's default home page +* [http://localhost/info.php](http://localhost/info.php): PHP info page +* [http://localhost/phpmyadmin/](http://localhost/phpmyadmin/): PhpMyAdmin (login with `root` + the root password you configured in `config.yml` under `mariadb` -> `root_password`) + +The installation is complete, your AlmaLinux9 development environment is ready to use. + +> Restart your `Windows Terminal` to find a new option in the tab selector, called **AlmaLinux-9** - clicking it will open a new tab connected to **AlmaLinux9**. + +## Create virtualhosts + +> By using the `*.localhost` pattern for any new virtualhost, you do not need to modify the `hosts` file in Windows, because these are routed by default. + +Move inside the directory `development/wsl`: + +```shell +cd ~/development/wsl/ +``` + +Using your preferred text editor, open `config.yml` and, under the `virtualhosts` key, enter the virtualhosts that you want to create, each on its own line. +Already existing ones will be skipped, no need to comment or remove them. +Save and close the file. + +Create the specified virtualhosts: + +```shell +ansible-playbook -i hosts create-virtualhost.yml --ask-become-pass +``` + +This will iterate over the list of configured `virtualhosts` and will output a short summary with the results. +Your virtualhost should be accessible and ready to use. + +You will install your project under the `html` directory of your project, for example: `/var/www/example.localhost/html`. + +> The virtualhost's document root is set to the `public` directory of the above location, for example `/var/www/example.localhost/html/public`. + +> If you want to have the DocumentRoot directly in `html` folder, you need to modify the file `/etc/httpd/sites-available/example.localhost`. + +### Good to know -* [AlmaLinux9](os/almalinux9/README.md) +* To run your installed projects, you need to start AlmaLinux9 first. +* If you work with virtualhosts, your projects are created under `/var/www/`. +* You can still run PHP scripts under the default Apache project directory, located at `/var/www/html/`. +* If you encounter write permission issues, see [this guide](https://docs.dotkernel.org/development/almalinux9/faq/#how-do-i-fix-common-permission-issues). +* We install PHP 8.3 by default - if you need a different version, see [this guide](https://docs.dotkernel.org/development/almalinux9/faq/#how-do-i-switch-to-a-different-version-of-php). +* We install Node.js 22 by default - if you need a different version, see [this guide](https://docs.dotkernel.org/development/almalinux9/faq/#how-do-i-switch-to-a-different-version-of-nodejs). diff --git a/wsl/create-virtualhost.yml b/wsl/create-virtualhost.yml index 98196d3..882dbdd 100644 --- a/wsl/create-virtualhost.yml +++ b/wsl/create-virtualhost.yml @@ -1,23 +1,11 @@ --- -- name: Create new virtualhost +- name: Create new virtualhost under AlmaLinux9 hosts: localhost connection: local become: true gather_facts: true - tasks: - - name: Identify operating system - set_fact: os="{{ ansible_distribution|lower }}{{ ansible_distribution_major_version }}" - - name: Find supported Operating Systems (Step 1) - find: - paths: "{{ playbook_dir }}/os" - file_type: directory - register: os_list - - name: Find supported Operating Systems (Step 2) - set_fact: - os_list="{{ os_list.files | map(attribute='path') | map('basename') | list }}" - - name: Halt execution if OS is not supported - assert: - that: os in os_list - msg: "Operating System '{{ ansible_distribution }} {{ ansible_distribution_major_version }}' is not supported" -- import_playbook: "{{ playbook_dir }}/os/almalinux9/create-virtualhost.yml" - when: os == "almalinux9" + vars_files: + - ./config.yml + - ./roles/apache/vars/main.yml + roles: + - virtualhost diff --git a/wsl/hosts b/wsl/hosts index d18580b..2fbb50c 100644 --- a/wsl/hosts +++ b/wsl/hosts @@ -1 +1 @@ -localhost \ No newline at end of file +localhost diff --git a/wsl/install.yml b/wsl/install.yml index daa0e43..3e2d7f8 100644 --- a/wsl/install.yml +++ b/wsl/install.yml @@ -1,23 +1,26 @@ --- -- name: Setup development environment +- name: Setup AlmaLinux9 development environment hosts: localhost connection: local become: true gather_facts: true + vars_files: + - ./config.yml + - ./roles/apache/vars/main.yml tasks: - - name: Identify operating system - set_fact: os="{{ ansible_distribution|lower }}{{ ansible_distribution_major_version }}" - - name: Find supported Operating Systems (Step 1) - find: - paths: "{{ playbook_dir }}/os" - file_type: directory - register: os_list - - name: Find supported Operating Systems (Step 2) - set_fact: - os_list="{{ os_list.files | map(attribute='path') | map('basename') | list }}" - - name: Halt execution if OS is not supported - assert: - that: os in os_list - msg: "Operating System '{{ ansible_distribution }} {{ ansible_distribution_major_version }}' is not supported" -- import_playbook: "{{ playbook_dir }}/os/almalinux9/install.yml" - when: os == "almalinux9" + - name: Install and configure packages + include_role: + name: "{{ role }}" + tasks_from: main + loop: + - system + - apache + - php + - mariadb + - phpmyadmin + - composer + - nodejs + - git + - virtualhost + loop_control: + loop_var: role diff --git a/wsl/os/almalinux9/FAQ.md b/wsl/os/almalinux9/FAQ.md deleted file mode 100644 index 6314497..0000000 --- a/wsl/os/almalinux9/FAQ.md +++ /dev/null @@ -1,192 +0,0 @@ -# Frequently Asked Questions - -## How do I switch to a different version of PHP? - -Execute the following command: - -```shell -sudo dnf module switch-to php:remi-{major}.{minor} -y -``` - -where `{major}.{minor}` is one of the supported PHP versions: `8.4`, `8.3`, `8.2` and `8.1`. - -Additionally, our setup includes predefined aliases for executing the above command. -The aliases are the following: - -* `php81`: switch to PHP 8.1 -* `php82`: switch to PHP 8.2 -* `php83`: switch to PHP 8.3 -* `php84`: switch to PHP 8.4 - -After switching to a different PHP version, test with the following command: - -```shell -php -v -``` - -Depending on the selected PHP version, the output should look similar to the below: - -```text -PHP 8.3.8 (cli) (built: Jun 4 2024 14:53:17) (NTS gcc x86_64) -Copyright (c) The PHP Group -Zend Engine v4.3.8, Copyright (c) Zend Technologies -``` - -## How do I switch to a different version of Node.js? - -Execute the following commands: - -```shell -sudo dnf remove nodejs -y -curl -fsSL https://rpm.nodesource.com/setup_{major}.x | sudo bash - -sudo dnf install nodejs -y -``` - -where `{major}` is the Node.js version you want to switch to. - -Additionally, our setup includes predefined aliases for the above commands. -The aliases are the following: - -* `node22`: switch to Node.js 22 -* `node20`: switch to Node.js 20 -* `node18`: switch to Node.js 18 - -After switching to a different Node.js version, test with the following command: - -```shell -node -v -``` - -## How do I fix common permission issues? - -If running your project, you encounter permission issues, follow the below steps. - -### Error - -> PHP Fatal error: Uncaught InvalidArgumentException: The directory "``/data" is not writable... - -> PHP Fatal error: Uncaught InvalidArgumentException: The directory "``/data/cache" is not writable... - -> PHP Fatal error: Uncaught InvalidArgumentException: The directory "``/data/cache/doctrine" is not writable... - -### Solution - -```shell -chmod -R 777 data -``` - -### Error - -> PHP Fatal error: Uncaught InvalidArgumentException: The directory "``/public/uploads" is not writable... - -### Solution - -```shell -chmod -R 777 public/uploads -``` - -### Error - -> PHP Fatal error: Uncaught ErrorException: fopen(``/log/error-log-yyyy-mm-dd.log): Failed to open stream: Permission denied... - -### Solution - -```shell -chmod -R 777 log -``` - -## Where are the error log files? - -From time to time, you are encountering various errors which are not displayed. Or you can get errors 500 in a browser. - -To find the error messages, you need to read the error log files. - -### Apache log files - -```text -/var/log/httpd/error_log -``` - -### PHP-FPM log files - -```text -/var/log/php-fpm/error.log -/var/log/php-fpm/www-error.log -``` - -## How do I update Composer? - -Before updating, check your current Composer version by executing: - -```shell -composer --version -``` - -The output should be similar to: - -```text -Composer version 2.8.5 2025-01-21 15:23:40 -PHP version 8.3.20 (/usr/bin/php) -Run the "diagnose" command to get more detailed diagnostics output. -``` - -Update Composer using its own `self-update` command: - -```shell -sudo /usr/local/bin/composer self-update -``` - -The output should be similar to: - -```text -Upgrading to version 2.8.8 (stable channel). - -Use composer self-update --rollback to return to version 2.8.5 -``` - -After updating, check again your Composer version by executing: - -```shell -composer --version -``` - -The output should be similar to: - -```text -Composer version 2.8.8 2025-04-04 16:56:46 -PHP version 8.3.20 (/usr/bin/php) -Run the "diagnose" command to get more detailed diagnostics output. -``` - -## How do I update phpMyAdmin? - -Being installed as a system package, it can be updated using the command which updates the rest of the system packages: - -```shell -sudo dnf upgrade -y -``` - -## How do I create command aliases? - -From either your terminal or file explorer, navigate to your home directory (`/home//`). - -Using your preferred text editor, open the file: `.bash_profile` (if it does not exist, creat it first). - -Move to the end of the file and enter on a new line: - -```text -alias command_alias="command to execute" -``` - -where: - -* `command_alias` is the name by which you want to call your original command -* `command to execute`: the original command to be executed on alias call - -### Example: - -```text -alias list_files="ls -Al" -``` - -will create an alias called `list_files` that will run the command `ls -Al`. diff --git a/wsl/os/almalinux9/README.md b/wsl/os/almalinux9/README.md deleted file mode 100644 index 0e2a359..0000000 --- a/wsl/os/almalinux9/README.md +++ /dev/null @@ -1,201 +0,0 @@ -# Install WSL2 development environment on AlmaLinux9 - -[< Dotkernel: Install development environment](../../README.md) - -## Download AlmaLinux9 image - -Download **AlmaLinux9** image by following one of the below methods. - -### Method 1: Download AlmaLinux9 WSL2 image using Windows Terminal - -Open `Windows Terminal` and execute the following command: - -```shell -wsl --install -d AlmaLinux-9 -``` - -You should see the download progress, and once finished, the output should look like this: - -```text -Downloading: AlmaLinux 9 -Installing: AlmaLinux 9 -AlmaLinux 9 has been installed. -Launching AlmaLinux 9... -``` - -Also, you should find a new tab in `Windows Terminal` that is already connected to **AlmaLinux9**. - -### Method 2: Download AlmaLinux9 WSL2 image from Microsoft Store - -Open Microsoft Store, type `AlmaLinux` in the search box and hit `Enter`. - -From the results, select `AlmaLinux OS 9` - this will take you to AlmaLinux9's app page. - -On this page, locate and click the `Install` button - this will download AlmaLinux9 WSL2 image on your machine. - -Once the download has finished, the `Install` button is replaced by an `Open` button - clicking it will open `Windows Terminal`. - -## Install AlmaLinux9 - -You will be asked to fill in your username (for example `dotkernel`): - -```text -Installing, this may take a few minutes... -Please create a default UNIX user account. The username does not need to match your Windows username. -For more information visit: https://aka.ms/wslusers -Enter new UNIX username: -``` - -Next, you are prompted to enter a password to use with your username (you will not see what you are typing, that's a security measure in Linux regarding passwords): - -```shell -Enter new UNIX username: dotkernel. -Changing password for user dotkernel. -New password: -``` - -Depending on the strength of your password, you might see one of the following messages (if you want to choose a different password, hit `Enter` and you are taken back to previous step - else, continue with retyping your password): - -```text -BAD PASSWORD: The password fails the dictionary check - it is based on a dictionary word -BAD PASSWORD: The password is a palindrome -``` - -Next, you are asked to retype your password: - -```text -Retype new password: -``` - -Finally, you should see the following message: - -```text -passwd: all authentication tokens updated successfully. -Installation successful! -[dotkernel@hostname:~]$ -``` - -## Setup AlmaLinux9 - -Install requirements: - -```shell -sudo dnf install epel-release dnf-utils https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y -``` - -Update/Upgrade system packages: - -```shell -sudo dnf upgrade -y -``` - -Now, install the latest version of Ansible: - -```shell -sudo dnf install ansible -y -``` - -Clone `dotkernel/development` into your home directory: - -```shell -git clone https://github.com/dotkernel/development.git -``` - -Move inside the directory `development/wsl`: - -```shell -cd ~/development/wsl/ -``` - -Duplicate `config.yml.dist` as `config.yml`. - -Using your preferred text editor, open `config.yml` and fill in the empty fields. - -Save and close the file. - -Install requirements and initialize systemd by running the below Ansible command: - -```shell -ansible-playbook -i hosts install.yml --ask-become-pass -``` - -The installation process will iterate over each task in the playbook and will output a short summary with the results. - -AlmaLinux9 needs to be restarted, so quit it by pressing `Control` + `d`. - -Open Windows Terminal. - -Stop AlmaLinux9: - -```shell -wsl -t AlmaLinux9 -``` - -Start AlmaLinux9: - -```shell -wsl -d AlmaLinux9 -``` - -Move inside the directory `development/wsl`: - -```shell -cd ~/development/wsl/ -``` - -Continue the installation by running the below Ansible command: - -```shell -ansible-playbook -i hosts install.yml --ask-become-pass -``` - -The installation process will iterate over each task in the playbook and will output a short summary with the results. - -Now check if everything works by opening in your browser: - -* [http://localhost/](http://localhost/): Apache's default home page -* [http://localhost/info.php](http://localhost/info.php): PHP info page -* [http://localhost/phpmyadmin/](http://localhost/phpmyadmin/): PhpMyAdmin (login with `root` + the root password you configured in `config.yml` under `mariadb` -> `root_password`) - -The installation is complete, your development environment is ready to use. - -## Create virtualhosts - -Move inside the directory `development/wsl`: - -```shell -cd ~/development/wsl/ -``` - -Using your preferred text editor, open `config.yml` and, under the `virtualhosts` key, enter the virtualhosts that you want to create, each on its own line. - -Already existing ones will be skipped, no need to comment or remove them. - -> By using the `*.localhost` pattern for any new virtualhost, you do not need to modify the `hosts` file in Windows, because these are routed by default. - -Save and close the file. - -Create the specified virtualhosts: - -```shell -ansible-playbook -i hosts create-virtualhost.yml --ask-become-pass -``` - -This will iterate over the list of configured `virtualhosts` and will output a short summary with the results. - -Your virtualhost should be accessible and ready to use. - -You will install your project under the `html` directory of your project, for example: `/var/www/example.localhost/html`. - -> The virtualhost's document root is set to the `public` directory of the above location, for example `/var/www/example.localhost/html/public`. - -> If you want to have the DocumentRoot directly in `html` folder, you need to modify the file `/etc/httpd/sites-available/example.localhost`. - -### Good to know - -* To run your installed projects, you need to start AlmaLinux9 first. -* If you work with virtualhosts, your projects are created under `/var/www/`. -* You can still run PHP scripts under the default Apache project directory, located at `/var/www/html/`. -* If you encounter write permission issues, see [this guide](FAQ.md#how-do-i-fix-common-permission-issues). -* We install PHP 8.3 by default. If you need a different version, see [this guide](FAQ.md#how-do-i-switch-to-a-different-version-of-php). -* We install Node.js 22 by default. If you need a different version, see [this guide](FAQ.md#how-do-i-switch-to-a-different-version-of-nodejs). diff --git a/wsl/os/almalinux9/create-virtualhost.yml b/wsl/os/almalinux9/create-virtualhost.yml deleted file mode 100644 index e454e10..0000000 --- a/wsl/os/almalinux9/create-virtualhost.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Create new virtualhost under AlmaLinux9 - hosts: localhost - connection: local - become: true - gather_facts: true - vars_files: - - ../../config.yml - - ./roles/apache/vars/main.yml - roles: - - virtualhost diff --git a/wsl/os/almalinux9/install.yml b/wsl/os/almalinux9/install.yml deleted file mode 100644 index 861296c..0000000 --- a/wsl/os/almalinux9/install.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- name: Setup AlmaLinux9 development environment - hosts: localhost - connection: local - become: true - gather_facts: true - vars_files: - - ../../config.yml - - roles/apache/vars/main.yml - - roles/system/vars/main.yml - tasks: - - name: Check progress - stat: - path: "{{ wsl_config_dest }}" - register: result - - name: Step 1 - include_role: - name: "{{ role }}" - tasks_from: main - loop: - - system - loop_control: - loop_var: role - when: not result.stat.exists - - name: Step 2 - include_role: - name: "{{ role }}" - tasks_from: main - loop: - - apache - - php - - mariadb - - phpmyadmin - - composer - - nodejs - - git - - virtualhost - loop_control: - loop_var: role - when: result.stat.exists diff --git a/wsl/os/almalinux9/roles/system/tasks/main.yml b/wsl/os/almalinux9/roles/system/tasks/main.yml deleted file mode 100644 index 6ba5277..0000000 --- a/wsl/os/almalinux9/roles/system/tasks/main.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Update/Upgrade installed packages - dnf: - name: "*" - state: latest - update_cache: true -- name: Install requirements - dnf: - name: "{{ item }}" - state: latest - with_items: - - unzip - - firewalld -- name: Copy WSL configuration file - template: - src: wsl.conf.j2 - dest: "{{ wsl_config_dest }}" -- name: Copy .bash_profile file - template: - src: bash_profile.j2 - dest: "{{ bash_profile_dest }}" diff --git a/wsl/os/almalinux9/roles/system/templates/wsl.conf.j2 b/wsl/os/almalinux9/roles/system/templates/wsl.conf.j2 deleted file mode 100644 index a544c09..0000000 --- a/wsl/os/almalinux9/roles/system/templates/wsl.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -[boot] -systemd=true diff --git a/wsl/os/almalinux9/roles/apache/tasks/main.yml b/wsl/roles/apache/tasks/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/apache/tasks/main.yml rename to wsl/roles/apache/tasks/main.yml diff --git a/wsl/os/almalinux9/roles/apache/vars/main.yml b/wsl/roles/apache/vars/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/apache/vars/main.yml rename to wsl/roles/apache/vars/main.yml diff --git a/wsl/os/almalinux9/roles/composer/tasks/main.yml b/wsl/roles/composer/tasks/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/composer/tasks/main.yml rename to wsl/roles/composer/tasks/main.yml diff --git a/wsl/os/almalinux9/roles/composer/vars/main.yml b/wsl/roles/composer/vars/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/composer/vars/main.yml rename to wsl/roles/composer/vars/main.yml diff --git a/wsl/os/almalinux9/roles/git/tasks/main.yml b/wsl/roles/git/tasks/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/git/tasks/main.yml rename to wsl/roles/git/tasks/main.yml diff --git a/wsl/os/almalinux9/roles/git/vars/main.yml b/wsl/roles/git/vars/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/git/vars/main.yml rename to wsl/roles/git/vars/main.yml diff --git a/wsl/os/almalinux9/roles/mariadb/tasks/main.yml b/wsl/roles/mariadb/tasks/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/mariadb/tasks/main.yml rename to wsl/roles/mariadb/tasks/main.yml diff --git a/wsl/os/almalinux9/roles/mariadb/templates/MariaDB.repo.j2 b/wsl/roles/mariadb/templates/MariaDB.repo.j2 similarity index 100% rename from wsl/os/almalinux9/roles/mariadb/templates/MariaDB.repo.j2 rename to wsl/roles/mariadb/templates/MariaDB.repo.j2 diff --git a/wsl/os/almalinux9/roles/mariadb/vars/main.yml b/wsl/roles/mariadb/vars/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/mariadb/vars/main.yml rename to wsl/roles/mariadb/vars/main.yml diff --git a/wsl/os/almalinux9/roles/nodejs/tasks/main.yml b/wsl/roles/nodejs/tasks/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/nodejs/tasks/main.yml rename to wsl/roles/nodejs/tasks/main.yml diff --git a/wsl/os/almalinux9/roles/php/tasks/main.yml b/wsl/roles/php/tasks/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/php/tasks/main.yml rename to wsl/roles/php/tasks/main.yml diff --git a/wsl/os/almalinux9/roles/php/templates/info.php.j2 b/wsl/roles/php/templates/info.php.j2 similarity index 100% rename from wsl/os/almalinux9/roles/php/templates/info.php.j2 rename to wsl/roles/php/templates/info.php.j2 diff --git a/wsl/os/almalinux9/roles/php/vars/main.yml b/wsl/roles/php/vars/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/php/vars/main.yml rename to wsl/roles/php/vars/main.yml diff --git a/wsl/os/almalinux9/roles/phpmyadmin/tasks/main.yml b/wsl/roles/phpmyadmin/tasks/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/phpmyadmin/tasks/main.yml rename to wsl/roles/phpmyadmin/tasks/main.yml diff --git a/wsl/roles/system/tasks/main.yml b/wsl/roles/system/tasks/main.yml new file mode 100644 index 0000000..fe0e7f1 --- /dev/null +++ b/wsl/roles/system/tasks/main.yml @@ -0,0 +1,24 @@ +--- +- name: Update/Upgrade installed packages + dnf: + name: "*" + state: latest + update_cache: true +- name: Install firewall daemon + dnf: + name: firewalld + state: latest +- name: Set default user + ansible.builtin.lineinfile: + path: "{{ wsl_config_dest }}" + line: "{{ item }}" + create: yes + insertafter: EOF + loop: + - "" + - "[user]" + - "default={{ config.system.username }}" +- name: Copy ~/.bash_profile file + template: + src: bash_profile.j2 + dest: "{{ bash_profile_dest }}" diff --git a/wsl/os/almalinux9/roles/system/templates/bash_profile.j2 b/wsl/roles/system/templates/bash_profile.j2 similarity index 100% rename from wsl/os/almalinux9/roles/system/templates/bash_profile.j2 rename to wsl/roles/system/templates/bash_profile.j2 diff --git a/wsl/os/almalinux9/roles/system/vars/main.yml b/wsl/roles/system/vars/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/system/vars/main.yml rename to wsl/roles/system/vars/main.yml diff --git a/wsl/os/almalinux9/roles/virtualhost/tasks/create.yml b/wsl/roles/virtualhost/tasks/create.yml similarity index 94% rename from wsl/os/almalinux9/roles/virtualhost/tasks/create.yml rename to wsl/roles/virtualhost/tasks/create.yml index a6f2566..54d110b 100644 --- a/wsl/os/almalinux9/roles/virtualhost/tasks/create.yml +++ b/wsl/roles/virtualhost/tasks/create.yml @@ -43,4 +43,6 @@ loop_control: loop_var: virtualhost - name: Reload Apache - command: systemctl reload httpd + ansible.builtin.systemd_service: + name: httpd + state: restarted diff --git a/wsl/os/almalinux9/roles/virtualhost/tasks/default.yml b/wsl/roles/virtualhost/tasks/default.yml similarity index 100% rename from wsl/os/almalinux9/roles/virtualhost/tasks/default.yml rename to wsl/roles/virtualhost/tasks/default.yml diff --git a/wsl/os/almalinux9/roles/virtualhost/tasks/main.yml b/wsl/roles/virtualhost/tasks/main.yml similarity index 100% rename from wsl/os/almalinux9/roles/virtualhost/tasks/main.yml rename to wsl/roles/virtualhost/tasks/main.yml diff --git a/wsl/os/almalinux9/roles/virtualhost/templates/default.conf.j2 b/wsl/roles/virtualhost/templates/default.conf.j2 similarity index 100% rename from wsl/os/almalinux9/roles/virtualhost/templates/default.conf.j2 rename to wsl/roles/virtualhost/templates/default.conf.j2 diff --git a/wsl/os/almalinux9/roles/virtualhost/templates/virtualhost.conf.j2 b/wsl/roles/virtualhost/templates/virtualhost.conf.j2 similarity index 100% rename from wsl/os/almalinux9/roles/virtualhost/templates/virtualhost.conf.j2 rename to wsl/roles/virtualhost/templates/virtualhost.conf.j2 From 004b16f6e25fcbad7ae5312654d7c34090e3f255 Mon Sep 17 00:00:00 2001 From: alexmerlin Date: Sat, 7 Jun 2025 07:13:27 +0300 Subject: [PATCH 2/2] Issue #58: Implement one distro per branch structure Signed-off-by: alexmerlin --- docs/book/{v1 => AlmaLinux9}/faq.md | 0 docs/book/{v1 => AlmaLinux9}/introduction.md | 0 .../{v1 => AlmaLinux9}/setup/installation.md | 0 .../setup/setup-packages.md | 0 .../setup/system-requirements.md | 0 .../virtualhosts/create-virtualhost.md | 0 .../virtualhosts/overview.md | 0 mkdocs.yml | 20 +++++++++---------- 8 files changed, 10 insertions(+), 10 deletions(-) rename docs/book/{v1 => AlmaLinux9}/faq.md (100%) rename docs/book/{v1 => AlmaLinux9}/introduction.md (100%) rename docs/book/{v1 => AlmaLinux9}/setup/installation.md (100%) rename docs/book/{v1 => AlmaLinux9}/setup/setup-packages.md (100%) rename docs/book/{v1 => AlmaLinux9}/setup/system-requirements.md (100%) rename docs/book/{v1 => AlmaLinux9}/virtualhosts/create-virtualhost.md (100%) rename docs/book/{v1 => AlmaLinux9}/virtualhosts/overview.md (100%) diff --git a/docs/book/v1/faq.md b/docs/book/AlmaLinux9/faq.md similarity index 100% rename from docs/book/v1/faq.md rename to docs/book/AlmaLinux9/faq.md diff --git a/docs/book/v1/introduction.md b/docs/book/AlmaLinux9/introduction.md similarity index 100% rename from docs/book/v1/introduction.md rename to docs/book/AlmaLinux9/introduction.md diff --git a/docs/book/v1/setup/installation.md b/docs/book/AlmaLinux9/setup/installation.md similarity index 100% rename from docs/book/v1/setup/installation.md rename to docs/book/AlmaLinux9/setup/installation.md diff --git a/docs/book/v1/setup/setup-packages.md b/docs/book/AlmaLinux9/setup/setup-packages.md similarity index 100% rename from docs/book/v1/setup/setup-packages.md rename to docs/book/AlmaLinux9/setup/setup-packages.md diff --git a/docs/book/v1/setup/system-requirements.md b/docs/book/AlmaLinux9/setup/system-requirements.md similarity index 100% rename from docs/book/v1/setup/system-requirements.md rename to docs/book/AlmaLinux9/setup/system-requirements.md diff --git a/docs/book/v1/virtualhosts/create-virtualhost.md b/docs/book/AlmaLinux9/virtualhosts/create-virtualhost.md similarity index 100% rename from docs/book/v1/virtualhosts/create-virtualhost.md rename to docs/book/AlmaLinux9/virtualhosts/create-virtualhost.md diff --git a/docs/book/v1/virtualhosts/overview.md b/docs/book/AlmaLinux9/virtualhosts/overview.md similarity index 100% rename from docs/book/v1/virtualhosts/overview.md rename to docs/book/AlmaLinux9/virtualhosts/overview.md diff --git a/mkdocs.yml b/mkdocs.yml index bbe7e20..761b8ca 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,21 +2,21 @@ docs_dir: docs/book site_dir: docs/html extra: project: Development - current_version: v1 + current_version: AlmaLinux9 versions: - - v1 + - AlmaLinux9 nav: - Home: index.md - - v1: - - Introduction: v1/introduction.md + - AlmaLinux9: + - Introduction: AlmaLinux9/introduction.md - Setup: - - System Requirements: v1/setup/system-requirements.md - - Installation: v1/setup/installation.md - - Setup Packages: v1/setup/setup-packages.md + - System Requirements: AlmaLinux9/setup/system-requirements.md + - Installation: AlmaLinux9/setup/installation.md + - Setup Packages: AlmaLinux9/setup/setup-packages.md - Virtualhosts: - - Overview: v1/virtualhosts/overview.md - - Create virtualhost: v1/virtualhosts/create-virtualhost.md - - FAQ: v1/faq.md + - Overview: AlmaLinux9/virtualhosts/overview.md + - Create virtualhost: AlmaLinux9/virtualhosts/create-virtualhost.md + - FAQ: AlmaLinux9/faq.md site_name: development site_description: "WSL2 Development Environment" repo_url: "https://github.com/dotkernel/development"