Directory Layout

The content on this site is outdated and will be revised.

The parent directory of the SDM framework contains files and directories in the similary way to the directory layout described in Best Practice of Ansible documentation [1]. But there are some differences between the layout of the SDM framework and the Best Practice suggestion of the Ansible documentation. This section shows how the directory layout of the framework looks. It also contains suggestions for the managment of this.

The SDM directory layout

The directory layout for the SDM framework looks like this:

ansible.cfg         # configuration of Ansible
inventory           # inventory file
host_vars/          # host specific variables
group_vars/         # group specific variables
files/	            # user-defined files and templates
keystore/           # parent directory for credentials, keys and certificates
   passwords/       # passwords
   sshkeys/         # public and private SSH keys
   certificates/    # SSL certificates 
library/            # directory for SDM specific and custom modules
playbooks/          # playbooks of the SDM framework 
plugins/            # parent directory of SDM specific and custom plugins
   connection/      # connection plugins
   filter/          # filter plugins
   lookup/          # lookup plugins
roles/              # parent directory of SDM roles

The directories files and keystore are SDM-specific and must be created in addition to the Best Practice suggestion of the Ansible documentation. In addition to this the roles-directory defines an own structure. More about are found here: The path to the parent directory of this directory structure is referred to throughout the documentation as the ansible directory.

Configuration of the directory paths

The configuration for accessing the different directories is divided into two parts: The configuration of Ansible-specific settings and the setting of variables that can be used within roles and playbooks.

The Ansible-specific settings includes the search paths for libraries, plugins and roles inside the ansible directory. This settings are done in the file <ansible directory>/ansible.cfg and looks like so:

library=<ansible directory>/library
filter_plugins = <ansible directory>/plugins/filter
lookup_plugins = <ansible directory>/plugins/lookup
connection_plugins=<ansible directory>/plugins/connection
roles_path=<ansible directory>/roles
inventory=<ansible directory>/inventory

In order for the ansible directory to be a variable path, it is necessary to define variables which refer to the SDM-specific directories files and keystore. These variable are defined and assigned in the file <ansible directory>/group_vars/all and looks like so:

ansible_root: "{{ '<ansible directory>' | expanduser }}"
ansible_keystore: "{{ ansible_root + '/keystore' }}"
ansible_passwords: "{{ ansible_keystore + '/passwords' }}"
ansible_sshkeys: "{{ ansible_keystore + '/sshkeys' }}"
ansible_certificates: "{{ ansible_keystore + '/certificates' }}"
ansible_customfiles: "{{ ansible_root + '/files' }}"

Directory management

The management of above shown directory structure depends on many facts:

This questions must be clarify by the end user(s) before they start working with the SDM. One suggestion is to split the descriped directory layout into several parts and manage them with the VCS Git and submodules.

The main Git repository should be a private repository with following components:

Submodule repositories can be public and comprise following components: