--- - name: Get postgresql configuration setting ansible.builtin.command: "psql -t -A -c 'SHOW {{ postgresql_setting_name }}'" become: true become_user: postgres register: postgresql_setting_rslt - name: Verify postgresql configuration setting ansible.builtin.assert: that: "postgresql_setting_rslt.stdout == '{{ postgresql_setting_value }}'" fail_msg: > postgresql setting {{ postgresql_setting_name }} value {{ postgresql_setting_rslt.stdout }} does not match expected {{ postgresql_setting_value }} success_msg: > postgresql setting {{ postgresql_setting_name }} value is {{ postgresql_setting_value }}