Skip to content

Commit

Permalink
Merge pull request #400 from vladislav-sharapov/fix-doc-boolean-values
Browse files Browse the repository at this point in the history
Fix boolean values in docs

SUMMARY
Fixes #397
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
Docs of several modules
ADDITIONAL INFORMATION
Notes about testing. I'm not sure how to test collections properly. I have ran ansible-test sanity --python 3.10 and ansible-test units --python 3.10 in venv with ansible-core 2.14 (with 0 return code in both cases). To run units test successfully I had to install pytest-forked pip package in addition to this one pytest-xdist from test-requirements.txt.
Note about issue #397. I haven't changed yes here because in this case it is value from /etc/vfstab. Also I've changed yes for parameters masquerade and icmp_block_inversion because they both are converted to bool by boolean function and will be changed to boolean in a future release (1, 2), for required too.

Reviewed-by: Felix Fontein <felix@fontein.de>
Reviewed-by: Hideki Saito <saito@fgrep.org>
  • Loading branch information
softwarefactory-project-zuul[bot] authored Dec 22, 2022
2 parents ec72fdc + c4742cf commit a2ab688
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 95 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/400-fix-boolean-values-in-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- Change boolean values in documentation to ``true/false`` (https://github.com/ansible-collections/ansible.posix/pull/400).
16 changes: 8 additions & 8 deletions plugins/modules/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
description:
- The full path of the file or object.
type: path
required: yes
required: true
aliases: [ name ]
state:
description:
Expand All @@ -33,13 +33,13 @@
description:
- Whether to follow symlinks on the path if a symlink is encountered.
type: bool
default: yes
default: true
default:
description:
- If the target is a directory, setting this to C(yes) will make it the default ACL for entities created inside the directory.
- Setting C(default) to C(yes) causes an error if the path is a file.
- If the target is a directory, setting this to C(true) will make it the default ACL for entities created inside the directory.
- Setting C(default) to C(true) causes an error if the path is a file.
type: bool
default: no
default: false
entity:
description:
- The actual user or group that the ACL applies to when matching entity types user or group are selected.
Expand Down Expand Up @@ -70,13 +70,13 @@
- Incompatible with C(state=query).
- Alias C(recurse) added in version 1.3.0.
type: bool
default: no
default: false
aliases: [ recurse ]
use_nfsv4_acls:
description:
- Use NFSv4 ACLs instead of POSIX ACLs.
type: bool
default: no
default: false
recalculate_mask:
description:
- Select if and when to recalculate the effective right masks of the files.
Expand Down Expand Up @@ -116,7 +116,7 @@
entity: joe
etype: user
permissions: rw
default: yes
default: true
state: present
- name: Same as previous but using entry shorthand
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/at.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
description:
- If a matching job is present a new job will not be added.
type: bool
default: no
default: false
requirements:
- at
author:
Expand All @@ -68,7 +68,7 @@
command: ls -d / >/dev/null
count: 20
units: minutes
unique: yes
unique: true
'''

import os
Expand Down
30 changes: 15 additions & 15 deletions plugins/modules/authorized_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
manage_dir:
description:
- Whether this module should manage the directory of the authorized key file.
- If set to C(yes), the module will create the directory, as well as set the owner and permissions
- If set to C(true), the module will create the directory, as well as set the owner and permissions
of an existing directory.
- Be sure to set C(manage_dir=no) if you are using an alternate directory for authorized_keys,
- Be sure to set C(manage_dir=false) if you are using an alternate directory for authorized_keys,
as set with C(path), since you could lock yourself out of SSH access.
- See the example below.
type: bool
default: yes
default: true
state:
description:
- Whether the given key (with the given key_options) should or should not be in the file.
Expand All @@ -58,15 +58,15 @@
- This option is not loop aware, so if you use C(with_) , it will be exclusive per iteration of the loop.
- If you want multiple keys in the file you need to pass them all to C(key) in a single batch as mentioned above.
type: bool
default: no
default: false
validate_certs:
description:
- This only applies if using a https url as the source of the keys.
- If set to C(no), the SSL certificates will not be validated.
- This should only set to C(no) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
- Prior to 2.1 the code worked as if this was set to C(yes).
- If set to C(false), the SSL certificates will not be validated.
- This should only set to C(false) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
- Prior to 2.1 the code worked as if this was set to C(true).
type: bool
default: yes
default: true
comment:
description:
- Change the comment on the public key.
Expand All @@ -77,7 +77,7 @@
description:
- Follow path symlink instead of replacing it.
type: bool
default: no
default: false
author: Ansible Core Team
'''

Expand Down Expand Up @@ -106,7 +106,7 @@
state: present
key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}"
path: /etc/ssh/authorized_keys/charlie
manage_dir: False
manage_dir: false
- name: Set up multiple authorized keys
ansible.posix.authorized_key:
Expand All @@ -129,14 +129,14 @@
user: charlie
state: present
key: https://github.com/user.keys
validate_certs: False
validate_certs: false
- name: Set authorized key, removing all the authorized keys already set
ansible.posix.authorized_key:
user: root
key: "{{ lookup('file', 'public_keys/doe-jane') }}"
state: present
exclusive: True
exclusive: true
- name: Set authorized key for user ubuntu copying it from current user
ansible.posix.authorized_key:
Expand All @@ -150,7 +150,7 @@
description: If the key has been forced to be exclusive or not.
returned: success
type: bool
sample: False
sample: false
key:
description: The key that the module was running against.
returned: success
Expand All @@ -170,7 +170,7 @@
description: Whether this module managed the directory of the authorized key file.
returned: success
type: bool
sample: True
sample: true
path:
description: Alternate path to the authorized_keys file
returned: success
Expand All @@ -192,7 +192,7 @@
type: str
sample: user
validate_certs:
description: This only applies if using a https url as the source of the keys. If set to C(no), the SSL certificates will not be validated.
description: This only applies if using a https url as the source of the keys. If set to C(false), the SSL certificates will not be validated.
returned: success
type: bool
sample: true
Expand Down
34 changes: 17 additions & 17 deletions plugins/modules/firewalld.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@
description:
- Should this configuration be in the running firewalld configuration or persist across reboots.
- As of Ansible 2.3, permanent operations can operate on firewalld configs when it is not running (requires firewalld >= 0.3.9).
- Note that if this is C(no), immediate is assumed C(yes).
- Note that if this is C(false), immediate is assumed C(true).
type: bool
immediate:
description:
- Should this configuration be applied immediately, if set as permanent.
type: bool
default: no
default: false
state:
description:
- Enable or disable a setting.
Expand Down Expand Up @@ -141,29 +141,29 @@
- name: permit traffic in default zone for https service
ansible.posix.firewalld:
service: https
permanent: yes
permanent: true
state: enabled
- name: do not permit traffic in default zone on port 8081/tcp
ansible.posix.firewalld:
port: 8081/tcp
permanent: yes
permanent: true
state: disabled
- ansible.posix.firewalld:
port: 161-162/udp
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
zone: dmz
service: http
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
rich_rule: rule service name="ftp" audit limit value="1/m" accept
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
Expand All @@ -174,44 +174,44 @@
- ansible.posix.firewalld:
zone: trusted
interface: eth2
permanent: yes
permanent: true
state: enabled
- ansible.posix.firewalld:
masquerade: yes
masquerade: true
state: enabled
permanent: yes
permanent: true
zone: dmz
- ansible.posix.firewalld:
zone: custom
state: present
permanent: yes
permanent: true
- ansible.posix.firewalld:
zone: drop
state: enabled
permanent: yes
icmp_block_inversion: yes
permanent: true
icmp_block_inversion: true
- ansible.posix.firewalld:
zone: drop
state: enabled
permanent: yes
permanent: true
icmp_block: echo-request
- ansible.posix.firewalld:
zone: internal
state: present
permanent: yes
permanent: true
target: ACCEPT
- name: Redirect port 443 to 8443 with Rich Rule
ansible.posix.firewalld:
rich_rule: rule family=ipv4 forward-port port=443 protocol=tcp to-port=8443
zone: public
permanent: yes
immediate: yes
permanent: true
immediate: true
state: enabled
'''

Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/firewalld_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
active_zones:
description: Gather information about active zones.
type: bool
default: no
default: false
zones:
description:
- Gather information about specific zones.
Expand All @@ -36,7 +36,7 @@
EXAMPLES = r'''
- name: Gather information about active zones
ansible.posix.firewalld_info:
active_zones: yes
active_zones: true
- name: Gather information about specific zones
ansible.posix.firewalld_info:
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@
mount module will ignore C(boot).
- This parameter is ignored when I(state) is set to C(ephemeral).
type: bool
default: yes
default: true
backup:
description:
- Create a backup file including the timestamp information so you can get
the original file back if you somehow clobbered it incorrectly.
type: bool
default: no
default: false
notes:
- As of Ansible 2.3, the I(name) option has been changed to I(path) as
default, but I(name) still works as well.
Expand Down Expand Up @@ -195,7 +195,7 @@
src: 192.168.1.100:/nfs/ssd/shared_data
path: /mnt/shared_data
opts: rw,sync,hard
boot: no
boot: false
state: mounted
fstype: nfs
Expand Down
16 changes: 8 additions & 8 deletions plugins/modules/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
default: present
remote_src:
description:
- If C(no), it will search for src at originating/controller machine, if C(yes) it will
- If C(false), it will search for src at originating/controller machine, if C(true) it will
go to the remote/target machine for the C(src).
type: bool
default: no
default: false
strip:
description:
- Number that indicates the smallest prefix containing leading slashes
Expand All @@ -65,20 +65,20 @@
description:
- Passes C(--backup --version-control=numbered) to patch, producing numbered backup copies.
type: bool
default: no
default: false
binary:
description:
- Setting to C(yes) will disable patch's heuristic for transforming CRLF
- Setting to C(true) will disable patch's heuristic for transforming CRLF
line endings into LF.
- Line endings of src and dest must match.
- If set to C(no), C(patch) will replace CRLF in C(src) files on POSIX.
- If set to C(false), C(patch) will replace CRLF in C(src) files on POSIX.
type: bool
default: no
default: false
ignore_whitespace:
description:
- Setting to C(yes) will ignore white space changes between patch and input..
- Setting to C(true) will ignore white space changes between patch and input.
type: bool
default: no
default: false
notes:
- This module requires GNU I(patch) utility to be installed on the remote host.
'''
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/seboolean.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
type: str
persistent:
description:
- Set to C(yes) if the boolean setting should survive a reboot.
- Set to C(true) if the boolean setting should survive a reboot.
type: bool
default: 'no'
default: false
state:
description:
- Desired boolean value
Expand All @@ -49,8 +49,8 @@
- name: Set httpd_can_network_connect flag on and keep it persistent across reboots
ansible.posix.seboolean:
name: httpd_can_network_connect
state: yes
persistent: yes
state: true
persistent: true
'''

import os
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/selinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
description:
- If set to I(true), will update also the kernel boot parameters when disabling/enabling SELinux.
- The C(grubby) tool must be present on the target system for this to work.
default: no
default: false
type: bool
version_added: '1.4.0'
configfile:
Expand Down
Loading

0 comments on commit a2ab688

Please sign in to comment.