summaryrefslogtreecommitdiff
path: root/roles/common/tasks
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2026-05-05 13:20:34 -0400
committerFreya Murphy <freya@freyacat.org>2026-05-05 13:20:34 -0400
commiteacc69b26ea680e3a1e6fd9abb2ac73e6800a890 (patch)
treea216e8d868377ce94cbdead2a897bedd95a235de /roles/common/tasks
parentremove deprecated var (diff)
downloadansible-eacc69b26ea680e3a1e6fd9abb2ac73e6800a890.tar.gz
ansible-eacc69b26ea680e3a1e6fd9abb2ac73e6800a890.tar.bz2
ansible-eacc69b26ea680e3a1e6fd9abb2ac73e6800a890.zip
add network configuration
Diffstat (limited to 'roles/common/tasks')
-rw-r--r--roles/common/tasks/caddy.yml2
-rw-r--r--roles/common/tasks/main.yml1
-rw-r--r--roles/common/tasks/network.yml11
3 files changed, 13 insertions, 1 deletions
diff --git a/roles/common/tasks/caddy.yml b/roles/common/tasks/caddy.yml
index 3d2541e..026d9f0 100644
--- a/roles/common/tasks/caddy.yml
+++ b/roles/common/tasks/caddy.yml
@@ -37,7 +37,7 @@
- name: Ensure Caddy log file exists
file:
path: /var/log/caddy.log
- state: touch
+ state: file
owner: caddy
group: caddy
mode: '0664'
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index 74088a6..131431a 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -1,5 +1,6 @@
# baseline
- import_tasks: packages.yml
+- import_tasks: network.yml
- import_tasks: certs.yml
# programs
diff --git a/roles/common/tasks/network.yml b/roles/common/tasks/network.yml
new file mode 100644
index 0000000..01277c2
--- /dev/null
+++ b/roles/common/tasks/network.yml
@@ -0,0 +1,11 @@
+- name: Set system hostname
+ hostname:
+ name: "{{ net_hostname | default(inventory_hostname) }}"
+
+- name: Configure interfaces
+ template:
+ src: interfaces.j2
+ dest: /etc/network/interfaces
+ owner: root
+ group: root
+ mode: '0644'