|
18 | 18 | relationship with a PostgreSQL database.
|
19 | 19 | - The module can be used on the machine where executed or on a remote host.
|
20 | 20 | - When removing a language from a database, it is possible that dependencies prevent
|
21 |
| - the database from being removed. In that case, you can specify I(cascade=yes) to |
| 21 | + the database from being removed. In that case, you can specify I(cascade=true) to |
22 | 22 | automatically drop objects that depend on the language (such as functions in the
|
23 | 23 | language).
|
24 | 24 | - In case the language can't be deleted because it is required by the
|
25 |
| - database system, you can specify I(fail_on_drop=no) to ignore the error. |
| 25 | + database system, you can specify I(fail_on_drop=false) to ignore the error. |
26 | 26 | - Be careful when marking a language as trusted since this could be a potential
|
27 | 27 | security breach. Untrusted languages allow only users with the PostgreSQL superuser
|
28 | 28 | privilege to use this language to create new functions.
|
|
38 | 38 | description:
|
39 | 39 | - Make this language trusted for the selected db.
|
40 | 40 | type: bool
|
41 |
| - default: 'no' |
| 41 | + default: 'false' |
42 | 42 | db:
|
43 | 43 | description:
|
44 | 44 | - Name of database to connect to and where the language will be added, removed or changed.
|
|
51 | 51 | - Marks the language as trusted, even if it's marked as untrusted in pg_pltemplate.
|
52 | 52 | - Use with care!
|
53 | 53 | type: bool
|
54 |
| - default: 'no' |
| 54 | + default: 'false' |
55 | 55 | fail_on_drop:
|
56 | 56 | description:
|
57 |
| - - If C(yes), fail when removing a language. Otherwise just log and continue. |
| 57 | + - If C(true), fail when removing a language. Otherwise just log and continue. |
58 | 58 | - In some cases, it is not possible to remove a language (used by the db-system).
|
59 | 59 | - When dependencies block the removal, consider using I(cascade).
|
60 | 60 | type: bool
|
61 |
| - default: 'yes' |
| 61 | + default: 'true' |
62 | 62 | cascade:
|
63 | 63 | description:
|
64 | 64 | - When dropping a language, also delete object that depend on this language.
|
65 | 65 | - Only used when I(state=absent).
|
66 | 66 | type: bool
|
67 |
| - default: 'no' |
| 67 | + default: 'false' |
68 | 68 | session_role:
|
69 | 69 | description:
|
70 | 70 | - Switch to session_role after connecting.
|
|
104 | 104 | version_added: '0.2.0'
|
105 | 105 | trust_input:
|
106 | 106 | description:
|
107 |
| - - If C(no), check whether values of parameters I(lang), I(session_role), |
| 107 | + - If C(false), check whether values of parameters I(lang), I(session_role), |
108 | 108 | I(owner) are potentially dangerous.
|
109 |
| - - It makes sense to use C(no) only when SQL injections via the parameters are possible. |
| 109 | + - It makes sense to use C(false) only when SQL injections via the parameters are possible. |
110 | 110 | type: bool
|
111 |
| - default: yes |
| 111 | + default: true |
112 | 112 | version_added: '0.2.0'
|
113 | 113 | seealso:
|
114 | 114 | - name: PostgreSQL languages
|
|
145 | 145 | db: testdb
|
146 | 146 | lang: pltclu
|
147 | 147 | state: present
|
148 |
| - trust: yes |
149 |
| - force_trust: yes |
| 148 | + trust: true |
| 149 | + force_trust: true |
150 | 150 |
|
151 | 151 | - name: Remove language pltclu from database testdb
|
152 | 152 | community.postgresql.postgresql_lang:
|
|
159 | 159 | db: testdb
|
160 | 160 | lang: pltclu
|
161 | 161 | state: absent
|
162 |
| - cascade: yes |
| 162 | + cascade: true |
163 | 163 |
|
164 | 164 | - name: Remove language c from database testdb but ignore errors if something prevents the removal
|
165 | 165 | community.postgresql.postgresql_lang:
|
166 | 166 | db: testdb
|
167 | 167 | lang: pltclu
|
168 | 168 | state: absent
|
169 |
| - fail_on_drop: no |
| 169 | + fail_on_drop: false |
170 | 170 |
|
171 | 171 | - name: In testdb change owner of mylang to alice
|
172 | 172 | community.postgresql.postgresql_lang:
|
@@ -279,13 +279,13 @@ def main():
|
279 | 279 | db=dict(type="str", required=True, aliases=["login_db"]),
|
280 | 280 | lang=dict(type="str", required=True, aliases=["name"]),
|
281 | 281 | state=dict(type="str", default="present", choices=["absent", "present"]),
|
282 |
| - trust=dict(type="bool", default="no"), |
283 |
| - force_trust=dict(type="bool", default="no"), |
284 |
| - cascade=dict(type="bool", default="no"), |
285 |
| - fail_on_drop=dict(type="bool", default="yes"), |
| 282 | + trust=dict(type="bool", default="false"), |
| 283 | + force_trust=dict(type="bool", default="false"), |
| 284 | + cascade=dict(type="bool", default="false"), |
| 285 | + fail_on_drop=dict(type="bool", default="true"), |
286 | 286 | session_role=dict(type="str"),
|
287 | 287 | owner=dict(type="str"),
|
288 |
| - trust_input=dict(type="bool", default="yes") |
| 288 | + trust_input=dict(type="bool", default="true") |
289 | 289 | )
|
290 | 290 |
|
291 | 291 | module = AnsibleModule(
|
@@ -340,7 +340,7 @@ def main():
|
340 | 340 | changed = lang_drop(cursor, lang, cascade)
|
341 | 341 | if fail_on_drop and not changed:
|
342 | 342 | msg = ("unable to drop language, use cascade "
|
343 |
| - "to delete dependencies or fail_on_drop=no to ignore") |
| 343 | + "to delete dependencies or fail_on_drop=false to ignore") |
344 | 344 | module.fail_json(msg=msg)
|
345 | 345 | kw['lang_dropped'] = changed
|
346 | 346 |
|
|
0 commit comments