From 111326755bd1c0480fdfdcced8d4ffb74bf402fe Mon Sep 17 00:00:00 2001 From: Francesco Antognazza Date: Mon, 17 Apr 2023 14:43:31 +0200 Subject: [PATCH] Add suggested fix for offline message in cockpit --- .../cockpit/files/10-globally-managed-devices.conf | 2 ++ roles/cockpit/tasks/main.yml | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 roles/cockpit/files/10-globally-managed-devices.conf diff --git a/roles/cockpit/files/10-globally-managed-devices.conf b/roles/cockpit/files/10-globally-managed-devices.conf new file mode 100644 index 0000000..970ba08 --- /dev/null +++ b/roles/cockpit/files/10-globally-managed-devices.conf @@ -0,0 +1,2 @@ +[keyfile] +unmanaged-devices=none diff --git a/roles/cockpit/tasks/main.yml b/roles/cockpit/tasks/main.yml index 4abaaa8..a1dc0ad 100644 --- a/roles/cockpit/tasks/main.yml +++ b/roles/cockpit/tasks/main.yml @@ -30,6 +30,20 @@ group: root mode: 0644 +# https://cockpit-project.org/faq.html#error-message-about-being-offline +- name: Allow NetworkManager to manage network interfaces + become_user: root + become: true + ansible.builtin.copy: + src: files/10-globally-managed-devices.conf + dest: /etc/NetworkManager/conf.d/ + owner: root + group: root + mode: "0644" + +- name: Set-up a dummy network interface faking internet connection + ansible.builtin.command: "nmcli con add type dummy con-name fake ifname fake0 ip4 1.2.3.4/24 gw4 1.2.3.1" + - name: Permit traffic from any IP to cockpit socket become: true community.general.ufw: