mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
postgresql_set: allow to pass an empty string as a value (#776)
* postgresql_set: allow to pass an empty string as a value * add check_mode to CI for the case * add changelog fragment * add pause * fix * fix ci * fix * fix * add suggested
This commit is contained in:
parent
4e56347fc1
commit
05556dc671
4 changed files with 59 additions and 5 deletions
|
@ -1,3 +1,3 @@
|
|||
# Initial CI tests of postgresql_initial module
|
||||
- include_tasks: postgresql_set_initial.yml
|
||||
when: postgres_version_resp.stdout is version('9.4', '>=')
|
||||
when: postgres_version_resp.stdout is version('9.6', '>=')
|
||||
|
|
|
@ -321,3 +321,55 @@
|
|||
that:
|
||||
- result is failed
|
||||
- result.msg is search('is potentially dangerous')
|
||||
|
||||
###############################################################################
|
||||
# Bugfix of https://github.com/ansible-collections/community.general/issues/775
|
||||
- name: postgresql_set - turn on archive mode
|
||||
<<: *task_parameters
|
||||
postgresql_set:
|
||||
<<: *pg_parameters
|
||||
name: archive_mode
|
||||
value: 'on'
|
||||
|
||||
- name: Restart PostgreSQL
|
||||
become: yes
|
||||
service:
|
||||
name: "{{ postgresql_service }}"
|
||||
state: restarted
|
||||
|
||||
- name: postgresql_set - set empty string as value
|
||||
<<: *task_parameters
|
||||
postgresql_set:
|
||||
<<: *pg_parameters
|
||||
name: archive_command
|
||||
value: ''
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is changed
|
||||
|
||||
- name: postgresql_set - set empty string as value again
|
||||
<<: *task_parameters
|
||||
postgresql_set:
|
||||
<<: *pg_parameters
|
||||
name: archive_command
|
||||
value: ''
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
|
||||
- name: postgresql_set - set empty string as value again in check mode
|
||||
<<: *task_parameters
|
||||
postgresql_set:
|
||||
<<: *pg_parameters
|
||||
name: archive_command
|
||||
value: ''
|
||||
register: result
|
||||
check_mode: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue