Sudoers config and hostname config working
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user