. Logical non-logical ANDNon-expression, such as the target host must be in group webservers but not in the Phoenix GroupWebserver:!phoenixAn expression of the intersection, such as the target host must be in group Webservers and in group stagingWebservers:stagingA more complex example:Webserver:dbservers:staging:!phoenixThe target host that the above complex expression finally represents must be met: in the webservers or dbservers group, it must also exist in the staging group, but not in the P
AnsibleSimple DescriptionAnsible is a new automated OPS tool that is developed based on Python and has a large collection of operations tools (puppet,cfengine,chef, Func,fabric), 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 deployment is the module that Ansible runs, andansible just provides a framework. Mainly include:(1) , co
value of poll to 0 .Finally, if the task that you are running takes an extremely long time to run, you cantell Ansible to wait for the job as long as it takes. To do this, set the value of asyncto 0 .You will want to use Ansible's polling in the following situations:• You have a long-running task that may hit the timeout• You need to run an operation across a large number of machines• You have an operation for which you don't need to wait to completeThere are also a few situations where you
-- Ensure cannot be summarized by the PNG process of the PAC Jinjia experiment.
Roles introduction:
Ansible uses roles to organize playbooks in a hierarchical and structured manner ). Roles can automatically Load Variable files, tasks, and handlers according to the hierarchical structure. Simply put, roles places variables, files, tasks, modules, and processors in separate directories and easily include them, roles is generally used to build services based on hosts, but can also be used to b
specific operating system as the target platform.
Desktop OS
Tool
Development Environment
Microsoft Windows 7
Visual Studio 2010
Windows 7
Apple Mac OS X
Xcode 4.3.2
Mac OS X
Mobile OS
Tool
Development Environment
Blackberry playbook OS 2.0
Blackberry native sdks 2.0
Windows 7, Mac OS X
For Android 2.3
Android ndk 7
Windows 7, Mac OS X
For IOS 5
Tools"Yum-YInstallZlib-develbzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-DEVELCD/usr/local/srcmkdir/usr/local/Python3Tar-ZXF python-3.6.6. TGZCD Python-3.6.6./configure--prefix=/usr/local/Python3 Make Make InstallLN-s/usr/local/python3/bin/python3/usr/bin/Python3LN-s/usr/local/python3/bin/pip3/usr/bin/pip3# End Installation script feature:1) Install the Yum dependency package2Create a directory, unzip the file, and compile an
Again to the weekend ~ ~ Upstairs in the decoration!! Can't sleep anymore ... You know!Simply tidy up the idea to do an improved version of the operation and maintenance of automation tools, hoping to achieve:
Control initialization of the host: such as adding SSH keys \ Storage repository settings \ operation user and password
Managed host Management: add \ Modify \ Remove add host user name \ password \ port Complete SSH key login in background, add managed host to storage repository
It ' s like JSON.But fast and small.
Messagepack is an efficient binary serialization format. It lets your Exchange data among multiple languages like JSON. But it ' s faster and smaller. Small integers is encoded into a single byte, and typical short strings require only one extra byte in addition to the St Rings themselves.
Messagepack is an efficient binary serialization format. It allows you to exchange data between languages like JSON. But it's faster and smaller than JSON. A smal
to wait for the job as long as it takes. To do this, set the value of asyncto 0 .You will want to use Ansible's polling in the following situations:? You have a long-running task that may hit the timeout? You need to run an operation across a large number of machines? You have an operation for which you don't need to wait to completeThere are also a few situations where you should not use async or poll :? If your job acquires locks that prevent other things from running? You job only takes
Do not reprint advanced playbook without written permission
Extra variablesYou may have seen in our template example in the previous chapter that we used avariable called group_names . This is one of the magic variables that are provided byAnsible itself. At the time of writing there are seven such variables, described in thefollowing sections.
External variables
You have seen in the previous template example that we have a variable named group_names
Ansible @ an efficient configuration management tool-Ansible configure management-translation (5), ansible-ansibleDo not reprint advanced Playbook without written permission
Extra variablesYou may have seen in our template example in the previous chapter that we used avariable called group_names . This is one of the magic variables that are provided byAnsible itself. At the time of writing there are seven such variables, described in thefollowing sec
With Ansible also has more than two years, before doing the initialization work is in the Kickstart configuration file with their shell script initialization system environment, now the operation and maintenance environment is different, the pre-system installation work to the IDC department to deal with, What I can do here is to initialize my favorite operations environment with a script. No ansible before using the shell can also achieve some of his functions, such as with the Ad-hoc scenario,
triggers notifyAnsible Common templates:Command: Execute Linux commandShell: Execute shell commandCopy: CP on local object to other hostPing:ping other hosts are aliveFile: Create, delete files, directoriesYum: Installing softwareService: Services CommandAnsible Common commands:Ansible: Perform some simple and timely tasksAnsible-playbook: Execute the scripted scriptAnsible-doc: View the specific usage of a command.Perform a part of a playbookAnsible
managed hosts must be placed in the hosts, not necessarily this hosts, can be specified using the-i parameter of the ansible)[testhost]172.16.162.130This is also a common format, Testhost represents a group, 172.16.162.130 represents a member, and can have multiple members, such as[testhost]172.16.162.130172.16.162.131If the host has a similar naming of the rules, you can use the list form:[testwebservers]web[01:10].lansgg.comRepresents web01.lansgg.com web02.lansgg.com-------web10.lansgg.comHo
L most of the time in a production environment, you need to manage the configuration files, and the installation packages are only used when initializing the environment. Let's write a playbook to manage nginx configuration files. L mkdir-p/etc/ansible/nginx_config/roles/{new,old}/{files,handlers,vars,tasks}LwhichNewTo be used for the update, Oldused for rollback,FilesBelow isnginx.confand thevhostsdirectory,handlersRestartNginxCommands for servicesL
as it takes. To does this, set the value of Asyncto 0. You'll want to use Ansible's polling in the following situations:? you had a long-running task that May hits the timeout? need to run an operation across a large number of machines? You had an operation for which you don't need to wait to Completethere is also a few situations where you should not us E Async or poll:? If your job acquires locks that prevent other things from running? nbsp ; You job only takes a short time to runAdvance
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.