Hi Juraj.
yourrole/
tasks/
main.yml
hostname1.yml
hostname2.yml
hostnameN.yml
files/
hostname1.config
hostname2.config
hostnameN.config
templates/
hostname1.yml.j2
hostname2.yml.j2
hostnameN.yml.j2
In proposed structure only tasks/main.yml file is necessary.
Other files may depends on your needs and might not be included.
In tasks/main.yml you may use something like this:
- name: Copy configuration for host
copy:
src: "{{ inventory_hostname }}"
dest: /destination_folder_of your config
backup: yes
force: no
or this:
template:
src: "{{ inventory_hostname }}"
dest: /destination_folder_of your config
backup: yes
force: no
or this:
- name: Import task with host-specific configuration
import_tasks: "{{ inventory_hostname }}.yml"
This is only example describe one of many possible options, without additional details.
Configuration may depends not on hostname, but on other facts, defined by
setup module.
Hope it will helps. If you'll need additional details, feel free to ask and attach please some additional details of necessary configuration.
Regards,
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.