From da16ad356df18f3248a26289233416e08edaf12c Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 26 Oct 2023 21:39:43 +0200 Subject: [PATCH] 1.0.18 --- molecule/default/converge.yml | 4 -- tasks/cockpit.yml | 50 ------------------------- tasks/main.yml | 70 ++++++++++++++++++++++++++++++----- 3 files changed, 60 insertions(+), 64 deletions(-) delete mode 100644 tasks/cockpit.yml diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 5c6805d..4523e87 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -5,25 +5,21 @@ pre_tasks: # Subscription Popup - name: Create JS directory - ignore_errors: true file: path: /usr/share/javascript/proxmox-widget-toolkit state: directory - name: Create JS File - ignore_errors: true file: path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js state: touch # All APT Tasks - name: Update apt cache. - ignore_errors: true apt: update_cache: true cache_valid_time: 600 when: ansible_os_family == 'Debian' # InfluxDB / Graphite Metrics - name: Create proxmox config directory - ignore_errors: true file: path: /etc/pve state: directory diff --git a/tasks/cockpit.yml b/tasks/cockpit.yml deleted file mode 100644 index 853dca0..0000000 --- a/tasks/cockpit.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -- name: Install required system packages - ansible.builtin.package: - name: - - curl - - samba - - git - state: present - -- name: Disable Samba service - ansible.builtin.systemd: - state: stopped - enabled: false - name: smd.service - -- name: Add Debian Backports - ansible.builtin.apt_repository: - repo: deb http://deb.debian.org/debian ${VERSION_CODENAME}-backports main - state: present - -- name: Install Cockpit - ansible.builtin.apt: - name: - - cockpit - update_cache: true - cache_valid_time: 3600 - state: present - -- name: Enable Cockpit service - ansible.builtin.systemd: - state: started - enabled: true - name: cockpit.service - -- name: Download Cockpit ZFS Manager - ansible.builtin.git: - repo: https://github.com/optimans/cockpit-zfs-manager.git - dest: /tmp/cockpit-zfs-manager - -- name: Copy Cockpit ZFS Manager - ansible.builtin.copy: - src: /tmp/cockpit-zfs-manager/zfs - dest: /usr/share/cockpit - -- name: Enable Cockpit Root Login - ansible.builtin.lineinfile: - path: /etc/cockpit/disallowed-users - line: '^root' - state: absent - notify: restart-cockpit diff --git a/tasks/main.yml b/tasks/main.yml index c334599..c0df67a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,17 +16,19 @@ - name: Enable PVE no Subcription Repository block: - - ansible.builtin.get_url: + - name: Add GPG Key + get_url: url: https://enterprise.proxmox.com/debian/proxmox-release-{{ ansible_distribution_release }}.gpg dest: /etc/apt/trusted.gpg.d/proxmox-release-{{ ansible_distribution_release }}.gpg - - apt_repository: + - name: Adding Repo + apt_repository: repo: "deb http://download.proxmox.com/debian/pve {{ ansible_distribution_release }} pve-no-subscription" filename: pve-no-subscription state: present when: "enable_no_subscription_repo | bool" - name: Configure InfluxDB Metric Server - file: + copy: dest: "/etc/pve/status.cfg" content: | influxdb: @@ -36,7 +38,7 @@ when: "metrics_influx | bool" - name: Configure Graphite Metric Server - file: + copy: dest: "/etc/pve/status.cfg" content: | graphite: @@ -70,6 +72,59 @@ name: lldpd.service when: "tools_lldp | bool" +- name: Cockpit ZFS Tools Setup + block: + - name: Install required system packages + ansible.builtin.package: + name: + - curl + - samba + - git + state: present + + - name: Disable Samba service + ansible.builtin.systemd: + state: stopped + enabled: false + name: smd.service + + - name: Add Debian Backports + ansible.builtin.apt_repository: + repo: deb http://deb.debian.org/debian ${VERSION_CODENAME}-backports main + state: present + + - name: Install Cockpit + ansible.builtin.apt: + name: + - cockpit + update_cache: true + cache_valid_time: 3600 + state: present + + - name: Enable Cockpit service + ansible.builtin.systemd: + state: started + enabled: true + name: cockpit.service + + - name: Download Cockpit ZFS Manager + ansible.builtin.git: + repo: https://github.com/optimans/cockpit-zfs-manager.git + dest: /tmp/cockpit-zfs-manager + + - name: Copy Cockpit ZFS Manager + ansible.builtin.copy: + src: /tmp/cockpit-zfs-manager/zfs + dest: /usr/share/cockpit + + - name: Enable Cockpit Root Login + ansible.builtin.lineinfile: + path: /etc/cockpit/disallowed-users + line: '^root' + state: absent + notify: restart-cockpit + when: "tools_cockpit | bool" + # - name: Cleanup old Debian/PVE kernels # block: # - collect_kernel_info: @@ -78,9 +133,4 @@ # name: "{{ ['linux-image-amd64'] + _pve_kernel.old_packages }}" # state: absent # purge: yes -# when: "system_kernel_clean | bool" - -# - name: Cockpit ZFS Tools Setup -# include_tasks: -# cockpit.yaml -# when: "tools_cockpit | bool" +# when: "system_kernel_clean | bool" \ No newline at end of file