refactor ♻️: Refactor task names and module references for clarity and consistency
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 11s
Gitleaks Scan / gitleaks (push) Successful in 4s
Markdown Lint / markdown-lint (push) Failing after 4s

This commit refactors task names across multiple files to improve clarity and maintain consistency, ensuring that each task name accurately reflects its purpose and using the latest `ansible.builtin` modules where applicable.
This commit is contained in:
2026-02-07 08:45:57 +01:00
parent 07686643bd
commit 3d018fd178
6 changed files with 28 additions and 28 deletions

View File

@@ -2,14 +2,14 @@
# ansible_role_proxmox_provision/handlers/main.yml
# Handlers for role
# ==================
- name: apt update
apt:
- name: Run apt update
ansible.builtin.apt:
update_cache: yes
- name: restart pveproxy
systemd:
- name: Restart pveproxy
ansible.builtin.systemd:
name: pveproxy
state: restarted
- name: reload systemd
command: systemctl daemon-reexec
- name: Reload systemd
ansible.builtin.command: systemctl daemon-reexec

View File

@@ -1,6 +1,6 @@
---
- name: Configure Proxmox logrotate limits
template:
- name: logrotate | Configure Proxmox logrotate limits
ansible.builtin.template:
src: logrotate-pve.j2
dest: /etc/logrotate.d/proxmox
owner: root

View File

@@ -1,21 +1,21 @@
---
- name: Install powertop
apt:
- name: powertop | Install powertop
ansible.builtin.apt:
name: powertop
state: present
update_cache: yes
when: proxmox_enable_powertop
- name: Create powertop systemd service
template:
- name: powertop | Create powertop systemd service
ansible.builtin.template:
src: powertop.service.j2
dest: /etc/systemd/system/powertop.service
mode: "0644"
when: proxmox_enable_powertop
notify: reload systemd
- name: Enable and start powertop service
systemd:
- name: powertop | Enable and start powertop service
ansible.builtin.systemd:
name: powertop
enabled: true
state: started

View File

@@ -1,14 +1,14 @@
---
- name: Remove enterprise repo files (all known locations)
file:
- name: repos | Remove enterprise repo files (all known locations)
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop:
- /etc/apt/sources.list.d/pve-enterprise.list
- /etc/apt/sources.list.d/ceph.list
- name: Enable Proxmox no-subscription repo
copy:
- name: repos | Enable Proxmox no-subscription repo
ansible.builtin.copy:
dest: /etc/apt/sources.list.d/pve-no-subscription.list
content: |
deb http://download.proxmox.com/debian/pve {{ ansible_distribution_release }} pve-no-subscription

View File

@@ -1,14 +1,14 @@
---
- name: Remove subscription nag (legacy proxmoxlib.js)
replace:
- name: subscription | Remove subscription nag (legacy proxmoxlib.js)
ansible.builtin.replace:
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
regexp: "if \\(data.status !== 'Active'\\)"
replace: "if (false)"
ignore_errors: true
notify: restart pveproxy
- name: Remove subscription nag (minified bundle for VE 8/9)
replace:
- name: subscription | Remove subscription nag (minified bundle for VE 8/9)
ansible.builtin.replace:
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js
regexp: "data.status!=='Active'"
replace: "false"

View File

@@ -1,20 +1,20 @@
---
- name: Set vm.swappiness
sysctl:
- name: swap | Set vm.swappiness
ansible.posix.sysctl:
name: vm.swappiness
value: "{{ proxmox_swapiness }}"
state: present
reload: yes
- name: Disable swap if host has enough RAM
command: swapoff -a
- name: swap | Disable swap if host has enough RAM
ansible.builtin.command: swapoff -a
when:
- proxmox_disable_swap
- ansible_memtotal_mb >= proxmox_min_ram_mb_for_no_swap
changed_when: false
- name: Remove swap from fstab
replace:
- name: swap | Remove swap from fstab
ansible.builtin.replace:
path: /etc/fstab
regexp: '^\S+\s+\S+\s+swap\s+.*$'
replace: ''