Cleverer loop

This commit is contained in:
Wojciech Kozlowski 2022-12-20 18:56:02 +01:00
parent 59c5f5a17d
commit 4ec9d5ef96

View File

@ -7,10 +7,10 @@
ansible.builtin.lineinfile:
path: "/etc/hosts"
line: "127.0.0.1 {{ item }}"
loop:
- "{{ system_mail_smtp_server }}"
- "{{ vpn_wireguard_server_address | default('localhost') }}"
- "{{ services_backups_restic_aws_bucket_endpoint | default('localhost') }}"
loop: "{{ [system_mail_smtp_server | default([])] |
union( [vpn_wireguard_server_address | default([])] ) |
union( [services_backups_restic_aws_bucket_endpoint | default([])] ) |
flatten }}"
when: not (the_nine_worlds_production | bool)
tags: "always"