semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Problem: Status success but nothing change inside target server when installed apps

Open hilalkukm opened this issue 6 months ago • 0 comments

Issue

I have successfully install semaphore with packages, then i running task to install apache2 and running with status success. Like below :

Image

when i run task, i don't check anything either --diff or --check option. Just add CLI args --ask-become-pass like below Image

But when i check manually with command sudo dpkg --list | grep apache2 inside server target, the apache2 not installed there. Below is the result :

$sudo dpkg --list | grep apache2
ii  apache2-bin               2.4.58-1ubuntu8.6                       amd64        Apache HTTP Server (modules and other binary files)
ii  libapache2-mod-php                     2:8.3+93ubuntu2                         all          server-side, HTML-embedded scripting language (Apache 2 module) (default)
rc  libapache2-mod-php8.1                  8.1.2-1ubuntu2.20                       amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php8.3                  8.3.6-0ubuntu0.24.04.4                  amd64        server-side, HTML-embedded scripting language (Apache 2 module)

What i have tried

  • Run ansible playbook without semaphore with ansible-playbook -i inventory.yaml install_apache2.yaml --ask-become-pass, it works then i check inside target server the apache2 apps available there.
$sudo dpkg --list | grep apache2 
ii  **apache2**                                2.4.58-1ubuntu8.6                       amd64        Apache HTTP Server
ii  apache2-bin                           2.4.58-1ubuntu8.6                       amd64        Apache HTTP Server (modules and other binary files)
ii  **apache2-data**                           2.4.58-1ubuntu8.6                       all          Apache HTTP Server (common files)
ii  **apache2-utils**                          2.4.58-1ubuntu8.6                       amd64        Apache HTTP Server (utility programs for web servers)
ii  libapache2-mod-php                     2:8.3+93ubuntu2                         all          server-side, HTML-embedded scripting language (Apache 2 module) (default)
rc  libapache2-mod-php8.1                  8.1.2-1ubuntu2.20                       amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php8.3                  8.3.6-0ubuntu0.24.04.4                  amd64        server-side, HTML-embedded scripting language (Apache 2 module)
  • Try to reboot server with semaphore, it works. Target server is successfully reboot

Impact

Ansible (task execution)

Installation method

Package

Database

MySQL

Browser

Microsoft Edge

Semaphore Version

2.14.11-461355d-1748284506

Ansible Version

ansible [core 2.18.6]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/sempak/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/sempak/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.12.3 (main, Feb  4 2025, 14:48:35) [GCC 13.3.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

Logs & errors

Task 24 added to queue
Started: 24
Run TaskRunner with template: Install Apache2

Preparing: 24
From https://github.com/hilalkukm/Ansible
   e9d778e..b3eb4ad  main       -> origin/main
Updating Repository https://github.com/hilalkukm/Ansible.git
From https://github.com/hilalkukm/Ansible
 * branch            main       -> FETCH_HEAD
Updating e9d778e..b3eb4ad
Fast-forward
 reboot.yaml | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 reboot.yaml
Get current commit hash
Get current commit message
installing static inventory
No /tmp/semaphore/project_1/repository_1_template_2/collections/requirements.yml file found. Skip galaxy install process.

No /tmp/semaphore/project_1/repository_1_template_2/requirements.yml file found. Skip galaxy install process.

No /tmp/semaphore/project_1/repository_1_template_2/collections/requirements.yml file found. Skip galaxy install process.

No /tmp/semaphore/project_1/repository_1_template_2/requirements.yml file found. Skip galaxy install process.

No /tmp/semaphore/project_1/repository_1_template_2/roles/requirements.yml file found. Skip galaxy install process.

No /tmp/semaphore/project_1/repository_1_template_2/requirements.yml file found. Skip galaxy install process.

No /tmp/semaphore/project_1/repository_1_template_2/roles/requirements.yml file found. Skip galaxy install process.

No /tmp/semaphore/project_1/repository_1_template_2/requirements.yml file found. Skip galaxy install process.


PLAY [Install Apache] **********************************************************

TASK [Gathering Facts] *********************************************************
[WARNING]: Platform linux on host 192.168.92.201 is using the discovered Python
interpreter at /usr/bin/python3.12, but future installation of another Python
interpreter could change the meaning of that path. See
https://docs.ansible.com/ansible-
core/2.18/reference_appendices/interpreter_discovery.html for more information.
ok: [192.168.92.201]

PLAY RECAP *********************************************************************
192.168.92.201             : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 

Manual installation - system information

Linux dell-pc 6.11.0-26-generic #26~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Apr 17 19:20:47 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Configuration

  • Task Template

Image

install_apache2.yaml

---
- name: Install Apache
  hosts: web
  become: yes  # Use sudo for the tasks
  tasks:
    - name: Install
      apt:
        name:
          - apache2
        state: present

reboot.yaml

---
- name: Reboot Server
  hosts: web
  become: yes  # Use sudo for the tasks
  tasks:
    - name: Reboot server
      reboot:
        reboot_timeout: 300
        test_command: uptime
  • Inventory file inventory and i fill sudo password inside this step
[web]
192.168.92.201 ansible_ssh_port=32111 ansible_ssh_user=uncork

Image

  • Repository Link
  • User credential i use ssh-key and i have setup this before

Image

  • Environment - i don't use this option

Update 6/5/2025:04:56:00 PM

  • When target server is ubuntu 20.04.1 LTS ansible semaphore work install or remove apache2. But when target server is ubuntu 24.04.2 LTS ansible semaphore doesn't work.
  • I try to run manually via ansible-playbook command, task install or remove apache successfully change the server, either in ubuntu 20.04.1 or ubuntu 24.04.2.

No response

hilalkukm avatar Jun 05 '25 08:06 hilalkukm