diff --git a/README.md b/README.md index 3683489..d556096 100644 --- a/README.md +++ b/README.md @@ -15,27 +15,7 @@ This collection has been tested against following Ansible versions: **>=2.14**. ## Included content - - -### Modules -Name | Description ---- | --- -[ansible.posix.acl](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.acl_module.rst)|Set and retrieve file ACL information. -[ansible.posix.at](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.at_module.rst)|Schedule the execution of a command or script file via the at command -[ansible.posix.authorized_key](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.authorized_key_module.rst)|Adds or removes an SSH authorized key -[ansible.posix.firewalld](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.firewalld_module.rst)|Manage arbitrary ports/services with firewalld -[ansible.posix.firewalld_info](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.firewalld_info_module.rst)|Gather information about firewalld -[ansible.posix.mount](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.mount_module.rst)|Control active and configured mount points -[ansible.posix.patch](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.patch_module.rst)|Apply patch files using the GNU patch tool -[ansible.posix.rhel_facts](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.rhel_facts_module.rst)|Facts module to set or override RHEL specific facts. -[ansible.posix.rhel_rpm_ostree](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.rhel_rpm_ostree_module.rst)|Ensure packages exist in a RHEL for Edge rpm-ostree based system -[ansible.posix.rpm_ostree_upgrade](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.rpm_ostree_upgrade_module.rst)|Manage rpm-ostree upgrade transactions -[ansible.posix.seboolean](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.seboolean_module.rst)|Toggles SELinux booleans -[ansible.posix.selinux](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.selinux_module.rst)|Change policy and state of SELinux -[ansible.posix.synchronize](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.synchronize_module.rst)|A wrapper around rsync to make common tasks in your playbooks quick and easy -[ansible.posix.sysctl](https://github.com/ansible-collections/ansible.posix/blob/main/docs/ansible.posix.sysctl_module.rst)|Manage entries in sysctl.conf. - - +Check out [Ansible Galaxy](https://galaxy.ansible.com/ui/repo/published/ansible/posix/content/) or [the Ansible documentation](https://docs.ansible.com/ansible/devel/collections/ansible/posix/) for all modules and plugins included in this collection. ## Installing this collection diff --git a/docs/ansible.posix.acl_module.rst b/docs/ansible.posix.acl_module.rst deleted file mode 100644 index 6a13d89..0000000 --- a/docs/ansible.posix.acl_module.rst +++ /dev/null @@ -1,346 +0,0 @@ -.. _ansible.posix.acl_module: - - -***************** -ansible.posix.acl -***************** - -**Set and retrieve file ACL information.** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- Set and retrieve file ACL information. - - - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- default - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
If the target is a directory, setting this to true will make it the default ACL for entities created inside the directory.
-
Setting default to true causes an error if the path is a file.
-
-
- entity - -
- string -
-
- Default:
""
-
-
The actual user or group that the ACL applies to when matching entity types user or group are selected.
-
-
- entry - -
- string -
-
- -
DEPRECATED.
-
The ACL to set or remove.
-
This must always be quoted in the form of <etype>:<qualifier>:<perms>.
-
The qualifier may be empty for some types, but the type and perms are always required.
-
- can be used as placeholder when you do not care about permissions.
-
This is now superseded by entity, type and permissions fields.
-
-
- etype - -
- string -
-
-
    Choices: -
  • group
  • -
  • mask
  • -
  • other
  • -
  • user
  • -
-
-
The entity type of the ACL to apply, see setfacl documentation for more info.
-
-
- follow - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes ←
  • -
-
-
Whether to follow symlinks on the path if a symlink is encountered.
-
-
- path - -
- path - / required -
-
- -
The full path of the file or object.
-

aliases: name
-
-
- permissions - -
- string -
-
- -
The permissions to apply/remove can be any combination of r, w, x
-
(read, write and execute respectively), and X (execute permission if the file is a directory or already has execute permission for some user)
-
-
- recalculate_mask - -
- string -
-
-
    Choices: -
  • default ←
  • -
  • mask
  • -
  • no_mask
  • -
-
-
Select if and when to recalculate the effective right masks of the files.
-
See setfacl documentation for more info.
-
Incompatible with state=query.
-
-
- recursive - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Recursively sets the specified ACL.
-
Incompatible with state=query.
-
Alias recurse added in version 1.3.0.
-

aliases: recurse
-
-
- state - -
- string -
-
-
    Choices: -
  • absent
  • -
  • present
  • -
  • query ←
  • -
-
-
Define whether the ACL should be present or not.
-
The query state gets the current ACL without changing it, for use in register operations.
-
-
- use_nfsv4_acls - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Use NFSv4 ACLs instead of POSIX ACLs.
-
-
- - -Notes ------ - -.. note:: - - The ``acl`` module requires that ACLs are enabled on the target filesystem and that the ``setfacl`` and ``getfacl`` binaries are installed. - - As of Ansible 2.0, this module only supports Linux distributions. - - As of Ansible 2.3, the *name* option has been changed to *path* as default, but *name* still works as well. - - - -Examples --------- - -.. code-block:: yaml - - - name: Grant user Joe read access to a file - ansible.posix.acl: - path: /etc/foo.conf - entity: joe - etype: user - permissions: r - state: present - - - name: Removes the ACL for Joe on a specific file - ansible.posix.acl: - path: /etc/foo.conf - entity: joe - etype: user - state: absent - - - name: Sets default ACL for joe on /etc/foo.d/ - ansible.posix.acl: - path: /etc/foo.d/ - entity: joe - etype: user - permissions: rw - default: true - state: present - - - name: Same as previous but using entry shorthand - ansible.posix.acl: - path: /etc/foo.d/ - entry: default:user:joe:rw- - state: present - - - name: Obtain the ACL for a specific file - ansible.posix.acl: - path: /etc/foo.conf - register: acl_info - - - -Return Values -------------- -Common return values are documented `here `_, the following are the fields unique to this module: - -.. raw:: html - - - - - - - - - - - - -
KeyReturnedDescription
-
- acl - -
- list -
-
success -
Current ACL on provided path (after changes, if any)
-
-
Sample:
-
['user::rwx', 'group::rwx', 'other::rwx']
-
-

- - -Status ------- - - -Authors -~~~~~~~ - -- Brian Coca (@bcoca) -- Jérémie Astori (@astorije) diff --git a/docs/ansible.posix.at_module.rst b/docs/ansible.posix.at_module.rst deleted file mode 100644 index 3d731a2..0000000 --- a/docs/ansible.posix.at_module.rst +++ /dev/null @@ -1,186 +0,0 @@ -.. _ansible.posix.at_module: - - -**************** -ansible.posix.at -**************** - -**Schedule the execution of a command or script file via the at command** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- Use this module to schedule a command or script file to run once in the future. -- All jobs are executed in the 'a' queue. - - - -Requirements ------------- -The below requirements are needed on the host that executes this module. - -- at - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- command - -
- string -
-
- -
A command to be executed in the future.
-
-
- count - -
- integer -
-
- -
The count of units in the future to execute the command or script file.
-
-
- script_file - -
- string -
-
- -
An existing script file to be executed in the future.
-
-
- state - -
- string -
-
-
    Choices: -
  • absent
  • -
  • present ←
  • -
