-
Notifications
You must be signed in to change notification settings - Fork 5
HowTo: Ansible roles
hhees edited this page Jan 25, 2020
·
9 revisions
First, a general documentation about ansible is availible at docs.ansible.com
A good starting point to see how custom ansible roles are used is the apache_proxy
example role.
This role registers some apache proxy configurations to make external devices, like cameras, available behind a url path. Additionally it registers several menu entries for each device in the main WebUI.
But now, lets check which files are relevant for this custom role.
File | Example | Description |
---|---|---|
tasks/mail.yml | example | Main ansible role which defines the tasks needed to install this feature. |
templates | Folder which contains all additional files like images, configs etc. They are referenced/copied by the ansible tasks defined in the main.yml file. | |
templates/etc/apache2/_.ansible.conf.d/proxy.conf | example | Apache config with proxy definitions. |
templates/webui/proxy.js | example | Javascript file which creates the menu entries. To know more about it, check How to register a menu entry in the webui |
templates/webui/proxy.de.json | example | Translations which are used for the menu entries |
Finally, the role must be included in the file config/myserver/roles.yml
example (last line).
- Home
- Motivation
- Main Features
- How to start
- Configuration
- Examples
- Special Roles