Auto-update blog content from Obsidian: 2026-02-06 08:03:38
All checks were successful
Blog Deployment / Merge (push) Successful in 6s
Blog Deployment / Deploy-Production (push) Successful in 9s
Blog Deployment / Test-Production (push) Successful in 2s
Blog Deployment / Clean (push) Has been skipped
Blog Deployment / Notify (push) Successful in 2s
Blog Deployment / Check-Rebuild (push) Successful in 5s
Blog Deployment / Build (push) Has been skipped
Blog Deployment / Deploy-Staging (push) Successful in 9s
Blog Deployment / Test-Staging (push) Successful in 2s
All checks were successful
Blog Deployment / Merge (push) Successful in 6s
Blog Deployment / Deploy-Production (push) Successful in 9s
Blog Deployment / Test-Production (push) Successful in 2s
Blog Deployment / Clean (push) Has been skipped
Blog Deployment / Notify (push) Successful in 2s
Blog Deployment / Check-Rebuild (push) Successful in 5s
Blog Deployment / Build (push) Has been skipped
Blog Deployment / Deploy-Staging (push) Successful in 9s
Blog Deployment / Test-Staging (push) Successful in 2s
This commit is contained in:
@@ -97,12 +97,7 @@ To generate the encrypting access keys, I use this command:
|
|||||||
head -c32 /dev/urandom | base64
|
head -c32 /dev/urandom | base64
|
||||||
```
|
```
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
Now I'm able to reach to the login page using the URL configured.
|
|
||||||
|
|
||||||
=======
|
|
||||||
---
|
---
|
||||||
>>>>>>> 84ba140 (Update: 2026-02-05 20:52:50)
|
|
||||||
## Discovery
|
## Discovery
|
||||||
|
|
||||||
After starting the stack, I'm able to reach the login page using the URL.
|
After starting the stack, I'm able to reach the login page using the URL.
|
||||||
@@ -110,24 +105,95 @@ After starting the stack, I'm able to reach the login page using the URL.
|
|||||||
|
|
||||||
To login, I use the credentials defined by `SEMAPHORE_ADMIN_NAME`/`SEMAPHORE_ADMIN_PASSWORD`
|
To login, I use the credentials defined by `SEMAPHORE_ADMIN_NAME`/`SEMAPHORE_ADMIN_PASSWORD`
|
||||||
|
|
||||||
Once logged for the first time, I land into the create project page. I create the Homelab project:
|
Once logged for the first time, I land into the create project page. I create the *Homelab* project:
|
||||||

|

|
||||||
|
|
||||||
The first thing I want to do is to add a repository. In `Repository`, I click the `New Repository` button, and add my homelab repo URL. I don't specify credentials, the repo is public, you can find its mirror on Github [here](https://github.com/Vezpi/homelab):
|
The first thing I want to do is to add my *homelab* repository, you can find its mirror on Github [here](https://github.com/Vezpi/homelab). In `Repository`, I click the `New Repository` button, and add the repo URL. I don't specify credentials, the repo is public:
|
||||||

|

|
||||||
|
|
||||||
In the the `Key Store`, I add the first credential, a SSH key for my user:
|
ℹ️ Before continue, I deploy 3 VMs for testing purpose: `sem01`, `sem02` and `sem03`. I deploy them using Terraform with [this project](https://github.com/Vezpi/Homelab/tree/main/terraform/projects/semaphore-vms).
|
||||||
|
|
||||||
|
To interact with these VMs I need to configure credentials. In the the `Key Store`, I add the first credential, a SSH key for my user:
|
||||||

|

|
||||||
|
|
||||||
Before continue, I deploy 3 VMs
|
Then I create a new `Inventory`. I'm using the Ansible inventory format (the only one available). I select the SSH key previously created and select the type as `Static`. In the fields I enter the 3 hosts created with their FQDN:
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
✅ Everything is now setup, I can move forward and test to run an Ansible playbook.
|
||||||
|
|
||||||
---
|
---
|
||||||
## Launching an Ansible playbook
|
## Launching an Ansible playbook
|
||||||
|
|
||||||
|
I want to test something simple, install a web server with a custom page on these 3 VMs, I create the playbook `install_nginx.yml`:
|
||||||
|
```
|
||||||
|
---
|
||||||
|
- name: Demo Playbook - Install Nginx and Serve Hostname Page
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Ensure apt cache is updated
|
||||||
|
ansible.builtin.apt:
|
||||||
|
update_cache: true
|
||||||
|
cache_valid_time: 3600
|
||||||
|
|
||||||
|
- name: Install nginx
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: nginx
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Create index.html with hostname
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /var/www/html/index.html
|
||||||
|
content: |
|
||||||
|
<html>
|
||||||
|
<head><title>Demo</title></head>
|
||||||
|
<body>
|
||||||
|
<h1>Hostname: {{ inventory_hostname }}</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
owner: www-data
|
||||||
|
group: www-data
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: Ensure nginx is running
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: nginx
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
```
|
||||||
|
|
||||||
|
In Semaphore UI, I can now create my first `Task Template` for Ansible playbook. I give it a name, the playbook path (from the root folder of the repo), the repository and the branch:
|
||||||
|

|
||||||
|
|
||||||
|
Time to launch the playbook! In the task templates list, I click on the ▶️ button:
|
||||||
|

|
||||||
|
|
||||||
|
The playbook launches and I can follow the output in real-time:
|
||||||
|

|
||||||
|
|
||||||
|
I can also check the results of previous runs:
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
✅ Finally I can confirm the job is done by checking the URL on port 80 (http):
|
||||||
|

|
||||||
|
|
||||||
|
Managing the Ansible playbooks from Semaphore UI is pretty simple and really convenient. The interface is really sleek.
|
||||||
|
|
||||||
|
There are also a lot of customization available when setting the task template up. I can use variables in a survey, specify limit or tags. I really like it.
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
## Deploy with Terraform
|
## Deploy with Terraform
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
## Conclusion
|
## Conclusion
|
||||||
BIN
static/img/semaphore-create-new-ansible-task-template.png
Normal file
BIN
static/img/semaphore-create-new-ansible-task-template.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 225 KiB |
BIN
static/img/semaphore-create-new-static-inventory.png
Normal file
BIN
static/img/semaphore-create-new-static-inventory.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 142 KiB |
BIN
static/img/semaphore-run-test-playbook.png
Normal file
BIN
static/img/semaphore-run-test-playbook.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 114 KiB |
BIN
static/img/semaphore-ui-ansible-task-output.png
Normal file
BIN
static/img/semaphore-ui-ansible-task-output.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 276 KiB |
BIN
static/img/semaphore-ui-task-template-run-list.png
Normal file
BIN
static/img/semaphore-ui-task-template-run-list.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 227 KiB |
BIN
static/img/semaphore-ui-test-nginx-page-playbook.png
Normal file
BIN
static/img/semaphore-ui-test-nginx-page-playbook.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Reference in New Issue
Block a user