-
-
The state dictates if the command or script file should be evaluated as present(added) or absent(deleted).
-
-
- unique - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
If a matching job is present a new job will not be added.
-
-
- units - -
- string -
-
-
    Choices: -
  • minutes
  • -
  • hours
  • -
  • days
  • -
  • weeks
  • -
-
-
The type of units in the future to execute the command or script file.
-
-
- - - - -Examples --------- - -.. code-block:: yaml - - - name: Schedule a command to execute in 20 minutes as root - ansible.posix.at: - command: ls -d / >/dev/null - count: 20 - units: minutes - - - name: Match a command to an existing job and delete the job - ansible.posix.at: - command: ls -d / >/dev/null - state: absent - - - name: Schedule a command to execute in 20 minutes making sure it is unique in the queue - ansible.posix.at: - command: ls -d / >/dev/null - count: 20 - units: minutes - unique: true - - - - -Status ------- - - -Authors -~~~~~~~ - -- Richard Isaacson (@risaacson) diff --git a/docs/ansible.posix.authorized_key_module.rst b/docs/ansible.posix.authorized_key_module.rst deleted file mode 100644 index 53efe25..0000000 --- a/docs/ansible.posix.authorized_key_module.rst +++ /dev/null @@ -1,480 +0,0 @@ -.. _ansible.posix.authorized_key_module: - - -**************************** -ansible.posix.authorized_key -**************************** - -**Adds or removes an SSH authorized key** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- Adds or removes SSH authorized keys for particular user accounts. - - - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- comment - -
- string -
-
- -
Change the comment on the public key.
-
Rewriting the comment is useful in cases such as fetching it from GitHub or GitLab.
-
If no comment is specified, the existing comment will be kept.
-
-
- exclusive - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Whether to remove all other non-specified keys from the authorized_keys file.
-
Multiple keys can be specified in a single key string value by separating them by newlines.
-
This option is not loop aware, so if you use 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 key in a single batch as mentioned above.
-
-
- follow - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Follow path symlink instead of replacing it.
-
-
- key - -
- string - / required -
-
- -
The SSH public key(s), as a string or (since Ansible 1.9) url (https://github.com/username.keys).
-
-
- key_options - -
- string -
-
- -
A string of ssh key options to be prepended to the key in the authorized_keys file.
-
-
- manage_dir - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes ←
  • -
-
-
Whether this module should manage the directory of the authorized key file.
-
If set to true, the module will create the directory, as well as set the owner and permissions of an existing directory.
-
Be sure to set manage_dir=false if you are using an alternate directory for authorized_keys, as set with path, since you could lock yourself out of SSH access.
-
See the example below.
-
-
- path - -
- path -
-
- -
Alternate path to the authorized_keys file.
-
When unset, this value defaults to ~/.ssh/authorized_keys.
-
-
- state - -
- string -
-
-
    Choices: -
  • absent
  • -
  • present ←
  • -
-
-
Whether the given key (with the given key_options) should or should not be in the file.
-
-
- user - -
- string - / required -
-
- -
The username on the remote host whose authorized_keys file will be modified.
-
-
- validate_certs - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes ←
  • -
-
-
This only applies if using a https url as the source of the keys.
-
If set to false, the SSL certificates will not be validated.
-
This should only set to 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 true.
-
-
- - - - -Examples --------- - -.. code-block:: yaml - - - name: Set authorized key taken from file - ansible.posix.authorized_key: - user: charlie - state: present - key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}" - - - name: Set authorized keys taken from url - ansible.posix.authorized_key: - user: charlie - state: present - key: https://github.com/charlie.keys - - - name: Set authorized keys taken from url using lookup - ansible.posix.authorized_key: - user: charlie - state: present - key: "{{ lookup('url', 'https://github.com/charlie.keys', split_lines=False) }}" - - - name: Set authorized key in alternate location - ansible.posix.authorized_key: - user: charlie - state: present - key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}" - path: /etc/ssh/authorized_keys/charlie - manage_dir: false - - - name: Set up multiple authorized keys - ansible.posix.authorized_key: - user: deploy - state: present - key: '{{ item }}' - with_file: - - public_keys/doe-jane - - public_keys/doe-john - - - name: Set authorized key defining key options - ansible.posix.authorized_key: - user: charlie - state: present - key: "{{ lookup('file', '/home/charlie/.ssh/id_rsa.pub') }}" - key_options: 'no-port-forwarding,from="10.0.1.1"' - - - name: Set authorized key without validating the TLS/SSL certificates - ansible.posix.authorized_key: - user: charlie - state: present - key: https://github.com/user.keys - 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 - - - name: Set authorized key for user ubuntu copying it from current user - ansible.posix.authorized_key: - user: ubuntu - state: present - key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}" - - - -Return Values -------------- -Common return values are documented `here `_, the following are the fields unique to this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyReturnedDescription
-
- exclusive - -
- boolean -
-
success -
If the key has been forced to be exclusive or not.
-
-
-
- key - -
- string -
-
success -
The key that the module was running against.
-
-
Sample:
-
https://github.com/user.keys
-
-
- key_option - -
- string -
-
success -
Key options related to the key.
-
-
-
- keyfile - -
- string -
-
success -
Path for authorized key file.
-
-
Sample:
-
/home/user/.ssh/authorized_keys
-
-
- manage_dir - -
- boolean -
-
success -
Whether this module managed the directory of the authorized key file.
-
-
Sample:
-
True
-
-
- path - -
- string -
-
success -
Alternate path to the authorized_keys file
-
-
-
- state - -
- string -
-
success -
Whether the given key (with the given key_options) should or should not be in the file
-
-
Sample:
-
present
-
-
- unique - -
- boolean -
-
success -
Whether the key is unique
-
-
-
- user - -
- string -
-
success -
The username on the remote host whose authorized_keys file will be modified
-
-
Sample:
-
user
-
-
- validate_certs - -
- boolean -
-
success -
This only applies if using a https url as the source of the keys. If set to false, the SSL certificates will not be validated.
-
-
Sample:
-
True
-
-

- - -Status ------- - - -Authors -~~~~~~~ - -- Ansible Core Team diff --git a/docs/ansible.posix.firewalld_info_module.rst b/docs/ansible.posix.firewalld_info_module.rst deleted file mode 100644 index 911acce..0000000 --- a/docs/ansible.posix.firewalld_info_module.rst +++ /dev/null @@ -1,526 +0,0 @@ -.. _ansible.posix.firewalld_info_module: - - -**************************** -ansible.posix.firewalld_info -**************************** - -**Gather information about firewalld** - - - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- This module gathers information about firewalld rules. - - - -Requirements ------------- -The below requirements are needed on the host that executes this module. - -- firewalld >= 0.2.11 -- python-firewall -- python-dbus - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- active_zones - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Gather information about active zones.
-
-
- zones - -
- list - / elements=string -
-
- -
Gather information about specific zones.
-
If only works if active_zones is set to false.
-
-
- - - - -Examples --------- - -.. code-block:: yaml - - - name: Gather information about active zones - ansible.posix.firewalld_info: - active_zones: true - register: result - - - name: Print default zone for debugging - ansible.builtin.debug: - var: result.firewalld_info.default_zone - - - name: Gather information about specific zones - ansible.posix.firewalld_info: - zones: - - public - - external - - internal - register: result - - - -Return Values -------------- -Common return values are documented `here `_, the following are the fields unique to this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyReturnedDescription
-
- active_zones - -
- boolean -
-
success -
Gather active zones only if turn it true.
-
-
-
- collected_zones - -
- list -
-
success -
A list of collected zones.
-
-
Sample:
-
['external', 'internal']
-
-
- firewalld_info - -
- complex -
-
success -
Returns various information about firewalld configuration.
-
-
  -
