aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2024-11-03 17:13:56 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2024-11-03 17:13:56 +0100
commit8ceb4bbe219230a7e8297f7bd78c141202454dba (patch)
treec7b8c5b8f64c061d86cb2a41711d7afe989f2965 /ansible
parent9fc7d5ed1a8a31bd0ddcba0568c8acc280ee5021 (diff)
downloadinfra-8ceb4bbe219230a7e8297f7bd78c141202454dba.tar.gz
infra-8ceb4bbe219230a7e8297f7bd78c141202454dba.tar.bz2
infra-8ceb4bbe219230a7e8297f7bd78c141202454dba.tar.xz
infra-8ceb4bbe219230a7e8297f7bd78c141202454dba.zip
unifi
Diffstat (limited to 'ansible')
-rw-r--r--ansible/group_vars/all/ipam.yml4
-rw-r--r--ansible/host_vars/unifi/systemd-networkd.yml2
-rw-r--r--ansible/plays/host-unifi.yml18
-rw-r--r--ansible/plays/templates/unifi/systemd-networkd/enp1s0.network8
-rw-r--r--ansible/roles/superusers/tasks/main.yml2
-rw-r--r--ansible/roles/unifi/handlers/main.yml3
-rw-r--r--ansible/roles/unifi/tasks/main.yml23
-rw-r--r--ansible/unifi.yml6
8 files changed, 29 insertions, 37 deletions
diff --git a/ansible/group_vars/all/ipam.yml b/ansible/group_vars/all/ipam.yml
index 0430803..54fc444 100644
--- a/ansible/group_vars/all/ipam.yml
+++ b/ansible/group_vars/all/ipam.yml
@@ -48,10 +48,6 @@ ipam6:
conflatorio: "fdb1:4242:3538:2008:8042:32ff:fe0c:7161"
danneri: "fdb1:4242:3538:2008:9422:d355:95b7:f170"
unifi: "fdb1:4242:3538:2008:5054:ff:fe4d:96c"
- danneri_cluster:
- range: "fdb1:4242:3538:2009::/64"
- danneri_service:
- range: "fdb1:4242:3538:2010::/64"
k8s:
range: "fdb1:4242:3538:3000::/52"
diff --git a/ansible/host_vars/unifi/systemd-networkd.yml b/ansible/host_vars/unifi/systemd-networkd.yml
new file mode 100644
index 0000000..4ee9ee6
--- /dev/null
+++ b/ansible/host_vars/unifi/systemd-networkd.yml
@@ -0,0 +1,2 @@
+systemd_networkd__files:
+ - unifi/systemd-networkd/enp1s0.network
diff --git a/ansible/plays/host-unifi.yml b/ansible/plays/host-unifi.yml
new file mode 100644
index 0000000..41fb292
--- /dev/null
+++ b/ansible/plays/host-unifi.yml
@@ -0,0 +1,18 @@
+- hosts:
+ - unifi
+ tasks:
+ - become: yes
+ apt:
+ name:
+ - etckeeper
+
+ - import_role:
+ name: timezone
+
+ - import_role:
+ name: systemd-networkd
+
+ - become: yes
+ apt:
+ name:
+ - docker.io
diff --git a/ansible/plays/templates/unifi/systemd-networkd/enp1s0.network b/ansible/plays/templates/unifi/systemd-networkd/enp1s0.network
new file mode 100644
index 0000000..251bf45
--- /dev/null
+++ b/ansible/plays/templates/unifi/systemd-networkd/enp1s0.network
@@ -0,0 +1,8 @@
+[Match]
+Name=enp1s0
+
+[Network]
+DHCP=ipv4
+
+[IPv6AcceptRA]
+Token=static:{{ ipam6.networks.lhn2_dn42.hosts.unifi }}
diff --git a/ansible/roles/superusers/tasks/main.yml b/ansible/roles/superusers/tasks/main.yml
index c1f5a47..12672ec 100644
--- a/ansible/roles/superusers/tasks/main.yml
+++ b/ansible/roles/superusers/tasks/main.yml
@@ -16,7 +16,7 @@
unix_groups:
- sudo
- systemd-journal
- with_items: "{{ unix_groups }}"
+ with_items: "{{ unix_groups + (['docker'] if 'docker' in getent_group else []) }}"
loop_control:
loop_var: group
include_tasks: adjust-group.yml
diff --git a/ansible/roles/unifi/handlers/main.yml b/ansible/roles/unifi/handlers/main.yml
deleted file mode 100644
index ce78323..0000000
--- a/ansible/roles/unifi/handlers/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-- name: update apt cache
- apt:
- update_cache: yes
diff --git a/ansible/roles/unifi/tasks/main.yml b/ansible/roles/unifi/tasks/main.yml
deleted file mode 100644
index 11c4c00..0000000
--- a/ansible/roles/unifi/tasks/main.yml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-- name: Ubiquiti APT key
- notify: update apt cache
- apt_key:
- id: 06E85760C0A52C50
- keyserver: keyserver.ubuntu.com
-
-- name: Ubiquiti APT repository
- notify: update apt cache
- copy:
- dest: /etc/apt/sources.list.d/unifi.list
- content: 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti'
-
-- meta: flush_handlers
-
-- name: packages
- apt:
- name: "{{ items }}"
- install_recommends: no
- vars:
- items:
- - openjdk-8-jre
- - unifi
diff --git a/ansible/unifi.yml b/ansible/unifi.yml
deleted file mode 100644
index d417a2a..0000000
--- a/ansible/unifi.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-- hosts:
- - unifi
- roles:
- - role: unifi
- tags: unifi
- become: yes