Play Ansible in one step
I wrote a column about Ansible. It's very systematic from 0 to 1. It's about 39W words. There are more than 430 pages of pdf, only 39 yuan.
Address: https://blog.51cto.com/cloumn/detail/83
Column contents:
1. Learning is not confused: how can Ansible master
2. Entering the Ansible world: usage overview and initial experience
3. Develop actor list: inventory
4. Hey, look at Ansible's Soul: playbook
5.Ansible power: batch initialization of servers
6. Larger stage (1): organize multiple documents and Role
7. Bigger stage (2): deploy LNMP cases with Role
8. Regress Ansible and advance: variable, condition, cycle, exception handling and others
9. The power of the tiger: Unlock the powerful Jinja2 template
10. The pursuit of service 0 downtime: rolling publishing and node scaling of Haproxy+Nginx cluster service
11.Ansible, hurry up: ansible performs process analysis, asynchronous and efficiency optimization
12. Make Ansible more secure: use Vault for encryption
13. There are too many ants to bite Ansible: Ansible Tower
14.Ansible management docker and openstack
15. Unexpected joy: Ansible manages Windows host
16. Sense of achievement comes from creation: write Ansible module by yourself
Contents:
1.Learning is not confused: Ansible How to master 1.1 Once there was a Linux O & M, then he was tired 1.2 I want it in three minutes Ansible All information of 1.3 How to learn and learn Ansible 2.make an initial entry Ansible World: usage overview and initial experience 2.1 Test environment and configure ssh Host mutual trust 2.1.1 Install the latest version of Ansible 2.1.2 Ansible Parameter completion function 2.1.3 Configure host mutual trust 2.2 Ansible Initial experience 2.3 Ansible configuration file 3.Develop cast: inventory 3.1 inventory File path 3.2 To configure inventory 3.2.1 Definition method of one line one host 3.2.2 inventory Common variables in 3.2.3 Host group 3.2.4 Host group variable 3.2.5 Group nesting 3.2.6 Multiple inventory file 3.3 dynamic inventory And temporarily add hosts 3.4 The inventory file 4.Hey, look Ansible The soul of: playbook 4.1 playbook,play and task Relationship of 4.2 playbook Syntax of: YAML 4.2.1 object 4.2.2 array 4.2.3 Dictionaries 4.2.4 Composite structure 4.2.5 String continuation 4.2.6 Null value 4.2.7 YAML Single and double quotation marks and escape in 4.3 playbook How to write 4.4 playbook Transfer mode of module parameters 4.5 Specify execution play Target host for 4.6 Default task execution policy 5.Ansible Initial strength: batch initialization server 5.1 Batch initialization server case 5.2 Ansible To configure SSH Key authentication 5.2.1 Scheme 1: rewrite the command line to playbook command,shell,raw and script Modular connection and delegate_to instructions 5.2.2 Scheme II: use authorized_key Modular lookup()or query()Read external data 5.3 Configure host name 5.3.1 vars set variable 5.3.2 when Condition judgment 5.3.3 loop loop 5.4 Add to each other DNS Parsing records 5.4.1 lineinfile Modular 5.4.2 play_hosts and hostvars variable 5.5 To configure yum Mirror the source and install the software 5.6 time synchronization 5.7 Close Selinux 5.8 Configure firewall 5.9 Remote modification sshd Profile and restart 5.9.1 notify and handlers 5.10 Consolidate all tasks to a single playbook in 6.A bigger stage(1): Organize multiple files and Role 6.1 Use include still import? 6.2 organization task 6.2.1 In loop include file 6.3 organization handler 6.4 Organizational variables 6.4.1 vars_files 6.4.2 include_vars 6.4.3 --extra-vars option 6.5 organization playbook file 6.6 More standardized organization: Role 6.6.1 Role Document structure list 6.6.2 Definition Role Of task 6.6.3 Definition Role Of handler 6.6.4 Definition Role Variable of 6.6.5 Role External files and template files used 6.6.6 Role Modules and plug-ins defined in 6.6.7 Definition Role Dependency of 6.6.8 Write a Role 6.7 Use Role: roles,include_role and import_role 6.8 Viewing tasks and tagging tags 6.9 Ansible Galaxy and Collection Ansible Collection 6.10 playbook Execution order of 6.10.1 playbook Parsing, dynamic loading, and static loading 7.A bigger stage(2): utilize Role deploy LNMP case 7.1 Description of experimental environment 7.2 Establish Role And provide inventory 7.3 To configure yum Mirror source 7.4 Install and configure Nginx 7.5 Arrangement nginx Many tasks of 7.6 Install and configure PHP 7.7 Install and configure MySQL 7.8 Task split to multiple Role in 7.8.1 common Role 7.8.2 Nginx Role 7.8.3 PHP Role 7.8.4 MySQL Role 7.9 For each Role Provide a playbook 8.regression Ansible And advanced: variables, conditions, loops, exception handling and others 8.1 inventory Advanced level of 8.1.1 inventory analysis 8.1.2 inventory Variable file: host_vars and group_vars 8.1.3 dynamic inventory 8.1.4 Add nodes temporarily: add_host Modular 8.1.5 group_by Set host group temporarily at runtime 8.1.6 --limit Restrict target host again 8.2 Collect information about the target node: Facts 8.2.1 How to collect Facts Information? 8.2.2 How to access Facts Information? 8.2.3 local Facts 8.2.4 Entrust Facts 8.2.5 set_fact Modular 8.2.6 Facts cache 8.3 Ansible The advancement of variables 8.3.1 Two ways to access list and dictionary variables 8.3.2 --extra-vars Option definition extra variable 8.3.3 inventory variable 8.3.4 Role variable 8.3.5 play variable 8.3.6 task variable 8.3.7 block variable 8.3.8 Facts Information variable 8.3.9 Predefined special variables 8.3.10 Variable scope 8.4 YAML Plain text naked string 8.5 handler Advanced level of 8.6 when Condition judgment 8.6.1 Meet multiple conditions at the same time 8.6.2 Importing files by criteria 8.6.3 when And cycle 8.7 The advance of cyclic iteration 8.7.1 with_list 8.7.2 with_items and with_flattened 8.7.3 with_indexed_items 8.7.4 with_dict 8.7.5 with_together 8.7.6 with_sequence 8.7.7 with_subelements 8.7.8 with_nested 8.7.9 with_random_choice 8.7.10 with_fileglob 8.7.11 with_lines 8.7.12 Cycle and when 8.7.13 Cycle and register 8.7.14 Control of cycle: loop_control 1.label parameter 2.pause parameter 3.index_var parameter 4.loop_var parameter 5.extended parameter 8.8 Exception and error handling 8.8.1 Artificial manufacturing failure: fail Modular 8.8.2 Assertion: assert Modular 8.8.3 ignore_errors 8.8.4 failed_when 8.8.5 rescue and always 8.8.6 any_errors_fatal 8.8.7 max_fail_percentage 8.8.8 Failed to process connection(unreachable)Exception of 8.8.9 Task failure causes handler unexecuted 8.9 Other Ansible Advanced process control logic 8.9.1 until and retry 8.9.2 pause Module pause, sleep 8.9.3 wait_for Modules and wait_for_connection Modular 9.Power of the tiger: Unlock the powerful Jinja2 Template 9.1 Jinja2 What is it? What is a template? 9.2 Ansible Where is it used Jinja2 9.3 Jinja2 Two ways to access elements 9.4 Jinja2 Condition judgment 9.4.1 if Statement block 9.4.2 Hanlin Academician if expression 9.5 for loop 9.5.1 for Iteration list 9.5.2 for Iteration dictionary 9.5.3 for Special control variables of 9.6 Macro 9.7 block 9.8 Variable assignment and scope 9.8.1 How to cross scope 9.9 Jinja2 Blank handling of 9.10 Real case: fully customized nginx Virtual host configuration 9.11 Basic operators 9.12 Jinja2 Built in is test 9.13 Ansible Extended test functions 9.13.1 Test string 9.13.2 Version number size comparison 9.13.3 Subset, parent set test 9.13.4 Member test 9.13.5 Test documents 9.13.6 Execution status of test task 9.14 Jinja2 Built-in Filter 9.15 Ansible Extended Filter 9.15.1 Type conversion class filter 9.15.2 Get current point in time 9.15.3 YAML,JSON format 9.15.4 Parameter ignored 9.15.5 List element connection 9.15.6 List flattening 9.15.7 Union, intersection and difference 9.15.8 dict and list Transformation 9.15.9 zip and zip_longest 9.15.10 Subelements subelements 9.15.11 random Generate random number 9.15.12 shuffle Disorder order 9.15.13 json_query 9.15.14 ip Address filtering 9.15.15 Regular expression filter 9.15.16 URL Process filter 9.15.17 Comment filter 9.15.18 extract Extract elements 9.15.19 dict merge 9.15.20 hash Value calculation 9.15.21 base64 Codec filter 9.15.22 File name processing 9.15.23 Date time class processing 9.15.24 human_to_bytes and human_readable 9.15.25 Other filters 9.16 Python Method of object itself 9.16.1 Python String object method 9.16.2 list Object method 10.Service 0 downtime The pursuit of: Haproxy+Nginx Rolling publishing and node scaling of cluster services 10.1 Environmental description 10.2 Installation configuration HAProxy Role 10.3 Installation configuration Nginx Role 10.4 Rolling Publishing: Load Balance Rear end node lifting stage 10.5 Understand Ansible Execution strategy 10.5.1 Ansible Default execution policy for 10.5.2 serial Execute nodes in batches play 10.5.3 strategy Specify execution policy 10.5.4 throttle Limit the maximum number of concurrent tasks 10.6 Ansible Rolling publish complete 10.7 Scaling of cluster backend nodes 10.8 Handle Ansible Exceptions during deployment and maintenance 11.Ansible You hurry up: Ansible Execution process analysis, asynchronous, efficiency optimization 11.1 Measure task execution speed: profile_tasks Plug-in unit 11.2 Ansible Perform process analysis 11.3 review Ansible Implementation strategy of 11.4 Enlarge forks Value 11.5 Modify execution policy 11.6 send Ansible Asynchronous task execution 11.6.1 async and poll instructions 11.6.2 Wait for asynchronous task 11.6.3 When to use asynchronous tasks 11.7 open ssh Long connection 11.7.1 open ssh Precautions after long connection 11.8 open Pipelining 11.8.1 open Pipelining Notes after 11.8.2 open Pipelining Post implementation process 11.8.3 On and off Pipelining Efficiency comparison of 11.9 modify facts Collection behavior 11.10 Shell Hierarchical optimization: separate tasks 11.11 Third party policy plug-ins: Mitogen for Ansible 12.Give Way Ansible Safer: use Vault Encrypt 12.1 An example of getting started: creating an encrypted file 12.2 Vault ID And how to provide credential password 12.3 Encrypt existing files 12.4 The meaning of encryption protocol header 12.5 Decrypt encrypted files 12.6 modify Vault ID And credential password 12.7 Edit the contents of the encrypted file 12.8 ansible-playbook Used in tasks Vault Encrypt file 12.9 Encrypt string and embed YAML file 12.10 Speed up the process of encryption and decryption 12.11 Vault Encryption best practices 13.There are too many ants to bite Ansible: Ansible Tower 13.1 Use Ansible Pain 13.2 Ansible Tower brief introduction 13.3 install Tower 13.3.1 Installation environment configuration 13.3.2 install Tower 13.3.3 Sign in tower 13.4 Give Way Ansible Tower implement playbook 13.4.1 To configure Tower Credential 13.4.2 To configure inventory 13.4.3 Establish Project 13.4.4 Establish Template And run the task 13.5 Tower User and permission control for 14.Ansible Administration docker and openstack 14.1 Ansible Administration docker 14.1.1 Ansible Build and run Docker image 14.1.2 nothing Dockerfile Start mirroring and connect containers 14.1.3 docker inventory 14.1.4 Other Ansible Container management tools 14.2 Ansible Administration OpenStack 14.2.1 Create virtual machine 14.2.2 Dynamically add new virtual machines to inventory 14.2.3 collect OpenStack Virtual machine dynamics inventory 15.Unexpected joy: Ansible Administration Windows Host 15.1 Ansible How to manage Windows 15.2 Ansible Administration Windows Previous settings 15.3 Test for successful management Windows 15.4 Ansible implement PowerShell,CMD command 15.5 Create domain controller 15.6 Join host to domain 16.The sense of achievement comes from creation: do it yourself Ansible Modular 16.1 Introduction to custom module 16.1.1 Notice before customizing module: storage path of module 16.1.2 Before customizing modules: module requirements 16.2 Shell Script customization module(One): Hello World 16.3 Shell Script customization module(Two): Simplified edition file Modular 16.4 Python Custom module