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 # ansible_role_proxmox_provision/handlers/main.yml
# Handlers for role # Handlers for role
# ================== # ==================
- name: apt update - name: Run apt update
apt: ansible.builtin.apt:
update_cache: yes update_cache: yes
- name: restart pveproxy - name: Restart pveproxy
systemd: ansible.builtin.systemd:
name: pveproxy name: pveproxy
state: restarted state: restarted
- name: reload systemd - name: Reload systemd
command: systemctl daemon-reexec ansible.builtin.command: systemctl daemon-reexec

View File

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

View File

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

View File

@@ -1,14 +1,14 @@
--- ---
- name: Remove enterprise repo files (all known locations) - name: repos | Remove enterprise repo files (all known locations)
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: absent state: absent
loop: loop:
- /etc/apt/sources.list.d/pve-enterprise.list - /etc/apt/sources.list.d/pve-enterprise.list
- /etc/apt/sources.list.d/ceph.list - /etc/apt/sources.list.d/ceph.list
- name: Enable Proxmox no-subscription repo - name: repos | Enable Proxmox no-subscription repo
copy: ansible.builtin.copy:
dest: /etc/apt/sources.list.d/pve-no-subscription.list dest: /etc/apt/sources.list.d/pve-no-subscription.list
content: | content: |
deb http://download.proxmox.com/debian/pve {{ ansible_distribution_release }} pve-no-subscription 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) - name: subscription | Remove subscription nag (legacy proxmoxlib.js)
replace: ansible.builtin.replace:
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
regexp: "if \\(data.status !== 'Active'\\)" regexp: "if \\(data.status !== 'Active'\\)"
replace: "if (false)" replace: "if (false)"
ignore_errors: true ignore_errors: true
notify: restart pveproxy notify: restart pveproxy
- name: Remove subscription nag (minified bundle for VE 8/9) - name: subscription | Remove subscription nag (minified bundle for VE 8/9)
replace: ansible.builtin.replace:
path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js path: /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.min.js
regexp: "data.status!=='Active'" regexp: "data.status!=='Active'"
replace: "false" replace: "false"

View File

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