diff --git a/content/post/semaphore-ui-interface-ansible-terraform.md b/content/post/semaphore-ui-interface-ansible-terraform.md index 343fdb2..20d6552 100644 --- a/content/post/semaphore-ui-interface-ansible-terraform.md +++ b/content/post/semaphore-ui-interface-ansible-terraform.md @@ -97,12 +97,7 @@ To generate the encrypting access keys, I use this command: 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 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` -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 +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: | + +