Chapter 5 Repository Structure
For diagrams, tables, or exact code formatting, .
Chapter 5 Repository Structure
“The organization of information actually creates new information.” - Richard Saul Wurman Organization of the repository includes a combination of necessary Ansible framework files and folders as well as user defined files and folders. Create a repository that scales, is easily navigated, and supports the Ansible framework. This should be the first step after creating the environment specific repository in Microsoft TFS. Build the folder structure that best reflects the environment being automated.
Go to TFS. Create a new “Work Item”. Name it initial_repo_config. Move it to “Active”. Clone the repository locally onto the development workstation with VS Code installed. git clone <TFS repository link> Build the structure using empty folders and empty placeholder files that suit the environment. Build a repository suitable for an enterprise campus environment comprised of Cisco Catalyst devices running IOS, and an enterprise data center consisting of Cisco Nexus devices running NX-OS. Remember there are many Ansible modules available from other vendors if not running a Cisco network.
* Important note *: Git will not track or provide version control for empty folders. When creating each folder in the repository create an empty file called .gitignore. This ensures the folder structure ends up in the repository. If this file is not created and the folder is left empty the folder will not end up in the repository until a file is present. Once files are added to these folders the .gitignore file can be deleted.
More information regarding .gitignore can be found here:
https://git-scm.com/docs/gitignore/
Create the base folder structure, hosts.ini and a README.md file.
configuration
documentation
filter_plugins
group_vars
host_vars
playbooks
tasks
templates
hosts.ini
README.md