Ubuntu-Ansible-Setup/roles/squad-server/tasks/nested_servers_loop.yml
Price Hiller df62d0bbff fix: explicitly define server ids
Prior to this, server ids were set purely based on the position in the
inventory. So, if a mistake were made and a server moved up or down in
position then the associated ID would be wrong, and the wrong data would
be used against it in SquadJS's database. Furthermore, if we were to
ever change the format of how servers are in the inventory this would
cause a headache as currently server ids are calculated based on
position in the inventory. Explicitly defining them while, yes, adding
another hard coded value, avoids this headache entirely.
2023-02-03 17:52:42 -06:00

13 lines
486 B
YAML

- name: Template In Squad Server Configurations
become: true
ansible.builtin.template:
src: "{{ template_file }}"
dest: "{{ squad_server_configs_dir }}/{{ server.docker.name }}/ServerConfig/{{ template_file | basename | regex_replace('\\.j2$', '') }}"
owner: "{{ squad_server_user }}"
group: "{{ squad_server_group }}"
mode: 0644
loop_control:
loop_var: server
label: "{{ server.name }} -> {{ template_file | basename }}"
loop: "{{ squad_servers }}"