Skip to content

Commit

Permalink
ACA-1839 & ACA1838: Fixed undefined var issue for azure_manage_postgr…
Browse files Browse the repository at this point in the history
…esql role
  • Loading branch information
prabinovRedhat committed Sep 12, 2024
1 parent a67fbb9 commit 0cb192f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/20241109-azure_manage_postgresql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- Fixed the undefined variables issue in the create.yml and delete.yml of azure_manage_postgresql role.
3 changes: 3 additions & 0 deletions roles/azure_manage_postgresql/tasks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
value: "{{ item.value }}"
with_items: "{{ azure_manage_postgresql_postgresql_settings }}"
when:
- azure_manage_postgresql_postgresql_settings is defined
- azure_manage_postgresql_postgresql_settings | length > 0

- name: Update PostgreSQL Server Firewall rules
Expand All @@ -75,6 +76,7 @@
end_ip_address: "{{ item.end_ip_address }}"
with_items: "{{ azure_manage_postgresql_postgresql_firewall_rules }}"
when:
- azure_manage_postgresql_postgresql_firewall_rules is defined
- azure_manage_postgresql_postgresql_firewall_rules | length > 0

- name: Create/Update PostgreSQL Database instances
Expand All @@ -87,4 +89,5 @@
force_update: "{{ item.force | default(omit) }}"
with_items: "{{ azure_manage_postgresql_postgresql_database_instances }}"
when:
- azure_manage_postgresql_postgresql_database_instances is defined
- azure_manage_postgresql_postgresql_database_instances | length > 0
9 changes: 9 additions & 0 deletions roles/azure_manage_postgresql/tasks/delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
value: "{{ item.value }}"
state: absent
with_items: "{{ azure_manage_postgresql_postgresql_settings }}"
when:
- azure_manage_postgresql_postgresql_settings is defined
- azure_manage_postgresql_postgresql_settings | length > 0

- name: Delete PostgreSQL Server Firewall rules
azure.azcollection.azure_rm_postgresqlfirewallrule:
Expand All @@ -15,6 +18,9 @@
name: "{{ item.name }}"
state: absent
with_items: "{{ azure_manage_postgresql_postgresql_firewall_rules }}"
when:
- azure_manage_postgresql_postgresql_firewall_rules is defined
- azure_manage_postgresql_postgresql_firewall_rules | length > 0

- name: Delete PostgreSQL Database instances
azure.azcollection.azure_rm_postgresqldatabase:
Expand All @@ -24,6 +30,9 @@
force_update: "{{ item.force | default(omit) }}"
state: absent
with_items: "{{ azure_manage_postgresql_postgresql_database_instances }}"
when:
- azure_manage_postgresql_postgresql_database_instances is defined
- azure_manage_postgresql_postgresql_database_instances | length > 0

- name: Delete PostgreSQL Server if requested
azure.azcollection.azure_rm_postgresqlserver:
Expand Down

0 comments on commit 0cb192f

Please sign in to comment.