Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
olwe0002 opened this issue Aug 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@olwe0002
Copy link

olwe0002 commented Aug 27, 2023

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

@alessfg
Copy link
Collaborator

alessfg commented Aug 28, 2023

I'm going to start by repasting some of the comments I made in #645:

  1. Building NGINX from source is very much not recommended unless you really, really, really need to tweak the default NGINX binary provided by us. It's much easier and simpler to pull our latest mainline or stable build.
  2. Any effort done internally on this role re building NGINX from source or installing NGINX from any given distributions core repository is very much best effort, since it's not a method of installation we officially support. That being said, PRs are always more than welcome and will get reviewed! (Most of the core work done in supporting building NGINX from source has indeed come from external PRs.)

In this case, fixing these two issues requires a bit more work than what I can realistically commit to working on in the near future. That does not mean it will not get worked on, but it does mean it might be a while. Although, like I mentioned before, if you (or anyone else checking out this issue) want to take a stab at fixing it PRs are more than welcome, and will get reviewed asap!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants