Ansible Practices
Check uptime/disk/mem, Install services, Create new User, Send files.
Feb 23, 2024
Introduction
Thank you for clicking through to my arcticle. I've been a DevOps engineer for 2 years in dev-team of 7 engineers.
My name is MINSEOK, LEE, but I use Unchaptered as an alias on the interenet. So, you can call me anythings "MINSEOK, LEE" or "Unchaptered" to ask something.
Topic
Check uptime
Check disk storage
Check mem usage/free(rest)
Create new users
Send files
Install services
Prerequisites
Prac 1 : Check Uptime
ansible all -m shell -a "uptime" -k
Prac 2 : Check disk storage
ansible all -m shell -a "df -h" -k
Prac 3 : Check mem usage/free(rest)
ansible all -m shell -a "free -h" -k
Prac 4 : Create new user.
ansible all -m user -a "name=bloter password=1234" -k
Prac 5 : Send new file
touch bloter.file
ansible server -m copy -a "src=./bloter.file dest=/tmp/" -k
Prac 6 : Install new service
ansible server -m copy -a "src=/etc/resolv.conf dest=/etc/" -k
ansible server -m yum -a "name=httpd state=present" -k
Share article