1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-08 13:07:19 +00:00

modules: fix examples to use FQCN (#644)

* modules: fix examples to use FQCN

* fix

* fix

* fix
This commit is contained in:
Andrew Klychkov 2020-07-13 22:50:31 +03:00 committed by GitHub
parent 8b92e0454d
commit 41cfdda6a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
533 changed files with 2130 additions and 2130 deletions

View file

@ -49,55 +49,55 @@ options:
EXAMPLES = r'''
- name: Scan new devices
aix_devices:
community.general.aix_devices:
device: all
state: available
- name: Scan new virtual devices (vio0)
aix_devices:
community.general.aix_devices:
device: vio0
state: available
- name: Removing IP alias to en0
aix_devices:
community.general.aix_devices:
device: en0
attributes:
delalias4: 10.0.0.100,255.255.255.0
- name: Removes ent2
aix_devices:
community.general.aix_devices:
device: ent2
state: removed
- name: Put device en2 in Defined
aix_devices:
community.general.aix_devices:
device: en2
state: defined
- name: Removes ent4 (inexistent).
aix_devices:
community.general.aix_devices:
device: ent4
state: removed
- name: Put device en4 in Defined (inexistent)
aix_devices:
community.general.aix_devices:
device: en4
state: defined
- name: Put vscsi1 and children devices in Defined state.
aix_devices:
community.general.aix_devices:
device: vscsi1
recursive: yes
state: defined
- name: Removes vscsi1 and children devices.
aix_devices:
community.general.aix_devices:
device: vscsi1
recursive: yes
state: removed
- name: Changes en1 mtu to 9000 and disables arp.
aix_devices:
community.general.aix_devices:
device: en1
attributes:
mtu: 900
@ -105,7 +105,7 @@ EXAMPLES = r'''
state: available
- name: Configure IP, netmask and set en1 up.
aix_devices:
community.general.aix_devices:
device: en1
attributes:
netaddr: 192.168.0.100
@ -114,7 +114,7 @@ EXAMPLES = r'''
state: available
- name: Adding IP alias to en0
aix_devices:
community.general.aix_devices:
device: en0
attributes:
alias4: 10.0.0.100,255.255.255.0

View file

@ -103,57 +103,57 @@ notes:
EXAMPLES = r'''
- name: Create filesystem in a previously defined logical volume.
aix_filesystem:
community.general.aix_filesystem:
device: testlv
filesystem: /testfs
community.general.filesystem: /testfs
state: present
- name: Creating NFS filesystem from nfshost.
aix_filesystem:
community.general.aix_filesystem:
device: /home/ftp
nfs_server: nfshost
filesystem: /home/ftp
community.general.filesystem: /home/ftp
state: present
- name: Creating a new file system without a previously logical volume.
aix_filesystem:
filesystem: /newfs
community.general.aix_filesystem:
community.general.filesystem: /newfs
size: 1G
state: present
vg: datavg
- name: Unmounting /testfs.
aix_filesystem:
filesystem: /testfs
community.general.aix_filesystem:
community.general.filesystem: /testfs
state: unmounted
- name: Resizing /mksysb to +512M.
aix_filesystem:
filesystem: /mksysb
community.general.aix_filesystem:
community.general.filesystem: /mksysb
size: +512M
state: present
- name: Resizing /mksysb to 11G.
aix_filesystem:
filesystem: /mksysb
community.general.aix_filesystem:
community.general.filesystem: /mksysb
size: 11G
state: present
- name: Resizing /mksysb to -2G.
aix_filesystem:
filesystem: /mksysb
community.general.aix_filesystem:
community.general.filesystem: /mksysb
size: -2G
state: present
- name: Remove NFS filesystem /home/ftp.
aix_filesystem:
filesystem: /home/ftp
community.general.aix_filesystem:
community.general.filesystem: /home/ftp
rm_mount_point: yes
state: absent
- name: Remove /newfs.
aix_filesystem:
filesystem: /newfs
community.general.aix_filesystem:
community.general.filesystem: /newfs
rm_mount_point: yes
state: absent
'''
@ -179,7 +179,7 @@ def _fs_exists(module, filesystem):
Check if file system already exists on /etc/filesystems.
:param module: Ansible module.
:param filesystem: filesystem name.
:param community.general.filesystem: filesystem name.
:return: True or False.
"""
lsfs_cmd = module.get_bin_path('lsfs', True)

View file

@ -71,7 +71,7 @@ requirements:
EXAMPLES = '''
# Add service startmyservice to the inittab, directly after service existingservice.
- name: Add startmyservice to inittab
aix_inittab:
community.general.aix_inittab:
name: startmyservice
runlevel: 4
action: once
@ -82,7 +82,7 @@ EXAMPLES = '''
# Change inittab entry startmyservice to runlevel "2" and processaction "wait".
- name: Change startmyservice to inittab
aix_inittab:
community.general.aix_inittab:
name: startmyservice
runlevel: 2
action: wait
@ -91,7 +91,7 @@ EXAMPLES = '''
become: yes
- name: Remove startmyservice from inittab
aix_inittab:
community.general.aix_inittab:
name: startmyservice
runlevel: 2
action: wait

View file

@ -55,25 +55,25 @@ notes:
EXAMPLES = r'''
- name: Create a volume group datavg
aix_lvg:
community.general.aix_lvg:
vg: datavg
pp_size: 128
vg_type: scalable
state: present
- name: Removing a volume group datavg
aix_lvg:
community.general.aix_lvg:
vg: datavg
state: absent
- name: Extending rootvg
aix_lvg:
community.general.aix_lvg:
vg: rootvg
pvs: hdisk1
state: present
- name: Reducing rootvg
aix_lvg:
community.general.aix_lvg:
vg: rootvg
pvs: hdisk1
state: absent

View file

@ -69,47 +69,47 @@ options:
EXAMPLES = r'''
- name: Create a logical volume of 512M
aix_lvol:
community.general.aix_lvol:
vg: testvg
lv: testlv
size: 512M
- name: Create a logical volume of 512M with disks hdisk1 and hdisk2
aix_lvol:
community.general.aix_lvol:
vg: testvg
lv: test2lv
size: 512M
pvs: [ hdisk1, hdisk2 ]
- name: Create a logical volume of 512M mirrored
aix_lvol:
community.general.aix_lvol:
vg: testvg
lv: test3lv
size: 512M
copies: 2
- name: Create a logical volume of 1G with a minimum placement policy
aix_lvol:
community.general.aix_lvol:
vg: rootvg
lv: test4lv
size: 1G
policy: minimum
- name: Create a logical volume with special options like mirror pool
aix_lvol:
community.general.aix_lvol:
vg: testvg
lv: testlv
size: 512M
opts: -p copy1=poolA -p copy2=poolB
- name: Extend the logical volume to 1200M
aix_lvol:
community.general.aix_lvol:
vg: testvg
lv: test4lv
size: 1200M
- name: Remove the logical volume
aix_lvol:
community.general.aix_lvol:
vg: testvg
lv: testlv
state: absent

View file

@ -46,18 +46,18 @@ requirements: [ update-alternatives ]
EXAMPLES = r'''
- name: Correct java version selected
alternatives:
community.general.alternatives:
name: java
path: /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
- name: Alternatives link created
alternatives:
community.general.alternatives:
name: hadoop-conf
link: /etc/hadoop/conf
path: /etc/hadoop/conf.ansible
- name: Make java 32 bit an alternative with low priority
alternatives:
community.general.alternatives:
name: java
path: /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java
priority: -10

View file

@ -38,12 +38,12 @@ options:
EXAMPLES = r'''
- name: Enable "foo" and "bar" policy
awall:
community.general.awall:
name: [ foo bar ]
state: enabled
- name: Disable "foo" and "bar" policy and activate new rules
awall:
community.general.awall:
name:
- foo
- bar
@ -51,7 +51,7 @@ EXAMPLES = r'''
activate: no
- name: Activate currently enabled firewall rules
awall:
community.general.awall:
activate: yes
'''

View file

@ -58,41 +58,41 @@ options:
EXAMPLES = r'''
- name: Create ZFS boot environment
beadm:
community.general.beadm:
name: upgrade-be
state: present
- name: Create ZFS boot environment from existing inactive boot environment
beadm:
community.general.beadm:
name: upgrade-be
snapshot: be@old
state: present
- name: Create ZFS boot environment with compression enabled and description "upgrade"
beadm:
community.general.beadm:
name: upgrade-be
options: "compression=on"
description: upgrade
state: present
- name: Delete ZFS boot environment
beadm:
community.general.beadm:
name: old-be
state: absent
- name: Mount ZFS boot environment on /tmp/be
beadm:
community.general.beadm:
name: BE
mountpoint: /tmp/be
state: mounted
- name: Unmount ZFS boot environment
beadm:
community.general.beadm:
name: BE
state: unmounted
- name: Activate ZFS boot environment
beadm:
community.general.beadm:
name: upgrade-be
state: activated
'''

View file

@ -43,13 +43,13 @@ author:
EXAMPLES = r'''
- name: Set cap_sys_chroot+ep on /foo
capabilities:
community.general.capabilities:
path: /foo
capability: cap_sys_chroot+ep
state: present
- name: Remove cap_net_bind_service from /bar
capabilities:
community.general.capabilities:
path: /bar
capability: cap_net_bind_service
state: absent

View file

@ -75,17 +75,17 @@ author:
EXAMPLES = r'''
- name: Ensure entry like "EMAIL=doug@ansibmod.con.com" exists
cronvar:
community.general.cronvar:
name: EMAIL
value: doug@ansibmod.con.com
- name: Ensure a variable does not exist. This may remove any variable named "LEGACY"
cronvar:
community.general.cronvar:
name: LEGACY
state: absent
- name: Add a variable to a file under /etc/cron.d
cronvar:
community.general.cronvar:
name: LOGFILE
value: /var/log/yum-autoupdate.log
user: root
@ -318,13 +318,13 @@ class CronVar(object):
def main():
# The following example playbooks:
#
# - cronvar: name="SHELL" value="/bin/bash"
# - community.general.cronvar: name="SHELL" value="/bin/bash"
#
# - name: Set the email
# cronvar: name="EMAILTO" value="doug@ansibmod.con.com"
# community.general.cronvar: name="EMAILTO" value="doug@ansibmod.con.com"
#
# - name: Get rid of the old new host variable
# cronvar: name="NEW_HOST" state=absent
# community.general.cronvar: name="NEW_HOST" state=absent
#
# Would produce:
# SHELL = /bin/bash

View file

@ -58,13 +58,13 @@ author:
EXAMPLES = r'''
- name: Set the options explicitly a device which must already exist
crypttab:
community.general.crypttab:
name: luks-home
state: present
opts: discard,cipher=aes-cbc-essiv:sha256
- name: Add the 'discard' option to any existing options for all devices
crypttab:
community.general.crypttab:
name: '{{ item.device }}'
state: opts_present
opts: discard

View file

@ -76,41 +76,41 @@ value:
EXAMPLES = """
- name: Configure available keyboard layouts in Gnome
dconf:
community.general.dconf:
key: "/org/gnome/desktop/input-sources/sources"
value: "[('xkb', 'us'), ('xkb', 'se')]"
state: present
- name: Read currently available keyboard layouts in Gnome
dconf:
community.general.dconf:
key: "/org/gnome/desktop/input-sources/sources"
state: read
register: keyboard_layouts
- name: Reset the available keyboard layouts in Gnome
dconf:
community.general.dconf:
key: "/org/gnome/desktop/input-sources/sources"
state: absent
- name: Configure available keyboard layouts in Cinnamon
dconf:
community.general.dconf:
key: "/org/gnome/libgnomekbd/keyboard/layouts"
value: "['us', 'se']"
state: present
- name: Read currently available keyboard layouts in Cinnamon
dconf:
community.general.dconf:
key: "/org/gnome/libgnomekbd/keyboard/layouts"
state: read
register: keyboard_layouts
- name: Reset the available keyboard layouts in Cinnamon
dconf:
community.general.dconf:
key: "/org/gnome/libgnomekbd/keyboard/layouts"
state: absent
- name: Disable desktop effects in Cinnamon
dconf:
community.general.dconf:
key: "/org/cinnamon/desktop-effects"
value: "false"
state: present

View file

@ -59,12 +59,12 @@ notes:
EXAMPLES = '''
- name: Create a ext2 filesystem on /dev/sdb1
filesystem:
community.general.filesystem:
fstype: ext2
dev: /dev/sdb1
- name: Create a ext4 filesystem on /dev/sdb1 and check disk blocks
filesystem:
community.general.filesystem:
fstype: ext4
dev: /dev/sdb1
opts: -cc

View file

@ -108,74 +108,74 @@ author:
'''
EXAMPLES = r'''
- firewalld:
- community.general.firewalld:
service: https
permanent: yes
state: enabled
- firewalld:
- community.general.firewalld:
port: 8081/tcp
permanent: yes
state: disabled
- firewalld:
- community.general.firewalld:
port: 161-162/udp
permanent: yes
state: enabled
- firewalld:
- community.general.firewalld:
zone: dmz
service: http
permanent: yes
state: enabled
- firewalld:
- community.general.firewalld:
rich_rule: rule service name="ftp" audit limit value="1/m" accept
permanent: yes
state: enabled
- firewalld:
- community.general.firewalld:
source: 192.0.2.0/24
zone: internal
state: enabled
- firewalld:
- community.general.firewalld:
zone: trusted
interface: eth2
permanent: yes
state: enabled
- firewalld:
- community.general.firewalld:
masquerade: yes
state: enabled
permanent: yes
zone: dmz
- firewalld:
- community.general.firewalld:
zone: custom
state: present
permanent: yes
- firewalld:
- community.general.firewalld:
zone: drop
state: enabled
permanent: yes
icmp_block_inversion: yes
- firewalld:
- community.general.firewalld:
zone: drop
state: enabled
permanent: yes
icmp_block: echo-request
- firewalld:
- community.general.firewalld:
zone: internal
state: present
permanent: yes
target: ACCEPT
- name: Redirect port 443 to 8443 with Rich Rule
firewalld:
community.general.firewalld:
rich_rule: rule family=ipv4 forward-port port=443 protocol=tcp to-port=8443
zone: public
permanent: yes

View file

@ -51,7 +51,7 @@ options:
EXAMPLES = """
- name: Change the widget font to "Serif 12"
gconftool2:
community.general.gconftool2:
key: "/desktop/gnome/interface/font_name"
value_type: "string"
value: "Serif 12"

View file

@ -124,7 +124,7 @@ ifaces:
EXAMPLES = '''
- name: Set eth1 mtu configuration value to 8000
interfaces_file:
community.general.interfaces_file:
dest: /etc/network/interfaces.d/eth1.cfg
iface: eth1
option: mtu

View file

@ -89,7 +89,7 @@ author:
EXAMPLES = r'''
- name: Import SSL certificate from google.com to a given cacerts keystore
java_cert:
community.general.java_cert:
cert_url: google.com
cert_port: 443
keystore_path: /usr/lib/jvm/jre7/lib/security/cacerts
@ -97,7 +97,7 @@ EXAMPLES = r'''
state: present
- name: Remove certificate with given alias from a keystore
java_cert:
community.general.java_cert:
cert_url: google.com
keystore_path: /usr/lib/jvm/jre7/lib/security/cacerts
keystore_pass: changeit
@ -105,7 +105,7 @@ EXAMPLES = r'''
state: absent
- name: Import trusted CA from SSL certificate
java_cert:
community.general.java_cert:
cert_path: /opt/certs/rootca.crt
keystore_path: /tmp/cacerts
keystore_pass: changeit
@ -115,7 +115,7 @@ EXAMPLES = r'''
trust_cacert: True
- name: Import SSL certificate from google.com to a keystore, create it if it doesn't exist
java_cert:
community.general.java_cert:
cert_url: google.com
keystore_path: /tmp/cacerts
keystore_pass: changeit
@ -123,7 +123,7 @@ EXAMPLES = r'''
state: present
- name: Import a pkcs12 keystore with a specified alias, create it if it doesn't exist
java_cert:
community.general.java_cert:
pkcs12_path: "/tmp/importkeystore.p12"
cert_alias: default
keystore_path: /opt/wildfly/standalone/configuration/defaultkeystore.jks
@ -132,7 +132,7 @@ EXAMPLES = r'''
state: present
- name: Import SSL certificate to JCEKS keystore
java_cert:
community.general.java_cert:
pkcs12_path: "/tmp/importkeystore.p12"
pkcs12_alias: default
pkcs12_password: somepass

View file

@ -65,7 +65,7 @@ author: Guillaume Grossetie (@Mogztter)
EXAMPLES = '''
- name: Create a key store for the given certificate (inline)
java_keystore:
community.general.java_keystore:
name: example
certificate: |
-----BEGIN CERTIFICATE-----
@ -81,7 +81,7 @@ EXAMPLES = '''
dest: /etc/security/keystore.jks
- name: Create a key store for the given certificate (lookup)
java_keystore:
community.general.java_keystore:
name: example
certificate: "{{lookup('file', '/path/to/certificate.crt') }}"
private_key: "{{lookup('file', '/path/to/private.key') }}"

View file

@ -33,7 +33,7 @@ options:
EXAMPLES = '''
- name: Blacklist the nouveau driver module
kernel_blacklist:
community.general.kernel_blacklist:
name: nouveau
state: present
'''

View file

@ -38,19 +38,19 @@ author:
EXAMPLES = '''
# Commit changed files (if any)
- name: Commit
lbu:
community.general.lbu:
commit: true
# Exclude path and commit
- name: Exclude directory
lbu:
community.general.lbu:
commit: true
exclude:
- /etc/opt
# Include paths without committing
- name: Include file and directory
lbu:
community.general.lbu:
include:
- /root/.ssh/authorized_keys
- /var/lib/misc

View file

@ -22,7 +22,7 @@ short_description: Gather facts on processes listening on TCP and UDP ports.
EXAMPLES = r'''
- name: Gather facts on listening ports
listen_ports_facts:
community.general.listen_ports_facts:
- name: TCP whitelist violation
debug:

View file

@ -28,7 +28,7 @@ options:
EXAMPLES = '''
- name: Ensure a locale exists
locale_gen:
community.general.locale_gen:
name: de_CH.UTF-8
state: present
'''

View file

@ -71,13 +71,13 @@ notes:
EXAMPLES = r'''
- name: Create a volume group on top of /dev/sda1 with physical extent size = 32MB
lvg:
community.general.lvg:
vg: vg.services
pvs: /dev/sda1
pesize: 32
- name: Create a volume group on top of /dev/sdb with physical extent size = 128KiB
lvg:
community.general.lvg:
vg: vg.services
pvs: /dev/sdb
pesize: 128K
@ -87,17 +87,17 @@ EXAMPLES = r'''
# top of /dev/sda5, we first extend it with /dev/sdb1 and /dev/sdc5,
# and then reduce by /dev/sda5.
- name: Create or resize a volume group on top of /dev/sdb1 and /dev/sdc5.
lvg:
community.general.lvg:
vg: vg.services
pvs: /dev/sdb1,/dev/sdc5
- name: Remove a volume group with name vg.services
lvg:
community.general.lvg:
vg: vg.services
state: absent
- name: Create a volume group on top of /dev/sda3 and resize the volume group /dev/sda3 to the maximum possible
lvg:
community.general.lvg:
vg: resizableVG
pvs: /dev/sda3
pvresize: yes

View file

@ -75,119 +75,119 @@ notes:
EXAMPLES = '''
- name: Create a logical volume of 512m
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 512
- name: Create a logical volume of 512m with disks /dev/sda and /dev/sdb
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 512
pvs: /dev/sda,/dev/sdb
- name: Create cache pool logical volume
lvol:
community.general.lvol:
vg: firefly
lv: lvcache
size: 512m
opts: --type cache-pool
- name: Create a logical volume of 512g.
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 512g
- name: Create a logical volume the size of all remaining space in the volume group
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 100%FREE
- name: Create a logical volume with special options
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 512g
opts: -r 16
- name: Extend the logical volume to 1024m.
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 1024
- name: Extend the logical volume to consume all remaining space in the volume group
lvol:
community.general.lvol:
vg: firefly
lv: test
size: +100%FREE
- name: Extend the logical volume to take all remaining space of the PVs and resize the underlying filesystem
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 100%PVS
resizefs: true
- name: Resize the logical volume to % of VG
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 80%VG
force: yes
- name: Reduce the logical volume to 512m
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 512
force: yes
- name: Set the logical volume to 512m and do not try to shrink if size is lower than current one
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 512
shrink: no
- name: Remove the logical volume.
lvol:
community.general.lvol:
vg: firefly
lv: test
state: absent
force: yes
- name: Create a snapshot volume of the test logical volume.
lvol:
community.general.lvol:
vg: firefly
lv: test
snapshot: snap1
size: 100m
- name: Deactivate a logical volume
lvol:
community.general.lvol:
vg: firefly
lv: test
active: false
- name: Create a deactivated logical volume
lvol:
community.general.lvol:
vg: firefly
lv: test
size: 512g
active: false
- name: Create a thin pool of 512g
lvol:
community.general.lvol:
vg: firefly
thinpool: testpool
size: 512g
- name: Create a thin volume of 128g
lvol:
community.general.lvol:
vg: firefly
lv: test
thinpool: testpool

View file

@ -44,17 +44,17 @@ options:
EXAMPLES = r'''
- name: Build the default target
make:
community.general.make:
chdir: /home/ubuntu/cool-project
- name: Run 'install' target as root
make:
community.general.make:
chdir: /home/ubuntu/cool-project
target: install
become: yes
- name: Build 'all' target with extra arguments
make:
community.general.make:
chdir: /home/ubuntu/cool-project
target: all
params:
@ -62,7 +62,7 @@ EXAMPLES = r'''
BACKEND: lapack
- name: Build 'all' target with a custom Makefile
make:
community.general.make:
chdir: /home/ubuntu/cool-project
target: all
file: /some-project/Makefile

View file

@ -75,7 +75,7 @@ options:
EXAMPLES = '''
- name: Running a backup image mksysb
mksysb:
community.general.mksysb:
name: myserver
storage_path: /repository/images
exclude_files: yes

View file

@ -35,12 +35,12 @@ options:
EXAMPLES = '''
- name: Add the 802.1q module
modprobe:
community.general.modprobe:
name: 8021q
state: present
- name: Add the dummy module
modprobe:
community.general.modprobe:
name: dummy
state: present
params: 'numdummies=2'

View file

@ -61,34 +61,34 @@ notes:
EXAMPLES = '''
- name: Start dnscache if not running
nosh: name=dnscache state=started
community.general.nosh: name=dnscache state=started
- name: Stop mpd, if running
nosh: name=mpd state=stopped
community.general.nosh: name=mpd state=stopped
- name: Restart unbound or start it if not already running
nosh:
community.general.nosh:
name: unbound
state: restarted
- name: Reload fail2ban or start it if not already running
nosh:
community.general.nosh:
name: fail2ban
state: reloaded
- name: Disable nsd
nosh: name=nsd enabled=no
community.general.nosh: name=nsd enabled=no
- name: For package installers, set nginx running state according to local enable settings, preset and reset
nosh: name=nginx preset=True state=reset
community.general.nosh: name=nginx preset=True state=reset
- name: Reboot the host if nosh is the system manager, would need a "wait_for*" task at least, not recommended as-is
nosh: name=reboot state=started
community.general.nosh: name=reboot state=started
- name: Using conditionals with the module facts
tasks:
- name: Obtain information on tinydns service
nosh: name=tinydns
community.general.nosh: name=tinydns
register: result
- name: Fail if service not loaded

View file

@ -73,31 +73,31 @@ options:
EXAMPLES = r'''
- name: Perform a discovery on sun.com and show available target nodes
open_iscsi:
community.general.open_iscsi:
show_nodes: yes
discover: yes
portal: sun.com
- name: Perform a discovery on 10.1.2.3 and show available target nodes
open_iscsi:
community.general.open_iscsi:
show_nodes: yes
discover: yes
ip: 10.1.2.3
# NOTE: Only works if exactly one target is exported to the initiator
- name: Discover targets on portal and login to the one available
open_iscsi:
community.general.open_iscsi:
portal: '{{ iscsi_target }}'
login: yes
discover: yes
- name: Connect to the named target, after updating the local persistent database (cache)
open_iscsi:
community.general.open_iscsi:
login: yes
target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d
- name: Disconnect from the cached named target
open_iscsi:
community.general.open_iscsi:
login: no
target: iqn.1986-03.com.sun:02:f8c1f9e0-c3ec-ec84-c9c9-8bfb0cd5de3d
'''

View file

@ -43,22 +43,22 @@ requirements:
EXAMPLES = '''
- name: Start service httpd, if not running
openwrt_init:
community.general.openwrt_init:
state: started
name: httpd
- name: Stop service cron, if running
openwrt_init:
community.general.openwrt_init:
name: cron
state: stopped
- name: Reload service httpd, in all cases
openwrt_init:
community.general.openwrt_init:
name: httpd
state: reloaded
- name: Enable service httpd
openwrt_init:
community.general.openwrt_init:
name: httpd
enabled: yes
'''

View file

@ -72,47 +72,47 @@ notes:
EXAMPLES = r'''
# TODO: Describe what happens in each example
- osx_defaults:
- community.general.osx_defaults:
domain: com.apple.Safari
key: IncludeInternalDebugMenu
type: bool
value: true
state: present
- osx_defaults:
- community.general.osx_defaults:
domain: NSGlobalDomain
key: AppleMeasurementUnits
type: string
value: Centimeters
state: present
- osx_defaults:
- community.general.osx_defaults:
domain: /Library/Preferences/com.apple.SoftwareUpdate
key: AutomaticCheckEnabled
type: int
value: 1
become: yes
- osx_defaults:
- community.general.osx_defaults:
domain: com.apple.screensaver
host: currentHost
key: showClock
type: int
value: 1
- osx_defaults:
- community.general.osx_defaults:
key: AppleMeasurementUnits
type: string
value: Centimeters
- osx_defaults:
- community.general.osx_defaults:
key: AppleLanguages
type: array
value:
- en
- nl
- osx_defaults:
- community.general.osx_defaults:
domain: com.geekchimp.macable
key: ExampleKeyToRemove
state: absent

View file

@ -95,14 +95,14 @@ notes:
EXAMPLES = '''
- name: Add or modify nofile soft limit for the user joe
pam_limits:
community.general.pam_limits:
domain: joe
limit_type: soft
limit_item: nofile
value: 64000
- name: Add or modify fsize hard limit for the user smith. Keep or set the maximal value.
pam_limits:
community.general.pam_limits:
domain: smith
limit_type: hard
limit_item: fsize
@ -110,7 +110,7 @@ EXAMPLES = '''
use_max: yes
- name: Add or modify memlock, both soft and hard, limit for the user james with a comment.
pam_limits:
community.general.pam_limits:
domain: james
limit_type: '-'
limit_item: memlock
@ -118,7 +118,7 @@ EXAMPLES = '''
comment: unlimited memory lock for james
- name: Add or modify hard nofile limits for wildcard domain
pam_limits:
community.general.pam_limits:
domain: '*'
limit_type: hard
limit_item: nofile

View file

@ -96,7 +96,7 @@ options:
EXAMPLES = r'''
- name: Update pamd rule's control in /etc/pam.d/system-auth
pamd:
community.general.pamd:
name: system-auth
type: auth
control: required
@ -104,7 +104,7 @@ EXAMPLES = r'''
new_control: sufficient
- name: Update pamd rule's complex control in /etc/pam.d/system-auth
pamd:
community.general.pamd:
name: system-auth
type: session
control: '[success=1 default=ignore]'
@ -112,7 +112,7 @@ EXAMPLES = r'''
new_control: '[success=2 default=ignore]'
- name: Insert a new rule before an existing rule
pamd:
community.general.pamd:
name: system-auth
type: auth
control: required
@ -124,7 +124,7 @@ EXAMPLES = r'''
- name: Insert a new rule pam_wheel.so with argument 'use_uid' after an \
existing rule pam_rootok.so
pamd:
community.general.pamd:
name: su
type: auth
control: sufficient
@ -136,7 +136,7 @@ EXAMPLES = r'''
state: after
- name: Remove module arguments from an existing rule
pamd:
community.general.pamd:
name: system-auth
type: auth
control: required
@ -145,7 +145,7 @@ EXAMPLES = r'''
state: updated
- name: Replace all module arguments in an existing rule
pamd:
community.general.pamd:
name: system-auth
type: auth
control: required
@ -158,7 +158,7 @@ EXAMPLES = r'''
state: updated
- name: Remove specific arguments from a rule
pamd:
community.general.pamd:
name: system-auth
type: session
control: '[success=1 default=ignore]'
@ -167,7 +167,7 @@ EXAMPLES = r'''
state: args_absent
- name: Ensure specific arguments are present in a rule
pamd:
community.general.pamd:
name: system-auth
type: session
control: '[success=1 default=ignore]'
@ -176,7 +176,7 @@ EXAMPLES = r'''
state: args_present
- name: Ensure specific arguments are present in a rule (alternative)
pamd:
community.general.pamd:
name: system-auth
type: session
control: '[success=1 default=ignore]'
@ -187,7 +187,7 @@ EXAMPLES = r'''
state: args_present
- name: Module arguments requiring commas must be listed as a Yaml list
pamd:
community.general.pamd:
name: special-module
type: account
control: required
@ -197,7 +197,7 @@ EXAMPLES = r'''
state: args_present
- name: Update specific argument value in a rule
pamd:
community.general.pamd:
name: system-auth
type: auth
control: required
@ -206,7 +206,7 @@ EXAMPLES = r'''
state: args_present
- name: Add pam common-auth rule for duo
pamd:
community.general.pamd:
name: common-auth
new_type: auth
new_control: '[success=1 default=ignore]'

View file

@ -160,27 +160,27 @@ partition_info:
EXAMPLES = r'''
- name: Create a new ext4 primary partition
parted:
community.general.parted:
device: /dev/sdb
number: 1
state: present
fs_type: ext4
- name: Remove partition number 1
parted:
community.general.parted:
device: /dev/sdb
number: 1
state: absent
- name: Create a new primary partition with a size of 1GiB
parted:
community.general.parted:
device: /dev/sdb
number: 1
state: present
part_end: 1GiB
- name: Create a new primary partition for LVM
parted:
community.general.parted:
device: /dev/sdb
number: 2
flags: [ lvm ]
@ -188,7 +188,7 @@ EXAMPLES = r'''
part_start: 1GiB
- name: Create a new primary partition with a size of 1GiB at disk's end
parted:
community.general.parted:
device: /dev/sdb
number: 3
state: present
@ -197,11 +197,11 @@ EXAMPLES = r'''
# Example on how to read info and reuse it in subsequent task
- name: Read device information (always use unit when probing)
parted: device=/dev/sdb unit=MiB
community.general.parted: device=/dev/sdb unit=MiB
register: sdb_info
- name: Remove all partitions from disk
parted:
community.general.parted:
device: /dev/sdb
number: '{{ item.num }}'
state: absent

View file

@ -22,7 +22,7 @@ options:
EXAMPLES = '''
# Pass the process name
- name: Getting process IDs of the process
pids:
community.general.pids:
name: python
register: pids_of_python

View file

@ -95,36 +95,36 @@ author:
EXAMPLES = r'''
- name: Run puppet agent and fail if anything goes wrong
puppet:
community.general.puppet:
- name: Run puppet and timeout in 5 minutes
puppet:
community.general.puppet:
timeout: 5m
- name: Run puppet using a different environment
puppet:
community.general.puppet:
environment: testing
- name: Run puppet using a specific certname
puppet:
community.general.puppet:
certname: agent01.example.com
- name: Run puppet using a specific piece of Puppet code. Has no effect with a puppetmaster
puppet:
community.general.puppet:
execute: include ::mymodule
- name: Run puppet using a specific tags
puppet:
community.general.puppet:
tags:
- update
- nginx
- name: Run puppet agent in noop mode
puppet:
community.general.puppet:
noop: yes
- name: Run a manifest with debug, log to both syslog and stdout, specify module path
puppet:
community.general.puppet:
modulepath: /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
logdest: all
manifest: /var/lib/example/puppet_step_config.pp

View file

@ -25,10 +25,10 @@ author:
EXAMPLES = '''
- name: Show python lib/site paths
python_requirements_info:
community.general.python_requirements_info:
- name: Check for modern boto3 and botocore versions
python_requirements_info:
community.general.python_requirements_info:
dependencies:
- boto3>1.6
- botocore<2

View file

@ -49,32 +49,32 @@ options:
EXAMPLES = r'''
- name: Start sv dnscache, if not running
runit:
community.general.runit:
name: dnscache
state: started
- name: Stop sv dnscache, if running
runit:
community.general.runit:
name: dnscache
state: stopped
- name: Kill sv dnscache, in all cases
runit:
community.general.runit:
name: dnscache
state: killed
- name: Restart sv dnscache, in all cases
runit:
community.general.runit:
name: dnscache
state: restarted
- name: Reload sv dnscache, in all cases
runit:
community.general.runit:
name: dnscache
state: reloaded
- name: Use alternative sv directory location
runit:
community.general.runit:
name: dnscache
state: reloaded
service_dir: /run/service

View file

@ -86,7 +86,7 @@ author:
EXAMPLES = r'''
- name: Allow apache to modify files in /srv/git_repos
sefcontext:
community.general.sefcontext:
target: '/srv/git_repos(/.*)?'
setype: httpd_git_rw_content_t
state: present

View file

@ -47,7 +47,7 @@ author:
EXAMPLES = r'''
- name: Change the httpd_t domain to permissive
selinux_permissive:
community.general.selinux_permissive:
name: httpd_t
permissive: true
'''

View file

@ -66,20 +66,20 @@ author:
EXAMPLES = '''
- name: Modify the default user on the system to the guest_u user
selogin:
community.general.selogin:
login: __default__
seuser: guest_u
state: present
- name: Assign gijoe user on an MLS machine a range and to the staff_u user
selogin:
community.general.selogin:
login: gijoe
seuser: staff_u
serange: SystemLow-Secret
state: present
- name: Assign all users in the engineering group to the staff_u user
selogin:
community.general.selogin:
login: '%engineering'
seuser: staff_u
state: present

View file

@ -59,28 +59,28 @@ author:
EXAMPLES = r'''
- name: Allow Apache to listen on tcp port 8888
seport:
community.general.seport:
ports: 8888
proto: tcp
setype: http_port_t
state: present
- name: Allow sshd to listen on tcp port 8991
seport:
community.general.seport:
ports: 8991
proto: tcp
setype: ssh_port_t
state: present
- name: Allow memcached to listen on tcp ports 10000-10100 and 10112
seport:
community.general.seport:
ports: 10000-10100,10112
proto: tcp
setype: memcache_port_t
state: present
- name: Allow memcached to listen on tcp ports 10000-10100 and 10112
seport:
community.general.seport:
ports:
- 10000-10100
- 10112
@ -118,7 +118,7 @@ def get_runtime_status(ignore_selinux_state=False):
def semanage_port_get_ports(seport, setype, proto):
""" Get the list of ports that have the specified type definition.
:param seport: Instance of seobject.portRecords
:param community.general.seport: Instance of seobject.portRecords
:type setype: str
:param setype: SELinux type.
@ -139,7 +139,7 @@ def semanage_port_get_ports(seport, setype, proto):
def semanage_port_get_type(seport, port, proto):
""" Get the SELinux type of the specified port.
:param seport: Instance of seobject.portRecords
:param community.general.seport: Instance of seobject.portRecords
:type port: str
:param port: Port or port range (example: "8080", "8080-9090")

View file

@ -93,7 +93,7 @@ options:
EXAMPLES = '''
- name: Create and install a zone, but don't boot it
solaris_zone:
community.general.solaris_zone:
name: zone1
state: present
path: /zones/zone1
@ -102,7 +102,7 @@ EXAMPLES = '''
config: 'set autoboot=true; add net; set physical=bge0; set address=10.1.1.1; end'
- name: Create and install a zone and boot it
solaris_zone:
community.general.solaris_zone:
name: zone1
state: running
path: /zones/zone1
@ -110,27 +110,27 @@ EXAMPLES = '''
config: 'set autoboot=true; add net; set physical=bge0; set address=10.1.1.1; end'
- name: Boot an already installed zone
solaris_zone:
community.general.solaris_zone:
name: zone1
state: running
- name: Stop a zone
solaris_zone:
community.general.solaris_zone:
name: zone1
state: stopped
- name: Destroy a zone
solaris_zone:
community.general.solaris_zone:
name: zone1
state: absent
- name: Detach a zone
solaris_zone:
community.general.solaris_zone:
name: zone1
state: detached
- name: Configure a zone, ready to be attached
solaris_zone:
community.general.solaris_zone:
name: zone1
state: configured
path: /zones/zone1
@ -138,7 +138,7 @@ EXAMPLES = '''
config: 'set autoboot=true; add net; set physical=bge0; set address=10.1.1.1; end'
- name: Attach zone1
solaris_zone:
community.general.solaris_zone:
name: zone1
state: attached
attach_options: -u

View file

@ -56,32 +56,32 @@ options:
EXAMPLES = '''
- name: Start svc dnscache, if not running
svc:
community.general.svc:
name: dnscache
state: started
- name: Stop svc dnscache, if running
svc:
community.general.svc:
name: dnscache
state: stopped
- name: Kill svc dnscache, in all cases
svc:
community.general.svc:
name: dnscache
state: killed
- name: Restart svc dnscache, in all cases
svc:
community.general.svc:
name: dnscache
state: restarted
- name: Reload svc dnscache, in all cases
svc:
community.general.svc:
name: dnscache
state: reloaded
- name: Using alternative svc directory location
svc:
community.general.svc:
name: dnscache
state: reloaded
service_dir: /var/service

View file

@ -35,20 +35,20 @@ author:
EXAMPLES = '''
- name: Apply all available system patches
syspatch:
community.general.syspatch:
apply: true
- name: Revert last patch
syspatch:
community.general.syspatch:
revert: one
- name: Revert all patches
syspatch:
community.general.syspatch:
revert: all
# NOTE: You can reboot automatically if a patch requires it:
- name: Apply all patches and store result
syspatch:
community.general.syspatch:
apply: true
register: syspatch

View file

@ -67,7 +67,7 @@ diff:
EXAMPLES = r'''
- name: Set timezone to Asia/Tokyo
timezone:
community.general.timezone:
name: Asia/Tokyo
'''

View file

@ -157,18 +157,18 @@ options:
EXAMPLES = r'''
- name: Allow everything and enable UFW
ufw:
community.general.ufw:
state: enabled
policy: allow
- name: Set logging
ufw:
community.general.ufw:
logging: 'on'
# Sometimes it is desirable to let the sender know when traffic is
# being denied, rather than simply ignoring it. In these cases, use
# reject instead of deny. In addition, log rejected connections:
- ufw:
- community.general.ufw:
rule: reject
port: auth
log: yes
@ -178,7 +178,7 @@ EXAMPLES = r'''
# address has attempted to initiate 6 or more connections in the last
# 30 seconds. See http://www.debian-administration.org/articles/187
# for details. Typical usage is:
- ufw:
- community.general.ufw:
rule: limit
port: ssh
proto: tcp
@ -186,35 +186,35 @@ EXAMPLES = r'''
# Allow OpenSSH. (Note that as ufw manages its own state, simply removing
# a rule=allow task can leave those ports exposed. Either use delete=yes
# or a separate state=reset task)
- ufw:
- community.general.ufw:
rule: allow
name: OpenSSH
- name: Delete OpenSSH rule
ufw:
community.general.ufw:
rule: allow
name: OpenSSH
delete: yes
- name: Deny all access to port 53
ufw:
community.general.ufw:
rule: deny
port: '53'
- name: Allow port range 60000-61000
ufw:
community.general.ufw:
rule: allow
port: 60000:61000
proto: tcp
- name: Allow all access to tcp port 80
ufw:
community.general.ufw:
rule: allow
port: '80'
proto: tcp
- name: Allow all access from RFC1918 networks to this host
ufw:
community.general.ufw:
rule: allow
src: '{{ item }}'
loop:
@ -223,7 +223,7 @@ EXAMPLES = r'''
- 192.168.0.0/16
- name: Deny access to udp port 514 from host 1.2.3.4 and include a comment
ufw:
community.general.ufw:
rule: deny
proto: udp
src: 1.2.3.4
@ -231,7 +231,7 @@ EXAMPLES = r'''
comment: Block syslog
- name: Allow incoming access to eth0 from 1.2.3.5 port 5469 to 1.2.3.4 port 5469
ufw:
community.general.ufw:
rule: allow
interface: eth0
direction: in
@ -243,7 +243,7 @@ EXAMPLES = r'''
# Note that IPv6 must be enabled in /etc/default/ufw for IPv6 firewalling to work.
- name: Deny all traffic from the IPv6 2001:db8::/32 to tcp port 25 on this host
ufw:
community.general.ufw:
rule: deny
proto: tcp
src: 2001:db8::/32
@ -251,7 +251,7 @@ EXAMPLES = r'''
- name: Deny all IPv6 traffic to tcp port 20 on this host
# this should be the first IPv6 rule
ufw:
community.general.ufw:
rule: deny
proto: tcp
port: '20'
@ -265,7 +265,7 @@ EXAMPLES = r'''
# so the new rule will be inserted before the second
# to last IPv4 rule, and will be come the third to last
# IPv4 rule.)
ufw:
community.general.ufw:
rule: deny
proto: tcp
port: '20'
@ -275,7 +275,7 @@ EXAMPLES = r'''
# Can be used to further restrict a global FORWARD policy set to allow
- name: Deny forwarded/routed traffic from subnet 1.2.3.0/24 to subnet 4.5.6.0/24
ufw:
community.general.ufw:
rule: deny
route: yes
src: 1.2.3.0/24

View file

@ -268,14 +268,14 @@ requirements:
EXAMPLES = r'''
- name: Create 2 TB VDO volume vdo1 on device /dev/md0
vdo:
community.general.vdo:
name: vdo1
state: present
device: /dev/md0
logicalsize: 2T
- name: Remove VDO volume vdo1
vdo:
community.general.vdo:
name: vdo1
state: absent
'''

View file

@ -46,7 +46,7 @@ options:
EXAMPLES = """
- name: Change the DPI to "192"
xfconf:
community.general.xfconf:
channel: "xsettings"
property: "/Xft/DPI"
value_type: "int"

View file

@ -81,7 +81,7 @@ requirements:
EXAMPLES = r'''
- name: Set default project soft and hard limit on /opt of 1g
xfs_quota:
community.general.xfs_quota:
type: project
mountpoint: /opt
bsoft: 1g
@ -89,13 +89,13 @@ EXAMPLES = r'''
state: present
- name: Remove the default limits on /opt
xfs_quota:
community.general.xfs_quota:
type: project
mountpoint: /opt
state: absent
- name: Set default soft user inode limits on /home of 1024 inodes and hard of 2048
xfs_quota:
community.general.xfs_quota:
type: user
mountpoint: /home
isoft: 1024