Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

awx.awx.schedule_rrule,awx.awx.schedule_ruleset 'none' selection for frequency but set 'Daily' #14696

Closed
5 of 11 tasks
tenpei-on opened this issue Nov 30, 2023 · 1 comment
Closed
5 of 11 tasks
Labels
community component:awx_collection issues related to the collection for controlling AWX needs_triage type:bug

Comments

@tenpei-on
Copy link

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.
  • I am NOT reporting a (potential) security vulnerability. (These should be emailed to [email protected] instead.)

Bug Summary

Title: "Ansible AWX Collection: 'None' Frequency in schedule_rrule and schedule_ruleset Defaults to 'Daily'"

Description:

vbnet
Copy code
Summary:
In the Ansible AWX Collection, a bug has been identified in the awx.awx.schedule_rrule and awx.awx.schedule_ruleset plugins. When the frequency parameter is set to None, the system erroneously defaults to a 'Daily' frequency.

Details:

  • Affected Components: awx.awx.schedule_rrule and awx.awx.schedule_ruleset plugins
  • Issue Description: The expected behavior when setting frequency to None is for the schedule to none(run once). However, the current implementation defaults to a 'Daily' frequency, which can lead to unexpected scheduling behavior in automation tasks.
  • Location of Issue: The problematic code is located at awx_collection/plugins/lookup/schedule_rruleset.py#L153C27-L153C32.

Impact:
This bug may cause unintended daily scheduling in automation workflows, potentially leading to operational disruptions or resource misuse.

Expected Behavior:
When frequency is set to None, no default frequency should be applied, or the behavior should be explicitly documented.

Suggested Action:
A review and correction of the default behavior when frequency is set to None is recommended. Alternatively, updating the documentation to reflect the current functionality would also be beneficial.

AWX version

N/A

Select the relevant components

  • UI
  • UI (tech preview)
  • API
  • Docs
  • Collection
  • CLI
  • Other

Installation method

N/A

Modifications

no

Ansible version

ansible [core 2.16.0]

Operating system

No response

Web browser

No response

Steps to reproduce

I used this playbook

---      
- hosts: localhost
  gather_facts: false
  vars:  
    schedule_name: scheduled_bug
    deadline: '2024-04-17 10:30:45'
  tasks: 
    - name: Create a ruleset 
      set_fact:
        customized_deadline: "{{ query('ansible.controller.schedule_rruleset', rule=rrules, deadline, timezone=timezone) }}"
      vars:
        rrules:
          - frequency: none
        timezone: 'Asia/Tokyo'
         
    - ansible.controller.schedule:
        name: "{{ schedule_name }}"
        unified_job_template: acd 
        rrule: "{{ customized_deadline }}"

and after executing it
I made sure it was set to daily.

Expected results

"customized_deadline": "DTSTART;TZID=Asia/Tokyo:20240417T103000 RRULE:INTERVAL=1;COUNT=1;FREQ=MINUTELY"

When I use the data I can set None(Run Once)

Actual results

"customized_deadline": "DTSTART;TZID=Asia/Tokyo:20240430T103045 RRULE:FREQ=DAILY;COUNT=1;INTERVAL=1"

Additional information

No response

@github-actions github-actions bot added component:awx_collection issues related to the collection for controlling AWX needs_triage type:bug community labels Nov 30, 2023
@jbradberry
Copy link
Contributor

A FREQ clause is mandatory in rrule strings (https://dateutil.readthedocs.io/en/stable/rrule.html; https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.10). Our behavior as you have noticed is to default this to DAILY, but the important part is that the COUNT=1 clause is added which will provide the results you want.

Closing this as not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community component:awx_collection issues related to the collection for controlling AWX needs_triage type:bug
Projects
None yet
Development

No branches or pull requests

2 participants