Sudoers config and hostname config working

This commit is contained in:
2026-09-09 16:50:19 -04:00
parent 18233ebf74
commit 7090ea5585
9 changed files with 184 additions and 19 deletions
+14 -5
View File
@@ -1,4 +1,4 @@
---
# code: language=ansible
- name: Configure ssh and firewall
hosts:
@@ -7,11 +7,18 @@
become: true
pre_tasks:
- name: Set IP facts
- name: Set IPv4 facts
become: false
ansible.builtin.set_fact:
ipv4_address: "{{ query('community.dns.lookup', inventory_hostname, type='A', nxdomain_handling = 'fail') | first }}"
ipv6_address: "{{ query('community.dns.lookup', inventory_hostname, type='AAAA', nxdomain_handling = 'fail') | first }}"
ipv4_address: "{{ query('community.dns.lookup', inventory_hostname, type='A', nxdomain_handling='fail') | first }}"
- name: Set IPv6 facts
become: false
when:
- not (ipv4_only | default(false))
ansible.builtin.set_fact:
ipv6_address: "{{ query('community.dns.lookup', inventory_hostname, type='AAAA', nxdomain_handling='fail') | first }}"
- name: Install basic utilities
community.general.pacman:
@@ -22,4 +29,6 @@
update_cache: true
roles:
- sshd
# - hostname
- sudoers
# - sshd