I'm not going to talk about it here, so you can refer to the official documentation. Here I will be divided into three parts to explain: 1, configuration inventory,2, Batch execution command, 3, playbook job.System environment:
Server
IP Address
Operating System
Required Software
Ansible Host
192.168.2.203
Centos 7 64-bit
Install NGINX and NGINX Plus using Ansible
In the production environment, I prefer to do everything related to automation. If the computer can complete your task, why do you need to do it yourself? However, in an ever-changing environment with multiple technologies, creating and implementing automation is an arduous task. That's why I like
development module.
4, salt and ansible all use the Yaml language format to write the script.
Ansible because of the SSH, so it has the process of authentication, as well as the process of password, which makes ansible very slow, does not apply to the large-scale environment (thousands of units).
Why I give up the
Theoretical part:
Common Automated operations Tools:
Puppet-Ruby-based development with C/S architecture, strong extensibility, SSL-based, and relatively weak remote command executionSaltstack-Based on Python development, with C/S architecture, relatively puppet and lightweight, configuration syntax using Ymal, making configuration scripts simplerAnsible-Based on Python Paramiko development, distributed, no client, lightweight, configuration syntax using Ymal and JINJA2 template la
I. Overview of AnsibleDue to the rapid development of the Internet, the speed of product replacement gradually accelerated, operations and maintenance personnel to carry out a large number of daily operations, still in accordance with the traditional way of maintenance will make the work inefficient. This is the deployment of automated operations that can accomplish these tasks as safely and efficiently as possible.Ansible is based on the development of Pythen, set up a number of excellent opera
/listenerConfigure Auth to True (default = False): WinRM set Winrm/config/service/auth @{basic= "true"}Configure allow non-encryption: WinRM set Winrm/config/service @{allowunencrypted= "true"}This completes the environment configuration for the Windows Remote Management (WS-MANAGEMENT,WINRM) service!
Control host Linux: If you do not have PIP installed, first install the PIP that corresponds to your Python version: [[emailprotected] sv
Ansible + Corosync + Pacemaker + NFS for http High Availability
Directory:
(1) experiment environment(2) Preparations(3) Configure basic configurations for node1 and node2(4) deploying nfs using ansible(5) deploying corosync and pacemaker using ansible(6) Use ansible to inst
│ │ └──nginx.conf│ └──nginx02│ ├──tasks│ │ └── main.yml│ └──templates│ └──nginx.conf└──site.ymlJenkins Association ConfigurationChoice ParameterDeploy_environment define the deployment environment name DEV,TEST,UAT,PDTExecute ShellStart and end of set +x, Set-x used to open and close the part of the extended parameters and commandsCD $WORKSPACE/leon-playbook-phpcms1.1Ansible--versionAnsible-playbook-i inventory/
too complex;(4), support sudo.5 , task execution FlowDescription(1), the above content is based on the sharing of others on the basis of summing up, learning for reference;(2), this installation is based on the CentOS 6.4 system environment.==========================================================================================Second, Ansible Basic installation and configuration==========================
moduleStart, stop, restart, reload, corresponding to 4 state as follows:
Started
Stopped
Restarted
Reloaded
Start the MySQL service.Ansible linuxserver-m service-a "Name=mysqld state=started"Stop the MySQL service.Ansible linuxserver-m service-a "Name=mysqld state=stopped"650) this.width=650; "title=" image "style=" border-top:0px;border-right:0px;background-image:none;border-bottom:0 px;padding-top:0px;padding-left:0px;border-left:0px;padding-right:0px; "alt=" image "
split and used in any combination, for example:
1)Services are not deployed in a new environment. You only need to adjust the script sequence of the installation package to be uploaded. After the installation package is uploaded, the subsequent operations will be executed normally.
2)Iterative update: The function is slightly modified. The original configuration item does not need to be modified. You only need to adjust the script order for uploading
If you do not have written authorization, do not reprint it.
Chapter 4 Use of ansible in large projects
New features in 1.3There are two features in Ansible 1.3 that were alluded to previously in the chapter.The first feature is the metadata roles. They allow you to specify that your roledepends on other roles. For example, if the application that you are deploying needsto send mail, your role could depend
you run ansible from a git checkout, remember that you need to set your environment every time you use it, or you can add this setting process to Your bash rc file:
# Add BASH RC
$ Echo "export ANSIBLE_HOSTS = ~ /Ansible_hosts ">> ~ /. Bashrc
$ Echo "source ~ /Ansible/hacking/env-setup ">> ~ /. Bashrc
The hosts file of
No written authorization. Do not reprint Chapter 5 custom Module
Using a moduleNow that we have written our very first module for Ansible, we should give it ago in a playbook. Ansible looks at several places for its modules: first it looks at theplace specified in the library key in its config file ( /etc/ansible/ansible.cfg ),next it will look in the location s
Create ansible and manage container nodes based on DockerScenario: When learning conditions are limited, you can complete Docker and ansible learning with a single VMFIX: Create a custom image and build multiple ansible containers first.Of course, this method is suitable for other similar scenarios.VMS Environment:
Ansible (10) first exercise and ansible first exerciseSummary
We have learned apt, yum, zypper, copy, and other modules. You must be bored.The following is a practical example.Actual case:
Batch tomcat configuration
Only the knowledge of the above modules is enough for us to orchestrate a Playbook to configure a large number of physical/virtual servers.Actual scenarios
A company has applied for 1
Ansible learning-ansible
Ansible technologies (Automated O M tools) are developed based on python.
Installation methods include yum, apt, pip, etc.
For example, pip: pip install ansible
The only requirement of ansible for the client is to have SSH and Python (if the python
Use of ansible
Introduction:
Ansible is designed for convenient and quick configuration management. With ansible, You can simplify and standardize complex configurations and make them easier to control. Ansible can achieve 100 and 1000 batch deployment.
Ansible features:
(1
First, host planning
Create 4 virtual machines as a demo ansible environment, install the operating system as CentOS 7.4. 1 of them as management host, the other 3 as the managed host. IP and host name are: IP host name note 192.168.128.10 Ansible-manager Management host 192.168.128.11 Ansible-demo1 managed host 1 192.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.