- default_zone - -
- string -
-
success -
The zone name of default zone.
-
-
Sample:
-
public
-
  -
- version - -
- string -
-
success -
The version information of firewalld.
-
-
Sample:
-
0.8.2
-
  -
- zones - -
- complex -
-
success -
A dict of zones to gather information.
-
-
   -
- zone - -
- complex -
-
success -
The zone name registered in firewalld.
-
-
Sample:
-
external
-
    -
- forward - -
- boolean -
-
success -
The network interface forwarding.
-
This parameter supports on python-firewall 0.9.0(or later) and is not collected in earlier versions.
-
-
    -
- forward_ports - -
- list -
-
success -
A list of forwarding port pair with protocol.
-
-
Sample:
-
['icmp', 'ipv6-icmp']
-
    -
- icmp_block_inversion - -
- boolean -
-
success -
The ICMP block inversion to block all ICMP requests.
-
-
    -
- icmp_blocks - -
- list -
-
success -
A list of blocking icmp protocol.
-
-
Sample:
-
['echo-request']
-
    -
- interfaces - -
- list -
-
success -
A list of network interfaces.
-
-
Sample:
-
['eth0', 'eth1']
-
    -
- masquerade - -
- boolean -
-
success -
The network interface masquerading.
-
-
    -
- ports - -
- list -
-
success -
A list of network port with protocol.
-
-
Sample:
-
[['22', 'tcp'], ['80', 'tcp']]
-
    -
- protocols - -
- list -
-
success -
A list of network protocol.
-
-
Sample:
-
['icmp', 'ipv6-icmp']
-
    -
- rich_rules - -
- list -
-
success -
A list of rich language rule.
-
-
Sample:
-
['rule protocol value="icmp" reject', 'rule priority="32767" reject']
-
    -
- services - -
- list -
-
success -
A list of network services.
-
-
Sample:
-
['dhcp', 'dns', 'ssh']
-
    -
- source_ports - -
- list -
-
success -
A list of network source port with protocol.
-
-
Sample:
-
[['30000', 'tcp'], ['30001', 'tcp']]
-
    -
- sources - -
- list -
-
success -
A list of source network address.
-
-
Sample:
-
['172.16.30.0/24', '172.16.31.0/24']
-
    -
- target - -
- string -
-
success -
A list of services in the zone.
-
-
Sample:
-
ACCEPT
-
-
- undefined_zones - -
- list -
-
success -
A list of undefined zones in zones option.
-
undefined_zones will be ignored for gathering process.
-
-
Sample:
-
['foo', 'bar']
-
-

- - -Status ------- - - -Authors -~~~~~~~ - -- Hideki Saito (@saito-hideki) diff --git a/docs/ansible.posix.firewalld_module.rst b/docs/ansible.posix.firewalld_module.rst deleted file mode 100644 index 0932ac2..0000000 --- a/docs/ansible.posix.firewalld_module.rst +++ /dev/null @@ -1,521 +0,0 @@ -.. _ansible.posix.firewalld_module: - - -*********************** -ansible.posix.firewalld -*********************** - -**Manage arbitrary ports/services with firewalld** - - - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- This module allows for addition or deletion of services and ports (either TCP or UDP) in either running or permanent firewalld rules. - - - -Requirements ------------- -The below requirements are needed on the host that executes this module. - -- firewalld >= 0.2.11 -- python-firewall >= 0.2.11 - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- icmp_block - -
- string -
-
- -
The ICMP block you would like to add/remove to/from a zone in firewalld.
-
-
- icmp_block_inversion - -
- string -
-
- -
Enable/Disable inversion of ICMP blocks for a zone in firewalld.
-
-
- immediate - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Should this configuration be applied immediately, if set as permanent.
-
-
- interface - -
- string -
-
- -
The interface you would like to add/remove to/from a zone in firewalld.
-
-
- masquerade - -
- string -
-
- -
The masquerade setting you would like to enable/disable to/from zones within firewalld.
-
-
- offline - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
Whether to run this module even when firewalld is offline.
-
-
- permanent - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
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 false, immediate is assumed true.
-
-
- port - -
- string -
-
- -
Name of a port or port range to add/remove to/from firewalld.
-
Must be in the form PORT/PROTOCOL or PORT-PORT/PROTOCOL for port ranges.
-
-
- port_forward - -
- list - / elements=dictionary -
-
- -
Port and protocol to forward using firewalld.
-
-
- port - -
- string - / required -
-
- -
Source port to forward from
-
-
- proto - -
- string - / required -
-
-
    Choices: -
  • udp
  • -
  • tcp
  • -
-
-
protocol to forward
-
-
- toaddr - -
- string -
-
- -
Optional address to forward to
-
-
- toport - -
- string - / required -
-
- -
destination port
-
-
- protocol - -
- string -
-
- -
Name of a protocol to add/remove to/from firewalld.
-
-
- rich_rule - -
- string -
-
- -
Rich rule to add/remove to/from firewalld.
- -
-
- service - -
- string -
-
- -
Name of a service to add/remove to/from firewalld.
-
The service must be listed in output of firewall-cmd --get-services.
-
-
- source - -
- string -
-
- -
The source/network you would like to add/remove to/from firewalld.
-
-
- state - -
- string - / required -
-
-
    Choices: -
  • absent
  • -
  • disabled
  • -
  • enabled
  • -
  • present
  • -
-
-
Enable or disable a setting.
-
For ports: Should this port accept (enabled) or reject (disabled) connections.
-
The states present and absent can only be used in zone level operations (i.e. when no other parameters but zone and state are set).
-
-
- target - -
- string -
-
added in 1.2.0
-
-
    Choices: -
  • default
  • -
  • ACCEPT
  • -
  • DROP
  • -
  • %%REJECT%%
  • -
-
-
firewalld Zone target
-
If state is set to absent, this will reset the target to default
-
-
- timeout - -
- integer -
-
- Default:
0
-
-
The amount of time in seconds the rule should be in effect for when non-permanent.
-
-
- zone - -
- string -
-
- -
The firewalld zone to add/remove to/from.
-
Note that the default zone can be configured per system but public is default from upstream.
-
Available choices can be extended based on per-system configs, listed here are "out of the box" defaults.
-
Possible values include block, dmz, drop, external, home, internal, public, trusted, work.
-
-
- - -Notes ------ - -.. note:: - - Not tested on any Debian based system. - - Requires the python2 bindings of firewalld, which may not be installed by default. - - For distributions where the python2 firewalld bindings are unavailable (e.g Fedora 28 and later) you will have to set the ansible_python_interpreter for these hosts to the python3 interpreter path and install the python3 bindings. - - Zone transactions (creating, deleting) can be performed by using only the zone and state parameters "present" or "absent". Note that zone transactions must explicitly be permanent. This is a limitation in firewalld. This also means that you will have to reload firewalld after adding a zone that you wish to perform immediate actions on. The module will not take care of this for you implicitly because that would undo any previously performed immediate actions which were not permanent. Therefore, if you require immediate access to a newly created zone it is recommended you reload firewalld immediately after the zone creation returns with a changed state and before you perform any other immediate, non-permanent actions on that zone. - - This module needs ``python-firewall`` or ``python3-firewall`` on managed nodes. It is usually provided as a subset with ``firewalld`` from the OS distributor for the OS default Python interpreter. - - - -Examples --------- - -.. code-block:: yaml - - - name: permit traffic in default zone for https service - ansible.posix.firewalld: - service: https - permanent: true - state: enabled - - - name: permit ospf traffic - ansible.posix.firewalld: - protocol: ospf - permanent: true - state: enabled - - - name: do not permit traffic in default zone on port 8081/tcp - ansible.posix.firewalld: - port: 8081/tcp - permanent: true - state: disabled - - - ansible.posix.firewalld: - port: 161-162/udp - permanent: true - state: enabled - - - ansible.posix.firewalld: - zone: dmz - service: http - permanent: true - state: enabled - - - ansible.posix.firewalld: - rich_rule: rule service name="ftp" audit limit value="1/m" accept - permanent: true - state: enabled - - - ansible.posix.firewalld: - source: 192.0.2.0/24 - zone: internal - state: enabled - - - ansible.posix.firewalld: - zone: trusted - interface: eth2 - permanent: true - state: enabled - - - ansible.posix.firewalld: - masquerade: true - state: enabled - permanent: true - zone: dmz - - - ansible.posix.firewalld: - zone: custom - state: present - permanent: true - - - ansible.posix.firewalld: - zone: drop - state: enabled - permanent: true - icmp_block_inversion: true - - - ansible.posix.firewalld: - zone: drop - state: enabled - permanent: true - icmp_block: echo-request - - - ansible.posix.firewalld: - zone: internal - state: present - 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: true - immediate: true - state: enabled - - - - -Status ------- - - -Authors -~~~~~~~ - -- Adam Miller (@maxamillion) diff --git a/docs/ansible.posix.mount_module.rst b/docs/ansible.posix.mount_module.rst deleted file mode 100644 index f38621f..0000000 --- a/docs/ansible.posix.mount_module.rst +++ /dev/null @@ -1,336 +0,0 @@ -.. _ansible.posix.mount_module: - - -******************* -ansible.posix.mount -******************* - -**Control active and configured mount points** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- This module controls active and configured mount points in ``/etc/fstab``. - - - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- backup - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly.
-
-
- boot - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes ←
  • -
-
-
Determines if the filesystem should be mounted on boot.
-
Only applies to Solaris and Linux systems.
-
For Solaris systems, true will set yes as the value of mount at boot in /etc/vfstab.
-
For Linux, FreeBSD, NetBSD and OpenBSD systems, false will add noauto to mount options in /etc/fstab.
-
To avoid mount option conflicts, if noauto specified in opts, mount module will ignore boot.
-
This parameter is ignored when state is set to ephemeral.
-
-
- dump - -
- string -
-
- Default:
"0"
-
-
Dump (see fstab(5)).
-
Note that if set to null and state set to present, it will cease to work and duplicate entries will be made with subsequent runs.
-
Has no effect on Solaris systems or when used with ephemeral.
-
-
- fstab - -
- string -
-
- -
File to use instead of /etc/fstab.
-
You should not use this option unless you really know what you are doing.
-
This might be useful if you need to configure mountpoints in a chroot environment.
-
OpenBSD does not allow specifying alternate fstab files with mount so do not use this on OpenBSD with any state that operates on the live filesystem.
-
This parameter defaults to /etc/fstab or /etc/vfstab on Solaris.
-
This parameter is ignored when state is set to ephemeral.
-
-
- fstype - -
- string -
-
- -
Filesystem type.
-
Required when state is present, mounted or ephemeral.
-
-
- opts - -
- string -
-
- -
Mount options (see fstab(5), or vfstab(4) on Solaris).
-
-
- passno - -
- string -
-
- Default:
"0"
-
-
Passno (see fstab(5)).
-
Note that if set to null and state set to present, it will cease to work and duplicate entries will be made with subsequent runs.
-
Deprecated on Solaris systems. Has no effect when used with ephemeral.
-
-
- path - -
- path - / required -
-
- -
Path to the mount point (e.g. /mnt/files).
-
Before Ansible 2.3 this option was only usable as dest, destfile and name.
-

aliases: name
-
-
- src - -
- path -
-
- -
Device (or NFS volume, or something else) to be mounted on path.
-
Required when state set to present, mounted or ephemeral.
-
-
- state - -
- string - / required -
-
-
    Choices: -
  • absent
  • -
  • absent_from_fstab
  • -
  • mounted
  • -
  • present
  • -
  • unmounted
  • -
  • remounted
  • -
  • ephemeral
  • -
