Adapt hosts for testing

This commit is contained in:
Wojciech Kozlowski 2022-12-28 21:17:33 +01:00
parent 2d38001c6e
commit ddef2e7651

View File

@ -6,7 +6,10 @@
- name: "block domains"
ansible.builtin.lineinfile:
path: "/etc/hosts"
line: "127.0.0.1 {{ item }}"
line: "{{ address }} {{ item }}"
vars:
- address: "{{ hostvars[item.split('.')[0]].ansible_default_ipv4.address |
default('127.0.0.1') }}"
loop: "{{ [system_mail_smtp_server | default([])] |
union( [vpn_wireguard_server_address | default([])] ) |
union( [services_backups_restic_aws_bucket_endpoint | default([])] ) |