3
command: <name> <args> creates/removes="fileglob" - just run the specified executable unless the specified fileglob already exists / does not exist
4
shell: <sh-code> - execute shell command
6
local_action: command <cmd> <args> - perform command on a control (ansible) system
7
wait_for: host="" port="" state=started/stoped - wait until service is ready
9
- Distribute files & configurations
10
copy: - local-2-remote or remote-2-remote
11
synchronize: - rsync (if delegated will syncrhonise from the delegated host, otherwise from control)
12
template: src="tmpl.j2" dest="/path/to/file" - copy from template
15
yum name="<package>" state=present/absent/latest - install (and update if the state=latest)
18
service: name=firewalld state=started enabled=yes - SystemD services
19
firewalld: service="glusterfs" state="enabled" permanent="true" immediate="true" - FirewallD rules
21
- Manage configurations
22
lineinfile: dest="/etc/hosts" line="{{ip}} {{host}}" regexp="{{host}}" state="present" - Ensure the line is in the file, regexp is used to remove lines from file 'when' state is 'absent'
24
replace: - Regexp-replace
28
- Mounts, Files, and Directories
29
mount: name="/mnt/path" src="/dev/sda1" fstype="xfs" opts="defaults" state="mounted" - adds to fstab
30
filesystem: fstype="xfs" resizefs="yes" dev="/dev/sda1" - does not reformat if file system already exists
31
file: path='/path/to/file' state='directory' owner='root' group='root' mode='0755' - ensures directory is existing