-
-
If mounted, the device will be actively mounted and appropriately configured in fstab. If the mount point is not present, the mount point will be created.
-
If unmounted, the device will be unmounted without changing fstab.
-
present only specifies that the device is to be configured in fstab and does not trigger or require a mount.
-
ephemeral only specifies that the device is to be mounted, without changing fstab. If it is already mounted, a remount will be triggered. This will always return changed=True. If the mount point path has already a device mounted on, and its source is different than src, the module will fail to avoid unexpected unmount or mount point override. If the mount point is not present, the mount point will be created. The fstab is completely ignored. This option is added in version 1.5.0.
-
absent specifies that the device mount's entry will be removed from fstab and will also unmount the device and remove the mount point.
-
remounted specifies that the device will be remounted for when you want to force a refresh on the mount itself (added in 2.9). This will always return changed=true. If opts is set, the options will be applied to the remount, but will not change fstab. Additionally, if opts is set, and the remount command fails, the module will error to prevent unexpected mount changes. Try using mounted instead to work around this issue. remounted expects the mount point to be present in the fstab. To remount a mount point not registered in fstab, use ephemeral instead, especially with BSD nodes.
-
absent_from_fstab specifies that the device mount's entry will be removed from fstab. This option does not unmount it or delete the mountpoint.
-
-
- - -Notes ------ - -.. note:: - - As of Ansible 2.3, the *name* option has been changed to *path* as default, but *name* still works as well. - - Using ``remounted`` with *opts* set may create unexpected results based on the existing options already defined on mount, so care should be taken to ensure that conflicting options are not present before hand. - - - -Examples --------- - -.. code-block:: yaml - - # Before 2.3, option 'name' was used instead of 'path' - - name: Mount DVD read-only - ansible.posix.mount: - path: /mnt/dvd - src: /dev/sr0 - fstype: iso9660 - opts: ro,noauto - state: present - - - name: Mount up device by label - ansible.posix.mount: - path: /srv/disk - src: LABEL=SOME_LABEL - fstype: ext4 - state: present - - - name: Mount up device by UUID - ansible.posix.mount: - path: /home - src: UUID=b3e48f45-f933-4c8e-a700-22a159ec9077 - fstype: xfs - opts: noatime - state: present - - - name: Unmount a mounted volume - ansible.posix.mount: - path: /tmp/mnt-pnt - state: unmounted - - - name: Remount a mounted volume - ansible.posix.mount: - path: /tmp/mnt-pnt - state: remounted - - # The following will not save changes to fstab, and only be temporary until - # a reboot, or until calling "state: unmounted" followed by "state: mounted" - # on the same "path" - - name: Remount a mounted volume and append exec to the existing options - ansible.posix.mount: - path: /tmp - state: remounted - opts: exec - - - name: Mount and bind a volume - ansible.posix.mount: - path: /system/new_volume/boot - src: /boot - opts: bind - state: mounted - fstype: none - - - name: Mount an NFS volume - ansible.posix.mount: - src: 192.168.1.100:/nfs/ssd/shared_data - path: /mnt/shared_data - opts: rw,sync,hard - state: mounted - fstype: nfs - - - name: Mount NFS volumes with noauto according to boot option - ansible.posix.mount: - src: 192.168.1.100:/nfs/ssd/shared_data - path: /mnt/shared_data - opts: rw,sync,hard - boot: false - state: mounted - fstype: nfs - - - name: Mount ephemeral SMB volume - ansible.posix.mount: - src: //192.168.1.200/share - path: /mnt/smb_share - opts: "rw,vers=3,file_mode=0600,dir_mode=0700,dom={{ ad_domain }},username={{ ad_username }},password={{ ad_password }}" - fstype: cifs - state: ephemeral - - - - -Status ------- - - -Authors -~~~~~~~ - -- Ansible Core Team -- Seth Vidal (@skvidal) diff --git a/docs/ansible.posix.patch_module.rst b/docs/ansible.posix.patch_module.rst deleted file mode 100644 index 07f672a..0000000 --- a/docs/ansible.posix.patch_module.rst +++ /dev/null @@ -1,245 +0,0 @@ -.. _ansible.posix.patch_module: - - -******************* -ansible.posix.patch -******************* - -**Apply patch files using the GNU patch tool** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- Apply patch files using the GNU patch tool. - - - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- backup - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Passes --backup --version-control=numbered to patch, producing numbered backup copies.
-
-
- basedir - -
- path -
-
- -
Path of a base directory in which the patch file will be applied.
-
May be omitted when dest option is specified, otherwise required.
-
-
- binary - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Setting to true will disable patch's heuristic for transforming CRLF line endings into LF.
-
Line endings of src and dest must match.
-
If set to false, patch will replace CRLF in src files on POSIX.
-
-
- dest - -
- path -
-
- -
Path of the file on the remote machine to be patched.
-
The names of the files to be patched are usually taken from the patch file, but if there's just one file to be patched it can specified with this option.
-

aliases: originalfile
-
-
- ignore_whitespace - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Setting to true will ignore white space changes between patch and input.
-
-
- remote_src - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
If false, it will search for src at originating/controller machine, if true it will go to the remote/target machine for the src.
-
-
- src - -
- path - / required -
-
- -
Path of the patch file as accepted by the GNU patch tool. If remote_src is false, the patch source file is looked up from the module's files directory.
-

aliases: patchfile
-
-
- state - -
- string -
-
-
    Choices: -
  • absent
  • -
  • present ←
  • -
-
-
Whether the patch should be applied or reverted.
-
-
- strip - -
- integer -
-
- Default:
0
-
-
Number that indicates the smallest prefix containing leading slashes that will be stripped from each file name found in the patch file.
-
For more information see the strip parameter of the GNU patch tool.
-
-
- - -Notes ------ - -.. note:: - - This module requires GNU *patch* utility to be installed on the remote host. - - - -Examples --------- - -.. code-block:: yaml - - - name: Apply patch to one file - ansible.posix.patch: - src: /tmp/index.html.patch - dest: /var/www/index.html - - - name: Apply patch to multiple files under basedir - ansible.posix.patch: - src: /tmp/customize.patch - basedir: /var/www - strip: 1 - - - name: Revert patch to one file - ansible.posix.patch: - src: /tmp/index.html.patch - dest: /var/www/index.html - state: absent - - - - -Status ------- - - -Authors -~~~~~~~ - -- Jakub Jirutka (@jirutka) -- Luis Alberto Perez Lazaro (@luisperlaz) diff --git a/docs/ansible.posix.rhel_facts_module.rst b/docs/ansible.posix.rhel_facts_module.rst deleted file mode 100644 index d4c8fb6..0000000 --- a/docs/ansible.posix.rhel_facts_module.rst +++ /dev/null @@ -1,103 +0,0 @@ -.. _ansible.posix.rhel_facts_module: - - -************************ -ansible.posix.rhel_facts -************************ - -**Facts module to set or override RHEL specific facts.** - - -Version added: 1.5.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- Compatibility layer for using the "package" module for rpm-ostree based systems via setting the "pkg_mgr" fact correctly. - - - -Requirements ------------- -The below requirements are needed on the host that executes this module. - -- rpm-ostree - - - - -See Also --------- - -.. seealso:: - - :ref:`ansible.builtin.package_module` - The official documentation on the **ansible.builtin.package** module. - - -Examples --------- - -.. code-block:: yaml - - - name: Playbook to use the package module on all RHEL footprints - vars: - ansible_facts_modules: - - setup # REQUIRED to be run before all custom fact modules - - ansible.posix.rhel_facts - tasks: - - name: Ensure packages are installed - ansible.builtin.package: - name: - - htop - - ansible - state: present - - -Returned Facts --------------- -Facts returned by this module are added/updated in the ``hostvars`` host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them. - -.. raw:: html - - - - - - - - - - - - -
FactReturnedDescription
-
- pkg_mgr - -
- string -
-
when needed -
System-level package manager override -
-
-
Sample:
-
{'pkg_mgr': 'ansible.posix.rhel_facts'}
-
-

- - - -Status ------- - - -Authors -~~~~~~~ - -- Adam Miller (@maxamillion) diff --git a/docs/ansible.posix.rhel_rpm_ostree_module.rst b/docs/ansible.posix.rhel_rpm_ostree_module.rst deleted file mode 100644 index b170b15..0000000 --- a/docs/ansible.posix.rhel_rpm_ostree_module.rst +++ /dev/null @@ -1,156 +0,0 @@ -.. _ansible.posix.rhel_rpm_ostree_module: - - -***************************** -ansible.posix.rhel_rpm_ostree -***************************** - -**Ensure packages exist in a RHEL for Edge rpm-ostree based system** - - -Version added: 1.5.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- Compatibility layer for using the "package" module for RHEL for Edge systems utilizing the RHEL System Roles. - - - -Requirements ------------- -The below requirements are needed on the host that executes this module. - -- rpm-ostree - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- name - -
- list - / elements=string -
-
- Default:
[]
-
-
A package name or package specifier with version, like name-1.0.
-
Comparison operators for package version are valid here >, <, >=, <=. Example - name>=1.0
-
If a previous version is specified, the task also needs to turn allow_downgrade on. See the allow_downgrade documentation for caveats with downgrading packages.
-
When using state=latest, this can be '*' which means run yum -y update.
-
You can also pass a url or a local path to a rpm file (using state=present). To operate on several packages this can accept a comma separated string of packages or (as of 2.0) a list of packages.
-

aliases: pkg
-
-
- state - -
- string -
-
-
    Choices: -
  • absent
  • -
  • installed
  • -
  • latest
  • -
  • present
  • -
  • removed
  • -
-
-
Whether to install (present or installed, latest), or remove (absent or removed) a package.
-
present and installed will simply ensure that a desired package is installed.
-
latest will update the specified package if it's not of the latest available version.
-
absent and removed will remove the specified package.
-
Default is None, however in effect the default action is present unless the autoremove option is enabled for this module, then absent is inferred.
-
-
- - -Notes ------ - -.. note:: - - This module does not support installing or removing packages to/from an overlay as this is not supported by RHEL for Edge, packages needed should be defined in the osbuild Blueprint and provided to Image Builder at build time. This module exists only for ``package`` module compatibility. - - - -Examples --------- - -.. code-block:: yaml - - - name: Ensure htop and ansible are installed on rpm-ostree based RHEL - ansible.posix.rhel_rpm_ostree: - name: - - htop - - ansible - state: present - - - -Return Values -------------- -Common return values are documented `here `_, the following are the fields unique to this module: - -.. raw:: html - - - - - - - - - - - - -
KeyReturnedDescription
-
- msg - -
- string -
-
always -
status of rpm transaction
-
-
Sample:
-
No changes made.
-
-

- - -Status ------- - - -Authors -~~~~~~~ - -- Adam Miller (@maxamillion) diff --git a/docs/ansible.posix.rpm_ostree_upgrade_module.rst b/docs/ansible.posix.rpm_ostree_upgrade_module.rst deleted file mode 100644 index d683166..0000000 --- a/docs/ansible.posix.rpm_ostree_upgrade_module.rst +++ /dev/null @@ -1,175 +0,0 @@ -.. _ansible.posix.rpm_ostree_upgrade_module: - - -******************************** -ansible.posix.rpm_ostree_upgrade -******************************** - -**Manage rpm-ostree upgrade transactions** - - -Version added: 1.5.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- Manage an rpm-ostree upgrade transactions. - - - -Requirements ------------- -The below requirements are needed on the host that executes this module. - -- rpm-ostree - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- allow_downgrade - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Allow for the upgrade to be a chronologically older tree.
-
-
- cache_only - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Perform the transaction using only pre-cached data, do not download.
-
-
- os - -
- string -
-
- Default:
""
-
-
The OSNAME upon which to operate.
-
-
- peer - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Force peer-to-peer connection instead of using a system message bus.
-
-
- - - - -Examples --------- - -.. code-block:: yaml - - - name: Upgrade the rpm-ostree image without options, accept all defaults - ansible.posix.rpm_ostree_upgrade: - - - name: Upgrade the rpm-ostree image allowing downgrades - ansible.posix.rpm_ostree_upgrade: - allow_downgrade: true - - - -Return Values -------------- -Common return values are documented `here `_, the following are the fields unique to this module: - -.. raw:: html - - - - - - - - - - - - -
KeyReturnedDescription
-
- msg - -
- string -
-
always -
The command standard output
-
-
Sample:
-
No upgrade available.
-
-

- - -Status ------- - - -Authors -~~~~~~~ - -- Adam Miller (@maxamillion) diff --git a/docs/ansible.posix.seboolean_module.rst b/docs/ansible.posix.seboolean_module.rst deleted file mode 100644 index 330d091..0000000 --- a/docs/ansible.posix.seboolean_module.rst +++ /dev/null @@ -1,151 +0,0 @@ -.. _ansible.posix.seboolean_module: - - -*********************** -ansible.posix.seboolean -*********************** - -**Toggles SELinux booleans** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- Toggles SELinux booleans. - - - -Requirements ------------- -The below requirements are needed on the host that executes this module. - -- libselinux-python -- libsemanage-python -- python3-libsemanage - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- ignore_selinux_state - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Useful for scenarios (chrooted environment) that you can't get the real SELinux state.
-
-
- name - -
- string - / required -
-
- -
Name of the boolean to configure.
-
-
- persistent - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Set to true if the boolean setting should survive a reboot.
-
-
- state - -
- boolean - / required -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
Desired boolean value
-
-
- - -Notes ------ - -.. note:: - - Not tested on any Debian based system. - - - -Examples --------- - -.. code-block:: yaml - - - name: Set httpd_can_network_connect flag on and keep it persistent across reboots - ansible.posix.seboolean: - name: httpd_can_network_connect - state: true - persistent: true - - - - -Status ------- - - -Authors -~~~~~~~ - -- Stephen Fromm (@sfromm) diff --git a/docs/ansible.posix.selinux_module.rst b/docs/ansible.posix.selinux_module.rst deleted file mode 100644 index 20d9ef8..0000000 --- a/docs/ansible.posix.selinux_module.rst +++ /dev/null @@ -1,253 +0,0 @@ -.. _ansible.posix.selinux_module: - - -********************* -ansible.posix.selinux -********************* - -**Change policy and state of SELinux** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- Configures the SELinux mode and policy. -- A reboot may be required after usage. -- Ansible will not issue this reboot but will let you know when it is required. - - - -Requirements ------------- -The below requirements are needed on the host that executes this module. - -- libselinux-python - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- configfile - -
- string -
-
- Default:
"/etc/selinux/config"
-
-
The path to the SELinux configuration file, if non-standard.
-

aliases: conf, file
-
-
- policy - -
- string -
-
- -
The name of the SELinux policy to use (e.g. targeted) will be required if state is not disabled.
-
-
- state - -
- string - / required -
-
-
    Choices: -
  • disabled
  • -
  • enforcing
  • -
  • permissive
  • -
-
-
The SELinux mode.
-
-
- update_kernel_param - -
- boolean -
-
added in 1.4.0
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
If set to true, will update also the kernel boot parameters when disabling/enabling SELinux.
-
The grubby tool must be present on the target system for this to work.
-
-
- - - - -Examples --------- - -.. code-block:: yaml - - - name: Enable SELinux - ansible.posix.selinux: - policy: targeted - state: enforcing - - - name: Put SELinux in permissive mode, logging actions that would be blocked. - ansible.posix.selinux: - policy: targeted - state: permissive - - - name: Disable SELinux - ansible.posix.selinux: - state: disabled - - - -Return Values -------------- -Common return values are documented `here `_, the following are the fields unique to this module: - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyReturnedDescription
-
- configfile - -
- string -
-
always -
Path to SELinux configuration file.
-
-
Sample:
-
/etc/selinux/config
-
-
- msg - -
- string -
-
always -
Messages that describe changes that were made.
-
-
Sample:
-
Config SELinux state changed from 'disabled' to 'permissive'
-
-
- policy - -
- string -
-
always -
Name of the SELinux policy.
-
-
Sample:
-
targeted
-
-
- reboot_required - -
- boolean -
-
always -
Whether or not an reboot is required for the changes to take effect.
-
-
Sample:
-
True
-
-
- state - -
- string -
-
always -
SELinux mode.
-
-
Sample:
-
enforcing
-
-

