-
Notifications
You must be signed in to change notification settings - Fork 104
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
Update cache after adding the repository, not before installing the package #71
Update cache after adding the repository, not before installing the package #71
Conversation
nice 👍
with the fix, re-ran it, and it worked 👍 |
🆒 🍸 |
I'm afraid to say, but removing the
I can provide the PR for ansible-mesos! |
the promised (and tested) fix: #72 |
Weird that the change broke your system... Maybe apt is not keeping your cache up-to-date due to some configuration issue? You PR indeed fixes the issue, but it is not idempotent: with it there is a change every hour |
actually @veger I just found your comment AnsibleShipyard/ansible-marathon#39 (comment)
This made the apt task fail (ps: using So I propose either my fix, or actually maybe easier to undo both our PR changes (and go back to just have the ps: Would be good to know what's actually the best practice for this super common case!? We could check how it's done in other well knows roles! |
Please either follow easier solution or best practices |
Ah... authentication issue. We had the same for our custom/internal repo, which requires HTTPS and a valid SSL key(chain). - name: Ensure certificate is available
copy:
src=/path/to/cert.crt
dest: /usr/local/share/ca-certificates/
# defined as a handler and force with meta: flush_handlers
- name: update certificates
shell: update-ca-certificates
# TODO Use apt_key module (when client certificates or https://<username@password:our.repo.tld/repository.gpg.key is supported)
- name: Check if repository key is available
shell: apt-key export <pgp key>
register: our_repo_key
- name: Ensure repository key is available
shell: curl <params to fetch key from server> | apt-key add -
when: our_repo_key.stdout.find('-----BEGIN PGP PUBLIC KEY BLOCK-----') == -1
# File our_repo.conf contains: Acquire::https::our.repo.tld::SslCert "/usr/local/share/ca-certificates/our_repo.crt";
- name: Ensure apt uses our_repo_key client certificate
copy:
src: our_repo.conf
dest: /etc/apt/apt.conf.d/80our_repo
- name: Ensure HMMS repository is available
apt_repository:
repo: deb https://our.repo.tld/ubuntu trusty main
state: present
update_cache: yes But this is a bit too much for a generic role. Maybe you can add this before you use the role? |
@veger thx for above snippet (useful indeed when using an internal repos), but in our case no internal-repos is involved, just a proxy. Anyway I actually just double checked what happens if the So to ensure that we actually see the new (mesos version) pkg in apt, on a node that already had an older mesos version installed (and didn't have 'apt-get update' for some time), we def. need an explicit About the extra
I hope we can fix this without loosing more time. Thank you both 👍 |
Normally the OS handles this? (At least Ubuntu/Debian do so) Or did you disable this functionality on your machines?
In our situation we execute our Ansible playbook on a daily basis (to stay up-to-date). We would like to see no changes when everything was ok (so we can add events to notify our ops team) For this About a solution: I do not know. Are proxies supported by this role? Or does the user have a own responsibility for getting the updates available in special stituations? I guess the owners/maintainers of this role need to decide. |
When the repo is added, a update cache is required to be able install Marathon.
When installing/updating Marathon a cache update is not required, as the OS will keep the cache up-to-date.
This prevents changes when nothing actually changed (not idempotent).
(similar PR as AnsibleShipyard/ansible-marathon#39)