Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2102

Ability to force a package refresh

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I want the ability to just refresh the package cache for a given
      package_module without having to promise that a specific package should
      be present or absent.

      I don't want to have to run the agent without locks.

      Example:

      I have a promise that apache should be version latest
      yum is configured to look at my current repository that is a mirror of redhat release 5.5
      I change my yum configuration to point to release 5.8
      I want to force a package cache refresh
      I don't want to wait 4 hours for the package cache to update and apache to be installed

      Potential policy level workaround:

      bundle common apt_get_refresh
      {
        vars:
            "modified" int => filestat("/etc/apt/repo.whatever", "mtime");
            "now" int => now();
        classes:
            "refresh_apt"
              expression => eval("$(now) - $(modified) <= 5", "class", "infix"),
              scope => "namespace";
      }
      body package_module apt_get
      {
        refresh_apt::
          query_installed_ifelapsed => "1";
        !refresh_apt::
          query_installed_ifelapsed => "240";
      }
      

      I thought I would make my own custom body but I just realized that I cant
      have my_apt_get package module, without duplicating the actual module
      itself.

      Might be useful to have a module_name attribute where you could choose
      to use the same package module with slightly different settings.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              a10042 Nick Anderson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: