Ansible Practices

Check uptime/disk/mem, Install services, Create new User, Send files.
Feb 23, 2024
Ansible Practices

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

  1. Check uptime

  2. Check disk storage

  3. Check mem usage/free(rest)

  4. Create new users

  5. Send files

  6. Install services

Prerequisites

  1. What is the Ansible?

  2. How to configure practice environment of Ansible?

  3. What is the Ansible Core?

  4. Ansible with PUTTY

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

  1. ansible server -m copy -a "src=/etc/resolv.conf dest=/etc/" -k

  2. ansible server -m yum -a "name=httpd state=present" -k

Share article

Unchaptered