Hello Ansible users,
I made a tool based on Salt Stack, a deployment tool like Ansible.
This tool, Banquise, is made to deploy groups of serveurs (clusters, HPC clusters) and groups of workstations.
Someone asked me if it would be possible to propose an Ansible version of this tool, but I don't master Ansible as Salt, so I would like to know if some things are possible in Ansible.
To understand the Banquise tool:
Basically, sys admin define it's nodes into files with the following structure: type > group > node.
Then, sys admin can deploy management server and maintain it using Salt commands. All services (dhcp, dns, etc) will be installed on management nodes, and configuration files generated on the fly. Same for client side on nodes.
For example, the dhcpd.conf file contains:
| {% for type in salt['pillar.get']('core:types') %} |
| ############################################# |
| {% for group, argu in salt['pillar.get'](type, {}).items() %} |
| {%- for host, argo in argu.items() %} |
| {%- for network, args in argo.network.items() %} |
| {%- if network == "net0" %} |
| hardware ethernet {{ args.hwaddr }}; |
| fixed-address {{ args.ip }}; |
| {%- if argo.bmc is defined %} |
| hardware ethernet {{ argo.bmc.hwaddr }}; |
| fixed-address {{ argo.bmc.ip }}; |
{% endfor %}
It iterates on types, then on groups, then add each node and if present add also BMC of nodes.
My questions are the following:
1. Can I use Jinja rendering directly into Ansible data files (inventories ?) ? This allows me in Banquise to generate new data deduced from the ones provided by the sys admin, and also automate some tasks, and gather data from multiple Pillars to create ready to use data. Also, it allows me to choose my structure instead of being stuck to the Salt structure.
2. Can I use structured files like YAML for inventories in Ansible ? Because each host has a lot of parameters, this allows me to structure all of these data. For what I found in Ansible documentation, inventories put all data on the same line.
3. Can I create a hierarchy like types > groups > nodes in Inventories ?
I have other questions, but these are the first ones I would like to ask :-)
My apologies for this very large question, it is just impossible do cover what can be done by a tool like Ansible in just a few hours...
With my best regards
Ox