parted
(Create a new primary partition)
parted
(Remove partition number 1)
parted
(Create a new primary partition with a size of 1GiB)
parted
(# Create a new primary partition for LVM
)
lvg
(# Create a volume group on top of /dev/sda1 with physical extent size = 32MB.)
lvg
(# Remove a volume group with name vg.services.)
lvol
(Create a logical volume of 512m.)
lvol
(# Create a logical volume of 512m with disks /dev/sda and /dev/sdb)
lvol
(# Create a logical volume of 512g.)
filesystem
(# Create a ext2 filesystem on /dev/sdb1.)
mount
(Mount up device by label)
mount
(Mount up device by UUID)
copy
(Copy using inline content)
copy
(Copy a "sudoers" file on the remote machine for editing)
file
(Change file ownership, group and permissions)
file
(Give insecure permissions to an existing file)
file
(Create a symbolic link)
file
(Touch again the same file, but dont change times this makes the task idempotent)
file
(Remove file (delete file) or directory )
lineinfile
(Validate the sudoers file before saving)
lineinfile
(Add a line to a file if the file does not exist, without passing regexp)
lineinfile
(Replace a localhost entry with our own)
lineinfile
(Ensure SELinux is set to enforcing mode)
firewalld
(Redirect port 443 to 8443 with Rich Rule)
firewalld
(# Enable source zone 192.0.2.0/24 (internal) zone )
firewalld
(# Enable HTTP DMZ zone)
yum
(Install a list of packages, nginx,postgresql postgresql-server )
yum
(Download the nginx package but do not install it)
yum
(Install Development Tools)
yum
(Install a list of package with variable (packages) and loop)
yum_repository
(Add repository)
dnf
(Uninstall httpd but keep its dependencies)
systemd
(just force systemd to reread configs)
systemd
(Star a list of packages and enbale it)
Implementing Handlers
Tags
Ignore Erros
Force execution of handlers
Ansible blocks and error handling
Configure VI VIM for YML
What is ansible?
Static host inventory
Install package - ADHOC
Start service - ADHOC
Firewall rule - ADHOC
Create user - ADHOC
copy file - ADHOC
Create a file and a directory - ADHOC
Create a directory - ADHOC
Git Clone - ADHOC
Print various ansible facts
replace
(Alter authentication in ssh file)
privilege_escalation
Register variable debug
template
sefcontext
( configure selinux context )
authorized_key
set-ssh key
additional paths to search for roles in, colon separated
uncomment this to disable SSH key host checking
private key file for authentication
privilege_escalation
defaults
descompress file from controller node
upgrade all packages
cron schedule
at
(coppy http error log)
Check if HTTPD is installed
unarchive
Get SSL conf
Create a index file
stat
Verify if ssl.conf existis
include
Ansible role subdirectories
Using Ansible roles in a playbook
Ansible Galaxy
Ansible Galaxy - Commands
The default directory for roles
user:
Create users on JBosseapServers
user
Change user password
Install roles galaxy
Configuring parallelism
Running tasks in parallel
Ansible facts
Custom facts
include_vars
fileservers
uri get url