Introduction

Ansible Semaphore is a modern web-based user interface for Ansible, allowing you to easily manage and run Ansible playbooks. Although Ansible is designed to run on Linux systems, you can use Windows Subsystem for Linux (WSL) to run Ansible on your Windows VPS. In this guide, we will walk you through the process of installing and configuring Ansible Semaphore on a Windows VPS using WSL.

Prerequisites

Before starting the installation, ensure you have the following:

  • A Windows VPS with administrative privileges.
  • Windows Subsystem for Linux (WSL) installed on your server (preferably Ubuntu).
  • Docker and Docker Compose installed on your system (optional, but recommended for easy setup).

If you haven’t installed WSL yet, follow these steps:

    1. Open PowerShell as Administrator and run the following command to install WSL:
wsl --install
  1. Restart your server when prompted and install a Linux distribution like Ubuntu from the Microsoft Store.
  2. Set up your user account after the installation completes.

Step 1: Install Docker (Optional)

Ansible Semaphore can be installed using Docker, which simplifies the installation process. Follow these steps to install Docker on your WSL environment:

    1. Open your WSL terminal and run the following commands to install Docker:
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce -y
    1. Start Docker and enable it to run at boot:
sudo systemctl start docker
sudo systemctl enable docker

Step 2: Install Ansible Semaphore

Now that Docker is installed, we can proceed with installing Ansible Semaphore. The recommended method for installing Ansible Semaphore is through Docker:

    1. First, pull the latest Ansible Semaphore Docker image:
sudo docker pull ansiblesemaphore/semaphore
    1. Create a directory to store Semaphore’s configuration and database:
mkdir ~/semaphore
    1. Run the Docker container for Semaphore:
sudo docker run -d -p 3000:3000 -v ~/semaphore:/semaphore ansiblesemaphore/semaphore
  1. This command will run Ansible Semaphore on port 3000 and map it to the same port on your local machine.

After the Docker container starts, you can access the Ansible Semaphore web interface by opening a web browser and visiting your Windows VPS IP address, followed by port 3000:

http://:3000

The default login credentials are:

  • Username: admin
  • Password: admin

For security reasons, make sure to change the default password after logging in.

Step 3: Configure Ansible Semaphore

Once you’ve logged into Ansible Semaphore, you will be prompted to configure the application:

  1. Set up a new database by entering the necessary information (you can use the default SQLite database or configure a MySQL database).
  2. Enter the necessary details for your Ansible setup, including your Ansible installation path and user credentials.
  3. Save the configuration, and you’re ready to start using Ansible Semaphore to manage your Ansible playbooks and tasks.

Step 4: Automate Ansible Semaphore

To ensure that Ansible Semaphore starts automatically when your Windows VPS restarts, you can set up Docker to start Semaphore automatically:

sudo docker update --restart unless-stopped ansiblesemaphore/semaphore

This will configure Docker to restart Ansible Semaphore whenever the system restarts, ensuring continuous operation.

Conclusion

Congratulations! You have successfully installed and configured Ansible Semaphore on your Windows VPS using Docker. You can now manage your Ansible playbooks and automate your server management tasks through the Ansible Semaphore web interface. Be sure to monitor your server and update Semaphore regularly to ensure optimal performance.

© 2024. For more information on Windows VPS solutions, visit NetCloud24.