diff --git a/changelogs/fragments/azure_rm_autoscale-fixed_date.yml b/changelogs/fragments/azure_rm_autoscale-fixed_date.yml new file mode 100644 index 00000000000..ab81d196b53 --- /dev/null +++ b/changelogs/fragments/azure_rm_autoscale-fixed_date.yml @@ -0,0 +1,2 @@ +bugfixes: +- fix azure_rm_autoscale module can create a schedule with fixed start/end date (https://github.com/ansible/ansible/pull/47186) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_autoscale.py b/lib/ansible/modules/cloud/azure/azure_rm_autoscale.py index dacc56d5258..bcbdc7e7684 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_autoscale.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_autoscale.py @@ -549,8 +549,9 @@ class AzureRMAutoScale(AzureRMModuleBase): schedule=(RecurrentSchedule(time_zone=p.get('recurrence_timezone'), days=p.get('recurrence_days'), hours=p.get('recurrence_hours'), - minutes=p.get('recurrence_mins'))) - if p.get('recurrence_frequency') else None)) for p in self.profiles or []] + minutes=p.get('recurrence_mins')))) + if p.get('recurrence_frequency') and p['recurrence_frequency'] != 'None' else None) + for p in self.profiles or []] notifications = [AutoscaleNotification(email=EmailNotification(**n), webhooks=[WebhookNotification(service_uri=w) for w in n.get('webhooks') or []])