Opkg Facts

Gather the information provided by opkg on OpenWrt systems:
  • opkg configuration
  • feeds configuration
  • list of installed packages
  • list of packages with available upgrades

see https://openwrt.org/docs/guide-user/additional-software/opkg

See also: Opkg Operations.

opkg.OpkgConf

host.get_fact(OpkgConf, )

Returns a NamedTuple with the current configuration:

ConfInfo(
    paths = {
        "root": "/",
        "ram": "/tmp",
    },
    list_dir = "/opt/opkg-lists",
    options = {
        "overlay_root": "/overlay"
    },
    arch_cfg = {
        "all": 1,
        "noarch": 1,
        "i386_pentium": 10
    }
)

opkg.OpkgFeeds

host.get_fact(OpkgFeeds, )

Returns a dictionary containing the information for the distribution-provided and custom opkg feeds:

{
 'openwrt_base': FeedInfo(url='http://downloads ... /i386_pentium/base', fmt='src/gz', kind='distribution'), # noqa: E501
 'openwrt_core': FeedInfo(url='http://downloads ... /x86/geode/packages', fmt='src/gz', kind='distribution'), # noqa: E501
 'openwrt_luci': FeedInfo(url='http://downloads ... /i386_pentium/luci', fmt='src/gz', kind='distribution'),# noqa: E501
 'openwrt_packages': FeedInfo(url='http://downloads ... /i386_pentium/packages', fmt='src/gz', kind='distribution'),# noqa: E501
 'openwrt_routing': FeedInfo(url='http://downloads ... /i386_pentium/routing', fmt='src/gz', kind='distribution'),# noqa: E501
 'openwrt_telephony': FeedInfo(url='http://downloads ... /i386_pentium/telephony', fmt='src/gz', kind='distribution') # noqa: E501
}

opkg.OpkgInstallableArchitectures

host.get_fact(OpkgInstallableArchitectures, )

Returns a dictionary containing the currently installable architectures for this system along with their priority:

{
  'all': 1,
  'i386_pentium': 10,
  'noarch': 1
 }

opkg.OpkgPackages

host.get_fact(OpkgPackages, )

Returns a dict of installed opkg packages:

{
  'package_name': ['version'],
  ...
}

opkg.OpkgUpgradeablePackages

host.get_fact(OpkgUpgradeablePackages, )

Returns a dict of installed and upgradable opkg packages:

{
  'package_name': (installed='1.2.3', available='1.2.8')
  ...
}