Chapter 5 Repository Structure

For diagrams, tables, or exact code formatting, .

JOHN W. CAPOBIANCOPRINTED PAGE 89
| 
       ---- ios 
            | 
             ---- assembled_config_campus.yml 
             ---- configure_ios_6k-qos.yml 
             ---- configure_ios_aaa_rsa.yml 
             ---- (a matching .yml file for each Template created) 
       ---- nxos 
            | 
             ---- assembled_config_dc.yml 
             ---- configure_nxos_qos.yml 
       ---- big_ip 
 
The full list of templates is available in the Git repository. 
 
Templates

The templates folder is part of the Ansible framework and is where Jinja2 dynamic template files are kept. Like all the other folders, templates should be structured to scale and organized logically. In the example there are three top level folders: banner, configurations, and documentation. These folders will have subfolders by platform, such as IOS or NXOS. The banner folder is a simple text file that contains the standard banner displayed on all devices when a user logs into the CLI. The configurations folder contains all the dynamic templates used to generate device configurations. The documentation folder contains the templates used to generate the Markdown automated documentation. These templates have a matching YAML file in the tasks folder that includes the module used to compile the commands:

templates 
| 
 ---- banner 
      | 
      ---- standard_banner.cfg 
 ---- configurations 
      | 
       ---- ios  
            | 
             ---- 01_IOS_global.j2 
             …  
             ---- 35_IOS_Netflow.j2 
       ---- nxos  
            | 
             ---- 01_NXOS_global.j2 
             …  
             ---- 35_NXOS_Netflow.j2 
 ---- documentation 
      | 
       ---- ios 
            | 
             ---- Access_documentation.j2 
             ---- Core_documentation.2 
             ---- Distribution_documentation.j2 
       ---- nxos 
            | 
             ---- 7k_documentation.j2 
             ---- 5k_documentation.j2