86 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
			
		
		
	
	
			86 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
| ---
 | |
| - name: 恢复客户端节点的/etc/hosts文件
 | |
|   hosts: nomad_clients
 | |
|   become: yes
 | |
|   
 | |
|   tasks:
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.116\\.158\\.95\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.81\\.26\\.3\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.103\\.147\\.94\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.90\\.159\\.68\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.86\\.141\\.112\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.98\\.209\\.50\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.120\\.225\\.29\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.117\\.106\\.136\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.116\\.80\\.94\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.116\\.112\\.45\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.97\\.62\\.111\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 删除添加的主机名解析条目
 | |
|       lineinfile:
 | |
|         path: /etc/hosts
 | |
|         regexp: "^100\\.122\\.197\\.112\\s"
 | |
|         state: absent
 | |
|     
 | |
|     - name: 显示恢复后的/etc/hosts文件内容
 | |
|       command: cat /etc/hosts
 | |
|       register: hosts_content
 | |
|       changed_when: false
 | |
|     
 | |
|     - name: 显示/etc/hosts文件内容
 | |
|       debug:
 | |
|         var: hosts_content.stdout_lines |