Ansible opkg module

Hello @all,

I am currently familiarizing myself with OpenWRT.
I often use Ansible to always get back to a reproducible state.

Background
I didn't like the fact that the opkg Ansible module didn't support upgrading all new packages. I have now added this and it works. When testing the stock functions I realized that opkg does not support installation of a specific package. The synax should be:

$ opkg install luci=25.080.48760~19939dd

On a quick search, this was built into version 0.3.2 (link: https://groups.google.com/g/opkg-devel/c/XoN-b1lmIlE).
This is how it is implemented in the Ansible module but I always get an error.

I also found a few threads in the openwrt forum that users used a URL to download ipkg as a workaround.

Question
Does opkg from OpenWRT support the installation of packages with certain versions? If so, please give me a short explanation, preferably with an example that I can reproduce.
If not, I would remove these functions.

Greetings Frank

For a reason https://openwrt.org/meta/infobox/upgrade_packages_warning.

Opkg is dying The future is now: opkg vs apk.

1 Like

That's a different fork of opkg, OpenWrt's code is here: https://github.com/openwrt/opkg-lede/

But, as @frollic says, not much point in trying to do anything with it as we're moving to apk in the next release (and currently available in main snapshots).

But, even if you could get opkg to download a specific version, you'll then run into the issue that there isn't any archiving of the old package versions (except for the kernel-version-specific kmods for released versions, which never get rebuilt -- like https://downloads.openwrt.org/releases/24.10.0/targets/ath79/generic/kmods/6.6.73-1-c2bc166c1ba350209562f87ffdd33884/). Using your luci example, the version you show has already been superseded by 25.086.68836~be4f50f and the old packages were replaced with the new ones. The only real way to get the specific version you mention would be to check out the luci repo at the old hash, and rebuild it from scratch...

Thanks, but if this is no error, i bring my changes to the next ansible release.

For an EOL:ed Openwrt feature?

What's the point?