ansible-openwrt
ansible-openwrt copied to clipboard
We do not verify the presence of opkg cache files for update
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.
@gekmihesg Could you review my fix for this broken opkg
module behavior soon after first boot?
Commit 16f590e fixes this commit's behavior in check-mode. Unfortunately, in order to find the number of files in e.g. /tmp/opkg-lists
, I need to use the find
command, which does not support check mode; to avoid breakage when running in check-mode, safen the check for find
output with an is defined
.