Skip to content

Commit 6ed91b3

Browse files
hunleydAndersson007jchancojr
authored
backport 337 to stable-1 (#339)
Co-authored-by: Andrew Klychkov <[email protected]> Co-authored-by: Jim Chanco Jr <[email protected]>
1 parent dd54ce3 commit 6ed91b3

File tree

65 files changed

+1013
-1012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1013
-1012
lines changed

plugins/modules/postgresql_copy.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
- Mark I(src)/I(dst) as a program. Data will be copied to/from a program.
5252
- See block Examples and PROGRAM arg description U(https://www.postgresql.org/docs/current/sql-copy.html).
5353
type: bool
54-
default: no
54+
default: false
5555
options:
5656
description:
5757
- Options of COPY command.
@@ -71,17 +71,17 @@
7171
type: str
7272
trust_input:
7373
description:
74-
- If C(no), check whether values of parameters are potentially dangerous.
75-
- It makes sense to use C(no) only when SQL injections are possible.
74+
- If C(false), check whether values of parameters are potentially dangerous.
75+
- It makes sense to use C(false) only when SQL injections are possible.
7676
type: bool
77-
default: yes
77+
default: true
7878
version_added: '0.2.0'
7979
notes:
8080
- Supports PostgreSQL version 9.4+.
8181
- COPY command is only allowed to database superusers.
82-
- If I(check_mode=yes), we just check the src/dst table availability
82+
- If I(check_mode=true), we just check the src/dst table availability
8383
and return the COPY query that actually has not been executed.
84-
- If i(check_mode=yes) and the source has been passed as SQL, the module
84+
- If i(check_mode=true) and the source has been passed as SQL, the module
8585
will execute it and rolled the transaction back but pay attention
8686
it can affect database performance (e.g., if SQL collects a lot of data).
8787
@@ -137,7 +137,7 @@
137137
community.postgresql.postgresql_copy:
138138
src: my_table
139139
copy_to: 'gzip > /tmp/data.csv.gz'
140-
program: yes
140+
program: true
141141
options:
142142
format: csv
143143

plugins/modules/postgresql_db.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@
121121
version_added: '0.2.0'
122122
trust_input:
123123
description:
124-
- If C(no), check whether values of parameters I(owner), I(conn_limit), I(encoding),
124+
- If C(false), check whether values of parameters I(owner), I(conn_limit), I(encoding),
125125
I(db), I(template), I(tablespace), I(session_role) are potentially dangerous.
126-
- It makes sense to use C(no) only when SQL injections via the parameters are possible.
126+
- It makes sense to use C(false) only when SQL injections via the parameters are possible.
127127
type: bool
128-
default: yes
128+
default: true
129129
version_added: '0.2.0'
130130
seealso:
131131
- name: CREATE DATABASE reference

plugins/modules/postgresql_ext.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
- Automatically install/remove any extensions that this extension depends on
5050
that are not already installed/removed (supported since PostgreSQL 9.6).
5151
type: bool
52-
default: no
52+
default: false
5353
login_unix_socket:
5454
description:
5555
- Path to a Unix domain socket for local connections.
@@ -81,11 +81,11 @@
8181
type: str
8282
trust_input:
8383
description:
84-
- If C(no), check whether values of parameters I(ext), I(schema),
84+
- If C(false), check whether values of parameters I(ext), I(schema),
8585
I(version), I(session_role) are potentially dangerous.
86-
- It makes sense to use C(no) only when SQL injections via the parameters are possible.
86+
- It makes sense to use C(false) only when SQL injections via the parameters are possible.
8787
type: bool
88-
default: yes
88+
default: true
8989
version_added: '0.2.0'
9090
seealso:
9191
- name: PostgreSQL extensions
@@ -148,7 +148,7 @@
148148
community.postgresql.postgresql_ext:
149149
name: cube
150150
db: acme
151-
cascade: yes
151+
cascade: true
152152
state: absent
153153
154154
- name: Create extension foo of version 1.2 or update it to that version if it's already created and a valid update path exists

plugins/modules/postgresql_idx.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,19 @@
7575
concurrent:
7676
description:
7777
- Enable or disable concurrent mode (CREATE / DROP INDEX CONCURRENTLY).
78-
- Pay attention, if I(concurrent=no), the table will be locked (ACCESS EXCLUSIVE) during the building process.
78+
- Pay attention, if I(concurrent=false), the table will be locked (ACCESS EXCLUSIVE) during the building process.
7979
For more information about the lock levels see U(https://www.postgresql.org/docs/current/explicit-locking.html).
80-
- If the building process was interrupted for any reason when I(cuncurrent=yes), the index becomes invalid.
80+
- If the building process was interrupted for any reason when I(cuncurrent=true), the index becomes invalid.
8181
In this case it should be dropped and created again.
82-
- Mutually exclusive with I(cascade=yes).
82+
- Mutually exclusive with I(cascade=true).
8383
type: bool
84-
default: yes
84+
default: true
8585
unique:
8686
description:
8787
- Enable unique index.
8888
- Only btree currently supports unique indexes.
8989
type: bool
90-
default: no
90+
default: false
9191
version_added: '0.2.0'
9292
tablespace:
9393
description:
@@ -105,17 +105,17 @@
105105
- Automatically drop objects that depend on the index,
106106
and in turn all objects that depend on those objects.
107107
- It used only with I(state=absent).
108-
- Mutually exclusive with I(concurrent=yes).
108+
- Mutually exclusive with I(concurrent=true).
109109
type: bool
110-
default: no
110+
default: false
111111
trust_input:
112112
description:
113-
- If C(no), check whether values of parameters I(idxname), I(session_role),
113+
- If C(false), check whether values of parameters I(idxname), I(session_role),
114114
I(schema), I(table), I(columns), I(tablespace), I(storage_params),
115115
I(cond) are potentially dangerous.
116-
- It makes sense to use C(no) only when SQL injections via the parameters are possible.
116+
- It makes sense to use C(false) only when SQL injections via the parameters are possible.
117117
type: bool
118-
default: yes
118+
default: true
119119
version_added: '0.2.0'
120120
121121
seealso:
@@ -137,7 +137,7 @@
137137
notes:
138138
- Supports C(check_mode).
139139
- The index building process can affect database performance.
140-
- To avoid table locks on production databases, use I(concurrent=yes) (default behavior).
140+
- To avoid table locks on production databases, use I(concurrent=true) (default behavior).
141141
142142
author:
143143
- Andrew Klychkov (@Andersson007)
@@ -182,7 +182,7 @@
182182
idxname: gin0_idx
183183
table: test
184184
columns: comment gin_trgm_ops
185-
concurrent: no
185+
concurrent: false
186186
idxtype: gin
187187
188188
- name: Drop btree test_idx concurrently
@@ -196,8 +196,8 @@
196196
db: mydb
197197
idxname: test_idx
198198
state: absent
199-
cascade: yes
200-
concurrent: no
199+
cascade: true
200+
concurrent: false
201201
202202
- name: Create btree index test_idx concurrently on columns id,comment where column id > 1
203203
community.postgresql.postgresql_idx:
@@ -213,8 +213,8 @@
213213
table: products
214214
columns: name
215215
name: test_unique_idx
216-
unique: yes
217-
concurrent: no
216+
unique: true
217+
concurrent: false
218218
'''
219219

220220
RETURN = r'''

plugins/modules/postgresql_info.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@
4242
type: str
4343
trust_input:
4444
description:
45-
- If C(no), check whether a value of I(session_role) is potentially dangerous.
46-
- It makes sense to use C(no) only when SQL injections via I(session_role) are possible.
45+
- If C(false), check whether a value of I(session_role) is potentially dangerous.
46+
- It makes sense to use C(false) only when SQL injections via I(session_role) are possible.
4747
type: bool
48-
default: yes
48+
default: true
4949
version_added: '0.2.0'
5050
seealso:
5151
- module: community.postgresql.postgresql_ping
@@ -72,21 +72,21 @@
7272
# ansible databases -m postgresql_info -a 'filter=!settings'
7373
7474
- name: Collect PostgreSQL version and extensions
75-
become: yes
75+
become: true
7676
become_user: postgres
7777
community.postgresql.postgresql_info:
7878
filter: ver*,ext*
7979
8080
- name: Collect all info except settings and roles
81-
become: yes
81+
become: true
8282
become_user: postgres
8383
community.postgresql.postgresql_info:
8484
filter: "!settings,!roles"
8585
8686
# On FreeBSD with PostgreSQL 9.5 version and lower use pgsql user to become
8787
# and pass "postgres" as a database to connect to
8888
- name: Collect tablespaces and repl_slots info
89-
become: yes
89+
become: true
9090
become_user: pgsql
9191
community.postgresql.postgresql_info:
9292
db: postgres
@@ -95,7 +95,7 @@
9595
- repl_sl*
9696
9797
- name: Collect all info except databases
98-
become: yes
98+
become: true
9999
become_user: postgres
100100
community.postgresql.postgresql_info:
101101
filter:

plugins/modules/postgresql_lang.py

+20-20
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
relationship with a PostgreSQL database.
1919
- The module can be used on the machine where executed or on a remote host.
2020
- 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
2222
automatically drop objects that depend on the language (such as functions in the
2323
language).
2424
- 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.
2626
- Be careful when marking a language as trusted since this could be a potential
2727
security breach. Untrusted languages allow only users with the PostgreSQL superuser
2828
privilege to use this language to create new functions.
@@ -38,7 +38,7 @@
3838
description:
3939
- Make this language trusted for the selected db.
4040
type: bool
41-
default: 'no'
41+
default: 'false'
4242
db:
4343
description:
4444
- Name of database to connect to and where the language will be added, removed or changed.
@@ -51,20 +51,20 @@
5151
- Marks the language as trusted, even if it's marked as untrusted in pg_pltemplate.
5252
- Use with care!
5353
type: bool
54-
default: 'no'
54+
default: 'false'
5555
fail_on_drop:
5656
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.
5858
- In some cases, it is not possible to remove a language (used by the db-system).
5959
- When dependencies block the removal, consider using I(cascade).
6060
type: bool
61-
default: 'yes'
61+
default: 'true'
6262
cascade:
6363
description:
6464
- When dropping a language, also delete object that depend on this language.
6565
- Only used when I(state=absent).
6666
type: bool
67-
default: 'no'
67+
default: 'false'
6868
session_role:
6969
description:
7070
- Switch to session_role after connecting.
@@ -104,11 +104,11 @@
104104
version_added: '0.2.0'
105105
trust_input:
106106
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),
108108
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.
110110
type: bool
111-
default: yes
111+
default: true
112112
version_added: '0.2.0'
113113
seealso:
114114
- name: PostgreSQL languages
@@ -145,8 +145,8 @@
145145
db: testdb
146146
lang: pltclu
147147
state: present
148-
trust: yes
149-
force_trust: yes
148+
trust: true
149+
force_trust: true
150150
151151
- name: Remove language pltclu from database testdb
152152
community.postgresql.postgresql_lang:
@@ -159,14 +159,14 @@
159159
db: testdb
160160
lang: pltclu
161161
state: absent
162-
cascade: yes
162+
cascade: true
163163
164164
- name: Remove language c from database testdb but ignore errors if something prevents the removal
165165
community.postgresql.postgresql_lang:
166166
db: testdb
167167
lang: pltclu
168168
state: absent
169-
fail_on_drop: no
169+
fail_on_drop: false
170170
171171
- name: In testdb change owner of mylang to alice
172172
community.postgresql.postgresql_lang:
@@ -279,13 +279,13 @@ def main():
279279
db=dict(type="str", required=True, aliases=["login_db"]),
280280
lang=dict(type="str", required=True, aliases=["name"]),
281281
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"),
286286
session_role=dict(type="str"),
287287
owner=dict(type="str"),
288-
trust_input=dict(type="bool", default="yes")
288+
trust_input=dict(type="bool", default="true")
289289
)
290290

291291
module = AnsibleModule(
@@ -340,7 +340,7 @@ def main():
340340
changed = lang_drop(cursor, lang, cascade)
341341
if fail_on_drop and not changed:
342342
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")
344344
module.fail_json(msg=msg)
345345
kw['lang_dropped'] = changed
346346

plugins/modules/postgresql_membership.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
groups:
2424
description:
2525
- The list of groups (roles) that need to be granted to or revoked from I(target_roles).
26-
required: yes
26+
required: true
2727
type: list
2828
elements: str
2929
aliases:
@@ -33,7 +33,7 @@
3333
target_roles:
3434
description:
3535
- The list of target roles (groups will be granted to them).
36-
required: yes
36+
required: true
3737
type: list
3838
elements: str
3939
aliases:
@@ -42,8 +42,8 @@
4242
- user
4343
fail_on_role:
4444
description:
45-
- If C(yes), fail when group or target_role doesn't exist. If C(no), just warn and continue.
46-
default: yes
45+
- If C(true), fail when group or target_role doesn't exist. If C(false), just warn and continue.
46+
default: true
4747
type: bool
4848
state:
4949
description:
@@ -68,11 +68,11 @@
6868
type: str
6969
trust_input:
7070
description:
71-
- If C(no), check whether values of parameters I(groups),
71+
- If C(false), check whether values of parameters I(groups),
7272
I(target_roles), I(session_role) are potentially dangerous.
73-
- It makes sense to use C(no) only when SQL injections via the parameters are possible.
73+
- It makes sense to use C(false) only when SQL injections via the parameters are possible.
7474
type: bool
75-
default: yes
75+
default: true
7676
version_added: '0.2.0'
7777
seealso:
7878
- module: community.postgresql.postgresql_user
@@ -109,7 +109,7 @@
109109
- read_only
110110
- exec_func
111111
target_role: bob
112-
fail_on_role: no
112+
fail_on_role: false
113113
state: absent
114114
'''
115115

0 commit comments

Comments
 (0)