Tasks

Let's take a look at the tasks folder in the repository.

We'll cover the following

tasks folder

The tasks folder is another required in the Ansible framework. The tasks folder holds all the YAML task files that call Ansible modules. A similar folder structure to the other folders should be created for scalability and to keep tasks sorted by environment and function. The tasks in the configuration’s subfolders match one-to-one with each of the Jinja2 template files created.

This is not meant to exhaustively cover all the files created. Rather, it means to give a picture of the folder structure and samples of the types of tasks required and where to store them:

tasks
|
 ---- adhoc
      |
       ---- ios
            |
             ---- config-banner.yml
             ---- copyrunstart.yml
             ---- copyruntftp.yml
             ---- filepromptquiet.yml
             ---- iproutevrf.yml
             ---- nofilepromptquiet.yml
             ---- ospfneighbor.yml
             ---- vrfdetail.yml
 ---- audit
      |
       ---- ios
            |
             ---- ios_gather_facts.yml
             ---- ospfneighbor.yml
             ---- show-banner.yml

 ---- configurations 
      |
       ---- ios
            |
             ---- assembled-config-campus.yml
             ---- configure_ios_6k_qos.yml
             ---- configure_ios_aaa_rsa.yml
             ---- configure_ios_acls.yml
             ---- configure_ios_archive.yml
             ---- configure_ios_dhcp.yml
             ---- configure_ios_dot1x.yml
       ---- nxos
            |
             ---- assembled_config_data_center.yml
             ---- configure_nxos_dc_access.yml
             ---- configure_nxos_global.yml
             ---- configure_nxos_host_interface.yml
             ---- configure_nxos_host_port_channel.yml
             ---- configure_nxos_mgmt_interface.yml

Get hands-on with 1400+ tech skills courses.