This section contains a complete description of how to set up of the SDM-framework. Before you start to do this, please install all dependencies. An installation guide for Ansible can be found here: Installing Ansible, Git and Co.
The configuration is very simple and can be descripted in only 7 steps:
Step 1: Install the SDM plugin collections.
$ ansible-galaxy collection install git+https://gitlab.mn.tu-dresden.de/sdm/sdm.oor.git
$ ansible-galaxy collection install git+https://gitlab.mn.tu-dresden.de/sdm/sdm.common.git
Step 2: Create the the directory layout based on the suggestion of the directory manangment of this documentation [2].
$ # create the root directory for the SDM framework
$ mkdir ~/sdm
$ # change into it
$ cd ~/sdm
$ # initial main Git repository
$ git init
$ # create all directories of the main Git repository
$ mkdir -p host_vars group_vars files keystore/{passwords,sshkeys,certificates} roles
$ # adding library, playbooks and plugins repositories
$ git submodule add https://gitlab.mn.tu-dresden.de/sdm/playbooks.git
Step 3: Create the SDM main public and private SSH key.
If you have these keys within the directory ~/.ssh:
$ cp -a ~/.ssh/id_rsa ~/sdm/keystore/sshkeys/ansible
$ cp -a ~/.ssh/id_rsa.pub ~/sdm/keystore/sshkeys/ansible.pub
If you do not have one of these keys within the directory ~/.ssh:
$ ssh-keygen -b 4096 -t rsa -m PEM -f ~/sdm/keystore/sshkeys/ansible
$ mkdir -p ~/.ssh
$ cp -a ~/sdm/keystore/sshkeys/ansible ~/.ssh/id_rsa
$ cp -a ~/sdm/keystore/sshkeys/ansible.pub ~/.ssh/id_rsa.pub
Step 4: Create the Ansible configuration in file ~/sdm/ansible.cfg
.
[defaults]
interpreter_python = auto_silent
roles_path = ~/sdm/roles
inventory = ~/sdm/inventory
callback_whitelist = sdm.oor.sdmoor
stdout_callback = sdm.oor.sdmdefault
vars_plugins_enabled = sdm.common.sdm_host_group_vars
jinja2_extensions = jinja2.ext.do
Step 5: Create inventory file ~/sdm/inventory
localhost ansible_connection=local
Step 6: Adjust all additional settings for:
~/sdm/group_vars/all
(e.g. global network settings)~/sdm/group_vars/<group name>
(e.g. operation system)~/sdm/host_vars/<host name>
(e.g. host-specific network settings like IP address(es))Step 7: Adding SDM/Ansible roles
$ git submodule add https://gitlab.mn.tu-dresden.de/sdm/function.git roles/function
$ git submodule add https://gitlab.mn.tu-dresden.de/sdm/system.git roles/system
$ git submodule add https://gitlab.mn.tu-dresden.de/sdm/package.git roles/package
...