Guest User

Ansible Cisco Play

a guest
May 29th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.52 KB | None | 0 0
  1. ---                                                                                                                            
  2. - hosts: "{{ host }}"                                                                                                          
  3.   connection: local                                                                                                            
  4.                                                                                                          
  5.   tasks:                                                                                                                      
  6.                                                                                                                                
  7.   - name: Define Provider                                                                                                      
  8.     set_fact:                                                                                                                  
  9.       cli:                                                                                                                    
  10.         host: "{{ ansible_host }}"                                                                                              
  11.         username: "{{ username }}"                                                                                              
  12.         password: "{{ pass }}"                                                                                                  
  13.                                                                                                                                
  14.   - name: Gather facts                                                                                                          
  15.     register: iosfacts_out                                                                                                      
  16.     ios_facts:                                                                                                                
  17.       gather_subset:                                                                                                          
  18.         - "!config"                                                                                                            
  19.       provider: "{{ cli }}"                                                                                                    
  20.   - copy: content="{{ iosfacts_out | to_nice_yaml }}" dest="~/ansiblecz/facts/{{ inventory_hostname }}_iosfacts.yml"
Add Comment
Please, Sign In to add comment