Introduction: Ansible is a new automated operations tools, based on Python development, the collection of many operations tools (puppet, Cfengine, Chef, func, fabric) The advantages of the implementation of batch system configuration, batch program deployment, batch Run command and other functions. Ansible is a module-based operation and does not have the capacity to deploy in bulk. The real batch deploymen
Any server can be the master terminal
1, install Epel Source:# RPM-IUVH http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
2. Install the package:# yum Install Ansible
3, set up SSH password-free login:# # Generate public/private key # Ssh-keygen-t Rsa-p ' # # Write a trusted file (distribute/root/.ssh/id_rsa_storm1.pub to other servers and execute the following on all servers): # CAT/ROOT/.SSH/ID_ Rsa_storm1.pub >>/root
Ansible playbook component, ansibleplaybook
Core elements of playbook:
Tasks: Task
Variables: Variable
Templates: Template
Handlers: Processor
Roles: Role
Organization format: YAML (also known as a Markup Language)
Syntax: (the list is represented by a horizontal bar. Key-value pairs are separated by colons, and other key-value pairs can be nested in key-value pairs)
Example: name: tom
Age: 21
Gender: Male
Spourse:
Name: lily
Gender: female
Children:
Common ansible module usage
Ansible provides many modules by default. In Linux, we can run the ansible-doc-l command to check which modules are supported by ansible, you can use the ansible-doc-s Module name to view the parameters available for this module.
The following des
Ansible notesHosts: remote hostUser: Users who are executing the task groupRemote_user: Same as usersudo: If set to Yes, the user performing the task group gets root permission when the task is performed.Sudo_user: If you set user to Tom,sudo as Yes,sudo_user for Jerry, then Tom gets the permissions of the Jerry user.Connection: How to connect to the remote host.# # #gather: Collecting Facts: FactsGather_facts: Unless you explicitly indicate that you
Tags: authorize ADT upd Ping install repos target host TargeAnsible is a tool for batch deploymentReference: Ansible Chinese authoritative guide1. Installationsudo apt-get install Software-properties-commonsudo apt-add-repository ppa:ansible/ansiblesudo apt-get Updatesudo Apt-get Install Ansible2. Add the IP of the server in the/etc/ansible/hosts fileVim/etc/
Command module:The 1:command module executes the command on the remote node:The command module is followed by the commands to be executed, and the arguments to the command are separated by spaces. The specified command executes on the selected node. The command is not executed through the shell, so environment variables such as $home and some operators (1 chdir switch to the specified directory before running the command.[Email protected] ansible]#
First, brief1. DescriptionThe daily system Automation operation and maintenance process will inevitably have a Windows Series server, in terms of open source software is currently most of the Windows Batch management compatibility is not very good, unlike the Linux system is convenient, but in reality there are some business need to run on Windows; Search find toss some, Discover Python developed ansible (has been redhat acquisition) have a better sol
Tags: ATI var web page import data setup.py from TPS Stat extHere is an example of the installation of the Ansible-cmdb plugin, Web presentation, and importing MySQL databaseInstallation Environment:Centos7ip:10.1.1.101. Install Apache:[Email protected] ~]yum install httpdBecause you want to use Web browsing, install Apache2. Install Ansible-cmdb plug-in[Email protected] opt]# wget https://files.pythonhoste
document is by default in v1.11.2 version
Kube-dns
1.14.10
This document is by default in the 1.14.10 version
Dashboard
1.8.3
This document is by default in the 1.8.3 version
Heapster
v1.5.4
This document is by default in the v1.5.4 version
Influxdb
v1.5.2
This document is by default in the v1.5.2 version
Grafana
v5.0.4
This document is by default in the v5.0.4 version
Before I had summed up a little Ansible series Bowen, this article also take the previous space bar. In the current network application, the security-hardened host is not allowed to log in directly to the root user, and many commands require root users to perform, without rebuilding the current network. Hope that through a common user first landing, and then Su-cut to root execution. and the passwords for the regular and root users of each host are di
execute any command does not need to have Xshell or CRT and other remote tool operation;650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M00/7D/4B/wKiom1blAQ-gFTpJAAJni5uQ3nE864.jpg "style=" float: none; "title=" Landing Interface 03.jpg "alt=" Wkiom1blaq-gftpjaajni5uq3ne864.jpg "/>Support recording function, video playback function650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7D/49/wKioL1blAsOSH8BUAAZoJ34QmdE027.jpg "style=" float
The previous article introduced the installation configuration and example of Ansible: http://msiyuetian.blog.51cto.com/8637744/1748143The following article mainly introduces Ansible's playbook, playbook is equivalent to the module or function written into the configuration file, and then we execute the configuration file to achieve the purpose of remote operation and maintenance automation.First, the simple use of playbook
1. Create a File inst
First, IntroductionAnsible is strong in the playbooks, but in order to use the playbooks very well, we must first have some foundation. such as: How to write a one-time script command? How do you know which modules are available? How are each module used? such asWith this article, you can learn how to use one-time commands and some modules.After installing Ansible, to get started, you also need to create a list of controlled hosts. Default Read/etc/
1. Introduction to ansible: ansible is developed based on Python and integrates the advantages of many excellent O M tools to implement features such as running commands, deploying programs, and configuring the system in batches. By default, SSH protocol is used for remote command execution or configuration delivery, without the need to deploy any client proxy software, making the deployment of the automat
ansiblebased onPythonDevelopment, the collection of many operations and maintenance toolsthe advantages of the implementation of batch system configuration, batch program deployment, batch Run command and other functions, it realizes configuration management, application deployment, task execution and other functions through SSH, so it is necessary to configure the Ansible side to contact each managed node based on key authentication in advance. Comma
This is a creation in
Article, where the information may have evolved or changed.
Background knowledge
TIDB as a distributed database, configuring installation Services on multiple nodes is cumbersome, and using automated tools for batch deployment is a good choice in order to simplify operations and facilitate management.
Ansible is a Python-based automated operation and maintenance tools, combining the advantages of many old operations and maintenan
Development CMDB, in addition to record the server's account password, but also need to record the server hardware and software information, if the use of manual records, if the server is large, the workload is relatively large, so I need to be able to automatically obtain this information method, I used the ansible to get, Ansible with the Setup module, you can get this information to the server, and then
1, ansible-doc command: Get the module list, and module use format;Ansible-doc-l: Get listAnsible-doc-s module_name: Get usage information for the specified module2. Ansible command formatAnsible
Indicates a controlled host, expressed in the form of a pattern or given directlyIP, must be defined in the document beforehand; AllSet All
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.