Ansible Variable Lab & Excercise – Part 2

Assigment 1 – Create a playbook and setup a webserver(httpd) and use httpd as a variable decalared in role var file Assigment 2 – Create a playbook and setup a webserver(httpd) and use httpd as a variable declared using prompt. Assigment 3 – Create a playbook and setup a webserver(httpd) and find a list of .txt file in some directory and output using register variables Assigment 4 – Create a playbook and setup a webserver(httpd), copy a index.html and interpolate

Read more

Ansible Playbook Lab & Excercise – Part 3

Create a playbook where you should install a webserver into 2 OS type(Ubuntu and RHEL) with fact conditioning. and list out a directory which in “/etc” and display such as “This is a directory /file in /etc:-XXXx”To be used Conditiong, looping, regiter and fact variable. There are 2 environment DEV and QA. Both has their own group_vars. Using it, in Dev and QA environment(RHEL/CENTOS) install apache and Dev should run with 80 port and QA should run with 8080 port.

Read more

Ansible Playbook Exercises

https://www.devopsschool.com/blog/ansible-playbook-lab-excercise-part-2/ To run the playbook: Playbook Variables Precedence of Variables Command Line variable takes precedence over all other. Variables using task include takes precedence over all, except command line variable. External variables take precedence over variable prompt. Variable using prompt takes precedence over embedded variables.

Read more

Ansible Adhoc Commands Lab and Excercise – Part 1

Write a Ansible Adhoc Commands to create a group called “deploy Write a Ansible Adhoc Commands to create a user called “deploy-user” which is part of group called “deploy” and with /bin/bash shell.  Write a Ansible Adhoc commands install package named “httpd” in RHEL/centos. Write a Ansible Adhoc commands to start and enable the service named “httpd” Write a Ansible commands to copy a file called “second.html” in /var/www/html/second.html with some dummy html contents.

Read more

What is Ansible and How it works?

What is Ansible? Ansible is a cross-platform Configuration Management Tool for Server(s), which is primarily written using python. Benefits of Ansible The benefits are as follows: It is easy to learn, understand and use which makes it the choice for server config management It is Idempotent, that is, there are no additional effect if it is called more than once with the same input parameters. It is Platform Independent. Ansible-Command prompt is free. Architecture of Ansible

Read more