Ansible Command Application Basics
A previous article on the installation and role of Ansible, interested in can see Ansible introduction and installation. Learning Ansible is to re-learn the command and grammar.
Ansible can be
1. ansible command usage
The ansible command line can be executed in two ways: ad-hoc and ansible-playbook. The official web method provides paid product tower. Ad-hoc is mainly used to execute temporary commands. ansible-playbook is equivalent to a set of ad-hoc commands and is executed together with certain rules.1.1
Https://docs.saltstack.com/en/latest/topics/windows/windows-package-manager.htmlCan crossing Web documents, my English is poor, translation is not good, understandingIn 2015.8.0 and later, the Windows software repository cache was compiled on the salt minionThe saltstack Windows Software Resource Library provides a package manager and software repository similar to those provided by Yum and apt on Linux. The repository can use the Setup program on a
Tags: ansibleAnsible automated operations tools with the following features1. Modularization: Call a specific module to complete a specific task2, have paramiko,pyyaml,jinja2 (template language) three key modules3. Support Custom Module4, based on Python language implementation5, simple deployment, based on Python and SSH (installed by default), agentless6, security, based on OpenSSH7, Support playbook Orchestration task8, Idempotent: A task executes 1 times and executes n times the same effect,
Ansible
Ansible does not require any agents, except sshd, does not occupy the control of any resources in the ansible does not execute (the default support SSH, also supports other)Ansible also has no service side, only executes commands when neededAnsible based on module work, execute commands, scripts, planning task
Salt file ServerThe salt contains a simple file server for distributing files to salt minions. The file server is a stateless ZEROMQ server built on Salt master.The primary intent of the Salt file server is to use the display file in the
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 Ansible. Ansible is an
Ansible is a framework structure that works based on modules. The bulk deployment capability is implemented by the modules that are run by ansible. In short, Ansible is based on "modules" to accomplish various "tasks". The basic syntax for Ansible Common Core module modules is as followsansible [主机] [-m 模块] [-a args]
There are two more secure ways to store this type of data:The 1.ansible command-line tool Ansible-vault can encrypt and decrypt files used by any ansible.2. Use a third-party key Management service to store data.Ansible-vault can create, edit, encrypt, decrypt, and view files. Ansible Vault can encrypt any
is compromised, the attacker will be able to find the same password easily users, Thus also reduce the difficulty of password cracking, therefore, in the user password encryption, you need to consider to disguise the password, even the same password, should be saved as a different ciphertext, even if the user entered a weak password, but also need to consider the enhancement, thus increasing the difficulty of the password is compromised, The use of encrypted hash value with
Directory
Handlers
Playbook Case 2 handlers
VARs variable
Setup Facts Variable Usage
Case
Defining variables in Inventory
Case
Condition test
When statement
Case
Handlers
Follow up on an article Ansible playbooks introduction and use a continuation note
Used to take certain actions when the resources being followed are
This book is created by senior Wiecheng division, through a number of examples, detailed explanation of ansible this automated Maintenance tool basic principles and use of skills; from the basic architecture analysis, installation configuration, to the typical application case analysis, the author shared his work in the actual combat experience, for all types of operations, DevOps developers provide a detailed guide. The main contents of this book inc
This article will explain to you how to useNode.jsthe Crypto module to add salt to your passwordhash. Here, we will not make a detailed comparison of the password storage methods that we do not understand. What we are going to do is to know theNode.jsmechanism of using salt in thehashpassword store. Rest assured, this is the best way to store passwords before other better methods appear.
What is this
the way to wash your face with salt is:First use warm water to wet the face skin, and then half a teaspoon of fine salt on the palm of the hand rub to dissolve, evenly on the face, chin and the back of the ear. When rubbing, the fingers should not be too hard to avoid damaging the skin. After 30 seconds of massage, rinse with lukewarm water once, do not let the salt
Speaking of variables, the variables in ansible are almost the same as those in the pillar + grains in the salt-stack.
The main sources of variables in ansible are as follows:
Inventory (host vars, group vars)
Playbook
Command Line
The Playbook generates results during task execution. It can be register and used as a variable for the following task.
Roles
what databases can be stored: https://docs.saltstack.com/en/latest/ref/returners/all/index.htmluse MySQL as an example to configure the reference:Https://docs.saltstack.com/en/latest/ref/returners/all/salt.returners.mysql.html#module-salt.returners.mysqlInstalling MySQL Mysql-python[[email protected] salt]# yum install-y mysql-server mysql installation MySQL[email protected] ~]# Yum install-y mysql-python # All minion have to pack the bag [[email prot
One, the common automated maintenance tools:OS Provisioning:pxe, CobblerOS Config:puppet, Saltstack, chef, funcTask exec:fabric, Saltstack, funcProgram Deployment:fabricManagement host controls how nodes are managed:Agent: You need to install agents on the managed nodes to accept the operations of the management host, such as Puppet, FuncAgentless: The managed node does not need to install agent, the management host with SSH transfer operation instructions, such as
Salt Introduction:Salt, a new approach to infrastructure management, is easy to deploy, runs in minutes, scales well, and easily manages tens of thousands of servers, fast enough, and second-level communications between servers.The salt bottom uses a dynamic connection bus that allows it to be used for orchestration, remote execution, configuration management, and so on.Salt installation:master:192.168.31.2
Objective:Sometimes we need to define a host group when automating and batching the operations master. For example, Saltstack group, and Salt-n parameters, in Ansible under the self-fix ansible of the host group. Some trouble, you know, since you choose to use Saltstack, ansible this kind of cluster operation tool, if
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.