diff --git a/coreos-config/playbook.yaml b/coreos-config/playbook.yaml index 418c283..4a1bc43 100644 --- a/coreos-config/playbook.yaml +++ b/coreos-config/playbook.yaml @@ -8,6 +8,9 @@ wait_for_connection: timeout: 300 sleep: 10 + - name: gather facts + ansible.builtin.setup: + gather_subset: all - name: Common ansible.builtin.import_playbook: plays/common.yaml diff --git a/coreos-config/plays/services/search/limiter.toml b/coreos-config/plays/services/search/limiter.toml index 364d1e5..0a3e725 100644 --- a/coreos-config/plays/services/search/limiter.toml +++ b/coreos-config/plays/services/search/limiter.toml @@ -32,7 +32,7 @@ block_ip = [ pass_ip = [ {% for host in groups['monitoring'] %} - '{{ hostvars[host].ansible_host }}', # Monitoring + '{{ hostvars[host].ansible_default_ipv4.address }}', # Monitoring {% endfor %} # '192.168.0.0/16', # IPv4 private network # 'fe80::/10' # IPv6 linklocal / wins over botdetection.ip_limit.filter_link_local diff --git a/coreos-config/plays/vps.yaml b/coreos-config/plays/vps.yaml index b3dfaa0..d2fa31a 100644 --- a/coreos-config/plays/vps.yaml +++ b/coreos-config/plays/vps.yaml @@ -1,8 +1,17 @@ - name: Setup VPS hosts: host.nc.chaoswg.org + gather_facts: false vars: state: running base_domain: "tobiasmanske.de" + pre_tasks: + - name: Gather facts from all hosts + setup: {} + delegate_to: "{{ item }}" + when: hostvars[item]['ansible_default_ipv4'] is not defined + tags: + - always + loop: "{{ groups['all'] }}" roles: - {role: compose_project, service: traefik, with_fa: true} - {role: compose_project, service: registry} @@ -26,3 +35,5 @@ - {role: compose_project, service: diun} - {role: compose_project, service: watchtower} - {role: compose_project, service: wkd} + +# vim: ft=yaml.ansible