-
Notifications
You must be signed in to change notification settings - Fork 63
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
We do not verify the presence of opkg cache files for update #55
Comments
Hurricos
added a commit
to Hurricos/ansible-openwrt
that referenced
this issue
Dec 11, 2022
When openwrt_remote_opkg_lists_dir is placed at /tmp/opkg-lists (the default), it is recreated on each boot. However, when any opkg command is run -- including e.g. `opkg list-installed` -- that directory is created and left empty. On such a router, the first time an `opkg` command is run, the openwrt_remote_opkg_lists_dir is given mtime <= 86400 (at least for the next 24h), suggesting to the default ansible-openwrt's tasks that an `opkg update` has been issued recently when one has not. This seems to happen when an Ansible check-mode run is performed right after a router is booted. Correct this problem by verifying that there are actual opkg cache files. We assume (perhaps incorrectly) that all of the opkg cache files were created at the same time during the most recent successful `opkg update` run, if there are any, meaning they all have dates roughly matching that of their openwrt_remote_opkg_lists_dir. As a result, we do not need to check the age of those files. This commit fixes issue gekmihesg#55: gekmihesg#55 Signed-off-by: Martin Kennedy <hurricos@gmail.com>
@gekmihesg Could you review my fix for this broken |
Hurricos
added a commit
to Hurricos/ansible-openwrt
that referenced
this issue
Dec 21, 2022
When openwrt_remote_opkg_lists_dir is placed at /tmp/opkg-lists (the default), it is recreated on each boot. However, when any opkg command is run -- including e.g. `opkg list-installed` -- that directory is created and left empty. On such a router, the first time an `opkg` command is run, the openwrt_remote_opkg_lists_dir is given mtime <= 86400 (at least for the next 24h), suggesting to the default ansible-openwrt's tasks that an `opkg update` has been issued recently when one has not. This seems to happen when an Ansible check-mode run is performed right after a router is booted. Correct this problem by verifying that there are actual opkg cache files. We assume (perhaps incorrectly) that all of the opkg cache files were created at the same time during the most recent successful `opkg update` run, if there are any, meaning they all have dates roughly matching that of their openwrt_remote_opkg_lists_dir. As a result, we do not need to check the age of those files. This commit fixes issue gekmihesg#55: gekmihesg#55 Signed-off-by: Martin Kennedy <hurricos@gmail.com>
Commit 16f590e fixes this commit's behavior in check-mode. Unfortunately, in order to find the number of files in e.g. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When openwrt_remote_opkg_lists_dir is placed at /tmp/opkg-lists (the
default), it is recreated on each boot. However, when any opkg command
is run -- including e.g.
opkg list-installed
-- that directory iscreated and left empty.
On such a router, the first time an
opkg
command is run, theopenwrt_remote_opkg_lists_dir is given mtime <= 86400 (at least for
the next 24h), suggesting to the default ansible-openwrt's tasks that
an
opkg update
has been issued recently when one has not. This seemsto happen when an Ansible check-mode run is performed right after a
router is booted.
The text was updated successfully, but these errors were encountered: