Ansible playbook

1.Create a playbook and setup a webserver(httpd) and use httpd as a variable decalared in role var file — -name: webserver host:web vars_files: – role-var-file.yml tasks: -name: var include include_vars: role-var-file.yml -name: setup httpd server yum: name: “{{packname}}” state: latest – name: Start service httpd, if not started ansible.builtin.service: name: “{{packname}}” state: started

Read more

Lab Session

http://15.206.127.94/ 1.Write a Ansible Adhoc Commands to create a group called “deploy ansible localhost -m ansible.builtin.group -a”name=deploy state=present” -b 2.Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell. ansible localhost -m user -a”name=ramya password=abc@123 groups=deploy state=present shell=/bin/bash” -b 3 . Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos. ansible localhost -m yum -a”state=present name=httpd” -b 4 . Write a Ansible Adhoc commands to start

Read more

Why Ansible

Assignment 1 What is Ansible? Ansible is a configuration management for the server. Why Ansible? Easy to Learn Platform independent Idempotent Continuous deployment. Network Automation. Configuration Management. Architecture of Ansible:

Read more