· 6 years ago · Jan 02, 2020, 10:20 PM
1EX: -
2- mkdir iventory
3- mkdir role
4- mkdir playbooks
5- cd -inventory
6-vim project1
7[dev]
8127.0.0.1
9cd ..
10- ansible-playbook -i invontery/project1 playbook/project
11----------------------------------------
12Topics:
13Difference between file and template module:
14----------------------------------------
15Topic:
161.Ansible Architecture: Automation Engine:
17ANS: -Ansible automation engine contains everything needed to bring about automation in the infractructure.
18- The API's Ansible are there to support service like cloud and CLI.
19EG: - python API is used for command line interface.
20- Plugins act as extension to Ansible.
21Eg: Action plugin lets you perform tasks on your Ansible machine before you execute a playbook.
22Ansible Architecture CMDB:
23---------------------
24The configuration management database keeps a record of all the configuration changes made in the system.
25- The database could be kept on the cloud platform or on the physical server as well.
26Ansible Architecture: CLoud"
27----------------------
28- Ansible has a huge support for numerous coud applications.
29- These cloud appications can seamlessly be integrated wih ansibe
30- Ansible makes provisioning cloud infrastructres easy
31Ansible Architecture: Hosts and the Network
32--------------------------------------
33- The hosts are connected to the ansible system via secure SSH connection
34(thoug other encryption technologies can also be used)
35- Different network can be managed together giving each network separate access rights.
36Ex- apt-get install openssh-server
37Topics:
38--------
39Generating ssh key?
40ANS: ssh-keygen
41Q) How does ansible role use this customize thing?
42ANS: vim ansible.cfg
43Topics:
44Ad-Hoc Commands
45----------
46- Ansible command used earlier to check for working connection with host was indeed an Ad-Hoc command
47- Every TAsk in Playbook can be done by Ad-Hoc commands.
48- Ad-Hoc commands do nothing in terms of bringing in automation.
49----------------------------------------
50Topics:
51Ansible Module:
52- Ansible modules - pre-written