- - -Status ------- - - -Authors -~~~~~~~ - -- Derek Carter (@goozbach) diff --git a/docs/ansible.posix.synchronize_module.rst b/docs/ansible.posix.synchronize_module.rst deleted file mode 100644 index 7cb3059..0000000 --- a/docs/ansible.posix.synchronize_module.rst +++ /dev/null @@ -1,744 +0,0 @@ -.. _ansible.posix.synchronize_module: - - -************************* -ansible.posix.synchronize -************************* - -**A wrapper around rsync to make common tasks in your playbooks quick and easy** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- ``synchronize`` is a wrapper around rsync to make common tasks in your playbooks quick and easy. -- It is run and originates on the local host where Ansible is being run. -- Of course, you could just use the ``command`` action to call rsync yourself, but you also have to add a fair number of boilerplate options and host facts. -- This module is not intended to provide access to the full power of rsync, but does make the most common invocations easier to implement. You `still` may need to call rsync directly via ``command`` or ``shell`` depending on your use case. - - - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- archive - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes ←
  • -
-
-
Mirrors the rsync archive flag, enables recursive, links, perms, times, owner, group flags and -D.
-
-
- checksum - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Skip based on checksum, rather than mod-time & size; Note that that "archive" option is still enabled by default - the "checksum" option will not disable it.
-
-
- compress - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes ←
  • -
-
-
Compress file data during the transfer.
-
In most cases, leave this enabled unless it causes problems.
-
-
- copy_links - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Copy symlinks as the item that they point to (the referent) is copied, rather than the symlink.
-
-
- delay_updates - -
- boolean -
-
added in 1.3.0
-
-
    Choices: -
  • no
  • -
  • yes ←
  • -
-
-
This option puts the temporary file from each updated file into a holding directory until the end of the transfer, at which time all the files are renamed into place in rapid succession.
-
-
- delete - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Delete files in dest that do not exist (after transfer, not before) in the src path.
-
This option requires recursive=true.
-
This option ignores excluded files and behaves like the rsync opt --delete-after.
-
-
- dest - -
- string - / required -
-
- -
Path on the destination host that will be synchronized from the source.
-
The path can be absolute or relative.
-
-
- dest_port - -
- integer -
-
- -
Port number for ssh on the destination host.
-
Prior to Ansible 2.0, the ansible_ssh_port inventory var took precedence over this value.
-
This parameter defaults to the value of ansible_port, the remote_port config setting or the value from ssh client configuration if none of the former have been set.
-
-
- dirs - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Transfer directories without recursing.
-
-
- existing_only - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Skip creating new files on receiver.
-
-
- group - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
Preserve group.
-
This parameter defaults to the value of the archive option.
-
-
- link_dest - -
- list - / elements=string -
-
- Default:
null
-
-
Add a destination to hard link against during the rsync.
-
-
- links - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
Copy symlinks as symlinks.
-
This parameter defaults to the value of the archive option.
-
-
- mode - -
- string -
-
-
    Choices: -
  • pull
  • -
  • push ←
  • -
-
-
Specify the direction of the synchronization.
-
In push mode the localhost or delegate is the source.
-
In pull mode the remote host in context is the source.
-
-
- owner - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
Preserve owner (super user only).
-
This parameter defaults to the value of the archive option.
-
-
- partial - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
-
-
- perms - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
Preserve permissions.
-
This parameter defaults to the value of the archive option.
-
-
- private_key - -
- path -
-
- -
Specify the private key to use for SSH-based rsync connections (e.g. ~/.ssh/id_rsa).
-
-
- recursive - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
Recurse into directories.
-
This parameter defaults to the value of the archive option.
-
-
- rsync_opts - -
- list - / elements=string -
-
- Default:
null
-
-
Specify additional rsync options by passing in an array.
-
Note that an empty string in rsync_opts will end up transfer the current working directory.
-
-
- rsync_path - -
- string -
-
- -
Specify the rsync command to run on the remote host. See --rsync-path on the rsync man page.
-
To specify the rsync command to run on the local host, you need to set this your task var ansible_rsync_path.
-
-
- rsync_timeout - -
- integer -
-
- Default:
0
-
-
Specify a --timeout for the rsync command in seconds.
-
-
- set_remote_user - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes ←
  • -
-
-
Put user@ for the remote paths.
-
If you have a custom ssh config to define the remote user for a host that does not match the inventory user, you should set this parameter to false.
-
-
- src - -
- string - / required -
-
- -
Path on the source host that will be synchronized to the destination.
-
The path can be absolute or relative.
-
-
- ssh_connection_multiplexing - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
SSH connection multiplexing for rsync is disabled by default to prevent misconfigured ControlSockets from resulting in failed SSH connections. This is accomplished by setting the SSH ControlSocket to none.
-
Set this option to true to allow multiplexing and reduce SSH connection overhead.
-
Note that simply setting this option to true is not enough; You must also configure SSH connection multiplexing in your SSH client config by setting values for ControlMaster, ControlPersist and ControlPath.
-
-
- times - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes
  • -
-
-
Preserve modification times.
-
This parameter defaults to the value of the archive option.
-
-
- use_ssh_args - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
In Ansible 2.10 and lower, it uses the ssh_args specified in ansible.cfg.
-
In Ansible 2.11 and onwards, when set to true, it uses all SSH connection configurations like ansible_ssh_args, ansible_ssh_common_args, and ansible_ssh_extra_args.
-
-
- verify_host - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Verify destination host key.
-
-
- - -Notes ------ - -.. note:: - - rsync must be installed on both the local and remote host. - - For the ``synchronize`` module, the "local host" is the host `the synchronize task originates on`, and the "destination host" is the host `synchronize is connecting to`. - - The "local host" can be changed to a different host by using `delegate_to`. This enables copying between two remote hosts or entirely on one remote machine. - - The user and permissions for the synchronize `src` are those of the user running the Ansible task on the local host (or the remote_user for a delegate_to host when delegate_to is used). - - - The user and permissions for the synchronize `dest` are those of the `remote_user` on the destination host or the `become_user` if `become=yes` is active. - - In Ansible 2.0 a bug in the synchronize module made become occur on the "local host". This was fixed in Ansible 2.0.1. - - Currently, synchronize is limited to elevating permissions via passwordless sudo. This is because rsync itself is connecting to the remote machine and rsync doesn't give us a way to pass sudo credentials in. - - Currently there are only a few connection types which support synchronize (ssh, paramiko, local, and docker) because a sync strategy has been determined for those connection types. Note that the connection for these must not need a password as rsync itself is making the connection and rsync does not provide us a way to pass a password to the connection. - - Expect that dest=~/x will be ~/x even if using sudo. - - Inspect the verbose output to validate the destination user/host/path are what was expected. - - To exclude files and directories from being synchronized, you may add ``.rsync-filter`` files to the source directory. - - rsync daemon must be up and running with correct permission when using rsync protocol in source or destination path. - - The ``synchronize`` module enables `--delay-updates` by default to avoid leaving a destination in a broken in-between state if the underlying rsync process encounters an error. Those synchronizing large numbers of files that are willing to trade safety for performance should disable this option. - - link_destination is subject to the same limitations as the underlying rsync daemon. Hard links are only preserved if the relative subtrees of the source and destination are the same. Attempts to hardlink into a directory that is a subdirectory of the source will be prevented. - - -See Also --------- - -.. seealso:: - - :ref:`ansible.builtin.copy_module` - The official documentation on the **ansible.builtin.copy** module. - :ref:`community.windows.win_robocopy_module` - The official documentation on the **community.windows.win_robocopy** module. - - -Examples --------- - -.. code-block:: yaml - - - name: Synchronization of src on the control machine to dest on the remote hosts - ansible.posix.synchronize: - src: some/relative/path - dest: /some/absolute/path - - - name: Synchronization using rsync protocol (push) - ansible.posix.synchronize: - src: some/relative/path/ - dest: rsync://somehost.com/path/ - - - name: Synchronization using rsync protocol (pull) - ansible.posix.synchronize: - mode: pull - src: rsync://somehost.com/path/ - dest: /some/absolute/path/ - - - name: Synchronization using rsync protocol on delegate host (push) - ansible.posix.synchronize: - src: /some/absolute/path/ - dest: rsync://somehost.com/path/ - delegate_to: delegate.host - - - name: Synchronization using rsync protocol on delegate host (pull) - ansible.posix.synchronize: - mode: pull - src: rsync://somehost.com/path/ - dest: /some/absolute/path/ - delegate_to: delegate.host - - - name: Synchronization without any --archive options enabled - ansible.posix.synchronize: - src: some/relative/path - dest: /some/absolute/path - archive: false - - - name: Synchronization with --archive options enabled except for --recursive - ansible.posix.synchronize: - src: some/relative/path - dest: /some/absolute/path - recursive: false - - - name: Synchronization with --archive options enabled except for --times, with --checksum option enabled - ansible.posix.synchronize: - src: some/relative/path - dest: /some/absolute/path - checksum: true - times: false - - - name: Synchronization without --archive options enabled except use --links - ansible.posix.synchronize: - src: some/relative/path - dest: /some/absolute/path - archive: false - links: true - - - name: Synchronization of two paths both on the control machine - ansible.posix.synchronize: - src: some/relative/path - dest: /some/absolute/path - delegate_to: localhost - - - name: Synchronization of src on the inventory host to the dest on the localhost in pull mode - ansible.posix.synchronize: - mode: pull - src: some/relative/path - dest: /some/absolute/path - - - name: Synchronization of src on delegate host to dest on the current inventory host. - ansible.posix.synchronize: - src: /first/absolute/path - dest: /second/absolute/path - delegate_to: delegate.host - - - name: Synchronize two directories on one remote host. - ansible.posix.synchronize: - src: /first/absolute/path - dest: /second/absolute/path - delegate_to: "{{ inventory_hostname }}" - - - name: Synchronize and delete files in dest on the remote host that are not found in src of localhost. - ansible.posix.synchronize: - src: some/relative/path - dest: /some/absolute/path - delete: true - recursive: true - - # This specific command is granted su privileges on the destination - - name: Synchronize using an alternate rsync command - ansible.posix.synchronize: - src: some/relative/path - dest: /some/absolute/path - rsync_path: su -c rsync - - # Example .rsync-filter file in the source directory - # - var # exclude any path whose last part is 'var' - # - /var # exclude any path starting with 'var' starting at the source directory - # + /var/conf # include /var/conf even though it was previously excluded - - - name: Synchronize passing in extra rsync options - ansible.posix.synchronize: - src: /tmp/helloworld - dest: /var/www/helloworld - rsync_opts: - - "--no-motd" - - "--exclude=.git" - - # Hardlink files if they didn't change - - name: Use hardlinks when synchronizing filesystems - ansible.posix.synchronize: - src: /tmp/path_a/foo.txt - dest: /tmp/path_b/foo.txt - link_dest: /tmp/path_a/ - - # Specify the rsync binary to use on remote host and on local host - - hosts: groupofhosts - vars: - ansible_rsync_path: /usr/gnu/bin/rsync - - tasks: - - name: copy /tmp/localpath/ to remote location /tmp/remotepath - ansible.posix.synchronize: - src: /tmp/localpath/ - dest: /tmp/remotepath - rsync_path: /usr/gnu/bin/rsync - - - - -Status ------- - - -Authors -~~~~~~~ - -- Timothy Appnel (@tima) diff --git a/docs/ansible.posix.sysctl_module.rst b/docs/ansible.posix.sysctl_module.rst deleted file mode 100644 index 1a3b111..0000000 --- a/docs/ansible.posix.sysctl_module.rst +++ /dev/null @@ -1,215 +0,0 @@ -.. _ansible.posix.sysctl_module: - - -******************** -ansible.posix.sysctl -******************** - -**Manage entries in sysctl.conf.** - - -Version added: 1.0.0 - -.. contents:: - :local: - :depth: 1 - - -Synopsis --------- -- This module manipulates sysctl entries and optionally performs a ``/sbin/sysctl -p`` after changing them. - - - - -Parameters ----------- - -.. raw:: html - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterChoices/DefaultsComments
-
- ignoreerrors - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Use this option to ignore errors about unknown keys.
-
-
- name - -
- string - / required -
-
- -
The dot-separated path (also known as key) specifying the sysctl variable.
-

aliases: key
-
-
- reload - -
- boolean -
-
-
    Choices: -
  • no
  • -
  • yes ←
  • -
-
-
If true, performs a /sbin/sysctl -p if the sysctl_file is updated. If false, does not reload sysctl even if the sysctl_file is updated.
-
-
- state - -
- string -
-
-
    Choices: -
  • present ←
  • -
  • absent
  • -
-
-
Whether the entry should be present or absent in the sysctl file.
-
-
- sysctl_file - -
- path -
-
- Default:
"/etc/sysctl.conf"
-
-
Specifies the absolute path to sysctl.conf, if not /etc/sysctl.conf.
-
-
- sysctl_set - -
- boolean -
-
-
    Choices: -
  • no ←
  • -
  • yes
  • -
-
-
Verify token value with the sysctl command and set with -w if necessary.
-
-
- value - -
- string -
-
- -
Desired value of the sysctl key.
-

aliases: val
-
-
- - - - -Examples --------- - -.. code-block:: yaml - - # Set vm.swappiness to 5 in /etc/sysctl.conf - - ansible.posix.sysctl: - name: vm.swappiness - value: '5' - state: present - - # Remove kernel.panic entry from /etc/sysctl.conf - - ansible.posix.sysctl: - name: kernel.panic - state: absent - sysctl_file: /etc/sysctl.conf - - # Set kernel.panic to 3 in /tmp/test_sysctl.conf - - ansible.posix.sysctl: - name: kernel.panic - value: '3' - sysctl_file: /tmp/test_sysctl.conf - reload: false - - # Set ip forwarding on in /proc and verify token value with the sysctl command - - ansible.posix.sysctl: - name: net.ipv4.ip_forward - value: '1' - sysctl_set: true - - # Set ip forwarding on in /proc and in the sysctl file and reload if necessary - - ansible.posix.sysctl: - name: net.ipv4.ip_forward - value: '1' - sysctl_set: true - state: present - reload: true - - - - -Status ------- - - -Authors -~~~~~~~ - -- David CHANIAL (@davixx)