Introduction to Ansible - DevOps in 2018
Introduction to Ansible - DevOps
Introduction to Ansible |
Learn more about Ansible's features and how Ansible works with the boss and doll, and see some technical examples of configuration management and workflow automation.
Unwanted is a general automation tool that can be used for configuration management or automation of workflow. Configuration management is the practice of "infrastructure as a code" that encodes things, p. which packages and versions should be installed on the system or which demons should operate. Workflow automation can be from the provision of cloud infrastructure to software implementation.
This article starts with a general description of features, a description of how Ansible fits with a chef or doll, and technical examples of configuration management and workflow automation. In this article you will get an idea of what Anishi can do and high-level topics to continue learning.
Features and description
Ansible is written in Python and uses SSH to run commands on different computers. Anishi does not have agents, which makes it much easier to get started. All you need is access to SSH and Python access to the appropriate devices. Ansible uses declarative YML "playbooks" to map the host group (from "inventory") to well defined roles. The declarators are used to tell Ansible how to configure or change things, and Ansible makes the necessary changes. For example, you can run a game book "configure a web server" that installs Nginx and connects each machine with a balancer of load.
"Inventory" is a static or dynamic list (for example, if you are using EC2) of machines with associated tags and other metadata (for example, which user connects as an SSH port). Players list "play". The "Game" specifies that machines must perform "tasks". The tasks are used by "Anlys" modules to perform an individual job. Ansible has modules for installing suitable packages, creating files, managing users, connecting with cloud providers and much more. Every version is literally hundreds of modules and new modules. It is important that you understand this hierarchy. Here is an example of the work presented by Ansus peusdo:
1. Create a web server infrastructure (the first "game")
o Run from a local host (inventory machines)
o Do the following: ("homework")
- create a new elastic IP address,
- Create a new EC2 instance and connect the elastic IP address, and
- Add an EC2 example to the list.
2. Configure your web server (another "play")
o Run in all cases of the Web servero Do the following: ("homework")
- Install Nginx,
- Clone the latest GitHub code,
- Configure Nginx to serve codes,
- Restart Nginx, if necessary,
- Perform a test request on a local server to see if things work, and
- Send a performance announcement.
Possible, chef and doll
The chef and puppet chef are two popular automation tools. All three can be used to solve similar problems and have similar functions. There are two major differences between Ansible and Chef / Puppet. Both main chefs and puppets are mainly represented. The machines operated by Chef / Puppet are run by an agent. The agent checks the control machine to see what changes have to happen. This does not require SSH, but requires the infrastructure to run the doll / chef server. A "potential agent" model means it's easy to start and work for smaller stocks. But this becomes a problem with hundreds of machines. In this case, one option is possible. It is also possible for SSH to connect to machines, so the key allocation is another aspect that needs to be taken into account.
Chef and Puppet use a special custom domain language to describe what to do. The chef actually uses the Ruby code. Puppet has created a brand new DSL. If you already know YAML, then you are ready to start writing options.
There are much more in-depth comparisons between these three tools. We will no longer devote to discussions. Here's a quick summary before you continue using the Options to do things:
- The option uses YML to describe the work,
- The cooker uses the Ruby code to describe the work,
- Puppet uses custom DSL
Configuration of the system
In this section, let's assume that "shaping management" deals with the state-of-the-art models. Common activities are:
- Installing packages,
- Creating files,
- Manage permissions for the file system
- Change the atmosphere variables,
- Restrict sanitation / services,
- Renew code code, and
- Use wildlife ...
Comments
Post a Comment