Skip to content

idempotency of nginx_install_from: source: current validations lack server reboot and ignore installed version #646

Open
@olwe0002

Description

@olwe0002

Describe the bug

After an installation with nginx_install_from: source the latest available version is installed successfully.

Problems:
a). Repeating the ansible run results in a skipped installation process, even if a differnt version that the latest would exist in /usr/sbin/nginx.
b). Rebooting the server leads to empty /tmp dir, which leads to a complete new compilation and installation on the next ansible-run, even if the /usr/sbin/nginx version is already the target version.

To reproduce

a) Steps to reproduce the behavior:

  1. Deploy the Ansible NGINX role using nginx_install_from: source
  2. check the version number with /usr/sbin/nginx -v
  3. wait for new nginx version to be released (do no reboot of the server in the meantime to preserve /tmp content)
  4. repeat 1 and 2

result: the version was not updated, even that there is a newer existing. Update: maybe this is only a problem if nginx was previously installed via the ansible role in the latest version, the directories below /tmp are still existing, but in the meantime the /usr/sbin/nginx was replaced by a older version, e.g. if some other package installes nginx as an dependency.

b) Steps to reproduce the behavior:

  1. Deploy the Ansible NGINX role using nginx_install_from: source
  2. repeat 1, notice that the Make .. (dependency) and Install ... tasks are skipped
  3. reboot the server
  4. repeat 1

result: the Make .. (dependency) and Install ...tasks are not skipped any more, even that the target version already exists in /usr/sbin/nginx

log of problem b)
log output_b.log

Expected behavior

The current installed version at /usr/sbin/nginx should be taken into account. If the installed version is the target version, all upcoming tasks can be skipped. Also a reboot of the server should not change the behaviour of the ansible tasks.

Your environment

  • Version of the Ansible NGINX role or specific commit
  - name: nginxinc.nginx
    version: "0.24.1"
  • Version of Ansible

2.15.2

  • Target deployment platform

Ubuntu 20.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions