From 8b87fe69c86987d373f32bec45c479d8cc4aeeef Mon Sep 17 00:00:00 2001
From: Sheogorath <sheogorath@shivering-isles.com>
Date: Tue, 3 Nov 2020 18:46:45 +0100
Subject: [PATCH] cockpit: Add basic cockpit role

This role deploys a basic cockpit setup to all hosts and allows to
connect from a local cockpit instance via SSH to all hosts and manage
them using the web interface instest of SSH into them manually.

This was a first experiment, I'm not really happy with the results, but
I might revisit it in the future. Don't expect this to be merged any
time soon.
---
 cockpit.yml                  |  4 ++++
 roles/cockpit/meta/main.yml  | 14 ++++++++++++++
 roles/cockpit/tasks/main.yml | 33 +++++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 cockpit.yml
 create mode 100644 roles/cockpit/meta/main.yml
 create mode 100644 roles/cockpit/tasks/main.yml

diff --git a/cockpit.yml b/cockpit.yml
new file mode 100644
index 00000000..997835b4
--- /dev/null
+++ b/cockpit.yml
@@ -0,0 +1,4 @@
+---
+- hosts: all
+  roles:
+    - cockpit
diff --git a/roles/cockpit/meta/main.yml b/roles/cockpit/meta/main.yml
new file mode 100644
index 00000000..cacfdeef
--- /dev/null
+++ b/roles/cockpit/meta/main.yml
@@ -0,0 +1,14 @@
+galaxy_info:
+  author: Christoph Kern
+  description: Installs EPEL repository
+  license: GPL-3.0-only
+
+  min_ansible_version: 2.4
+  platforms:
+    - name: CentOS
+      versions:
+        - 7
+
+  galaxy_tags: []
+
+dependencies: []
diff --git a/roles/cockpit/tasks/main.yml b/roles/cockpit/tasks/main.yml
new file mode 100644
index 00000000..b4f7bc56
--- /dev/null
+++ b/roles/cockpit/tasks/main.yml
@@ -0,0 +1,33 @@
+---
+
+# Shivering-Isles Infrastructure
+# Ansible instructions to deploy the infrastructure for the Shivering-Isles
+# Copyright (C) 2019-2020  Christoph (Sheogorath) Kern
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, version 3 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+- name: Install Cockpit
+  yum:
+    name: "{{ packages }}"
+    state: absent
+  become: true
+  vars:
+    packages:
+      - cockpit
+      - cockpit-docker
+
+- name: Enable socket activation
+  systemd:
+    name: cockpit.socket
+    enabled: true
+  become: true
-- 
GitLab