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

sys vars that correlate with time based classes

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Open
    • Priority: (None)
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      We currently have classes related to various aspects of time:

      exec 2>&1
      cf-promises --show-classes | awk '/time_based/ {print $1}' 
      :
      
      Day21
      GMT_Afternoon
      GMT_Day21
      GMT_Hr16
      GMT_Hr16_Q4
      GMT_June
      GMT_Lcycle_0
      GMT_Min50_55
      GMT_Min54
      GMT_Q4
      GMT_Tuesday
      GMT_Yr2022
      Hr11
      Hr11_Q4
      June
      Lcycle_0
      Min50_55
      Min54
      Morning
      Q4
      Tuesday
      Yr2022
      

      But we do not have corollary variables for these aspects of time.

      It would be convenient if we had special sys variables for these.

      Notably, this would enable loading inputs relating to time via augments. For example, I could load patching policy only on tuesdays.

      {
          "augments": [ "$(sys.time_based_dow).json" ]
      }
      

      And then in Tuesday.json I could have:

      {
          "inputs": [ "services/patch_tuesday.cf" ]
      }
      

      Examples:

      • sys.time_based_dom: Day21
      • sys.time_based_gmt_pod: GMT_Afternoon
      • sys.time_based_gmt_dom: GMT_Day21
      • sys.time_based_gmt_hr: GMT_Hr16
      • sys.time_based_gmt_month: GMT_June
      • sys.time_based_gmt_lcycle: GMT_Lcycle_0
      • sys.time_based_gmt_min_span_5: GMT_Min50_55
      • sys.time_based_gmt_min: GMT_Min54
      • sys.time_based_gmt_qoh: GMT_Q4
      • sys.time_based_gmt_dow: GMT_Tuesday
      • sys.time_based_gmt_yr: GMT_Yr2022
      • sys.time_based_hr: Hr11
      • sys.time_based_month: June
      • sys.time_based_lcycle: Lcycle_0
      • sys.time_based_min_span_5: Min50_55
      • sys.time_based_min: Min54
      • sys.time_based_pod: Morning
      • sys.time_based_qoh: Q4
      • sys.time_based_dom: Tuesday
      • sys.time_based_year: Yr2022

      Time based classes that are omitted from the list above are those that combine the Hour of the day with the quarter of the hour, e.g. GMT_Hr16_Q4, Hr16_Q4. I could not think of an abbreviation that made sense and it's achievable by combination.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated: