#1. Is Ansible used for automation? since decades before the development of Ansible, automation is been used. Why Ansible now?

Earlier, automation was achieved by the scripting language by using the imperative approach, whcih means the script should include two things

  1. what do you want to do?
  2. How do you want to do.?

On the other hand, Ansible behaves intelligently. It has the declarative approach. The programmer has to tell jsut one thing.

  1. What do you want to do?

Ansible automatically figures out how to do.

#2. POINTS

  • Why Ansible?

  • Ansible automation has two ways:

  • USE CASE OF ANSIBLE IN AMAZON:

  • How AWS is using the ansible?

  • Ansible clarity and the power of AWS]

  • MANAGING CLOUD WITH ANSIBLE.

  • Cloud control with dynamic Inventory:

  • Migration made easy

  • Securely and Safely Automation with no latency.

Ansible PlayBook that does the following operations in the managed nodes:

  • __ Configure Docker__
  • __ Start and enable Docker services__
  • __ Pull the httpd server image from the Docker Hub__
  • __ Run the docker container and expose it to the public__
  • __ Copy the html code in /var/www/html directory and start the web server__

HTTPD SERVICE AS IDEMPOTENT

PROBLEM STATEMENT: The httpd service is not idempotent in nature, ie it always restarts the service if some changes been made in conf file or not.

INTITUTION: With the use of notify and handler module, we made the httpd service restarts only when there is some change in conf file only.

Configure Hadoop and start cluster services using Ansible Playbook

Summary:

day 1 (03-11-2020)

πŸ‘‰ What is Ansible & why it is used ?

βœ”1. It is a software provides automation and has its own personal language to write a code and follows a declarative approach, where user has to enter the input of β€œwhat to do”, it automatically figures out how to do.

πŸ‘‰ What is Automation & where it is used ?

βœ”2. Automation is to make a program do the work. It is mainly used for performing the same task again and again.

πŸ‘‰ What is difference between Imperative & Declarative Language?

βœ”3. Imperative approach needs how and what to do as input, whereas declarative approach only needs what to do as input.

πŸ‘‰ How can we use imperative & declarative language ?

βœ”4. Imperative language us been used since decades using various software, and declarative is presently used with the Ansible software.

πŸ‘‰ What is Configuration Management ?

βœ”5. It is used to configure some task, and it has two ways: Manual and Automation.

πŸ‘‰ How to install ansible?

βœ”6. ”pip3 install ansible"

πŸ‘‰ What is inventory?

βœ”7. a file in the controller node that contains all the target IP, protocol, user and password.

πŸ‘‰ How to start httpd service using ansible command ?

βœ”8. ansible -m service -a "name=httpd state=started"

day2 4-11-20

πŸ‘‰ Explain ansible architecture.

βœ”6. it comprises of control node and target node. - is a system where we install ansible & write a code and n no. of target node .It is a system where we do operations. We control all the target nodes with the help of the controller node.

πŸ‘‰ What is controller node and target node?

βœ”7. Controller node is a system where we install ansible & write a code and n no. of target node. It is a system where we do operations. We control all the target nodes with the help of the controller node.

πŸ‘‰ How to install ansible?

βœ”8. ”pip3 install ansible"

πŸ‘‰ What is inventory?

βœ”9. a file in the controller node that contains all the target IP, protocol, user and password.

πŸ‘‰ How to start httpd service using ansible command ?

βœ”10. ansible -m service -a "name=httpd state=started"

day3 5-11-20

πŸ‘‰ What is Configuration Management ?

βœ”11. It is used to configure some task, and it has two ways: Manual and Automation.

πŸ‘‰ Explain ansible architecture.

βœ”12. it comprises of control node and target node. - is a system where we install ansible & write a code and n no. of target node .It is a system where we do operations. We control all the target nodes with the help of the controller node.

πŸ‘‰ What is controller node and target node?

βœ”13. Controller node is a system where we install ansible & write a code and n no. of target node. It is a system where we do operations. We control all the target nodes with the help of the controller node.

day4 24 November 2020

πŸ‘‰ What provide intelligence to ansible?

βœ”14. The concept of playbook and making the list of plays make the ansible a very intelligent software.

πŸ‘‰ Which format is used to write plays in Ansible Playbook?

βœ”15. JSON / YML format: to use key pair value as ansible is a declarative lang, if you want to declare (eg x=5), key value pair is req.

πŸ‘‰ How to increase the readability of the code? βœ”16. By modifying the code by using the keywords like β€œhosts” , β€œtasks” to make it easy and redable.

πŸ‘‰ What does YAML signify?

βœ”17. YAML: Ansible used YAML programming language to write a playbook

πŸ‘‰ Which command is used to check the syntax of Ansible Playbook ?

βœ”18. ansible-playbook --syntax-check filename.yml

πŸ‘‰ What are the two approach used for Configuration management using Ansible?

βœ”19. a. Manual way using adhoc b. Automated way by using playbook πŸ‘‰ What are Ad-hoc commands?

βœ”20. adhoc: it is the manual way of using ansible by typing command for every step.

day5 25 November 2020

πŸ‘‰ What are the pre-requisites for installing packages in Managed Nodes?

βœ”21. Creating directory, mounting and configuring yum.

πŸ‘‰ What is the ansible module name for creating dir?

βœ”22. File and it has arguments state and path.

πŸ‘‰ How does ansible explore about all the required information of Managed Node?

βœ”23. After running the command, GATHERING FACTS occurs to explore the information about the managed node.

πŸ‘‰ What is the use of -v option in ansible playbook command and how to increase the verbosity?

βœ”24. -v stands for verbosity , it actually defines the whole process in more brief and can be used to max as 5 times i.e -vvvvv.

πŸ‘‰ How to configure yum, create directory, mount, install packages and enable firewalld service using ansible?

βœ”25. see the code folder.

πŸ‘‰ What is the use of firewall-cmd --list-port?

βœ”26. To show the port allowed by the firewall

πŸ‘‰What is the difference between β€˜ β€˜ and β€œ β€œ in YAML ?

βœ”27. Escape sequences are used under β€œ β€œ . whereas in β€˜ β€˜ it is passed as literals(copy as it is)