-
Notifications
You must be signed in to change notification settings - Fork 353
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
Mainline to stable apt repository switch is not managed correctly #590
Comments
I distinctly remember doing some testing around this but I cannot remember whether I could or could not get it working in a painless way. That being said, I'll have another look and if I can't get it working to the standard I'd like I'll at least document somewhere that you might need to uninstall and reinstall NGINX to migrate from P.S.: PRs are always more than welcome if you perchance managed to figure out a fix already :) |
@alessfg why not use a template containing all of the repos, something like this :
That way you won't have to deal with file creation or line deletion and keep idempotency ? Just thinking out loud, maybe there's something i'm not seeing. Sadly I don't have time right now to implement this myself, too much work ... |
I do need to update the apt list of repos in case folks want to then update NGINX without using this role :) -- I use "hard-coded" variables right now (see https://github.com/nginxinc/ansible-role-nginx/blob/main/vars/main.yml#L118-L132) and it works fine under all cases except when downgrading from mainline to stable (stable to mainline results in multiple entries but since mainline has a higher version, it pulls from that one). |
Quick update: tasks:
- name: Install NGINX
ansible.builtin.include_role:
name: nginxinc.nginx
vars:
nginx_branch: stable
nginx_version: "{{ version }}" The fix, like you suggested, would be to override the relevant repository file. That is doable, but it would introduce a potential breaking change if folks are adding extra things to the source file after running the role. The first step, I think, would be to introduce a warning recommending folks do not edit the source file created by the role. After that we can explore what's the best way to override the repository file. |
Hello,
I installed nginx with this ansible role on Debian buster (Debian 10).
I want a stable production environment, and at first I hadn't noticed the ansible variable
nginx_branch
, which defaults tomainline
.When I noticed the variable, I tried to switch from
mainline
tostable
.The simple variable change is not enough because the repository line are appended (instead of replacing the existing lines) in the
/etc/apt/sources.list.d/nginx.list
file :The repository should IMO be overriding the actual file content in order to correctly switch from
mainline
tostable
(or the other way around).The text was updated successfully, but these errors were encountered: