refactor ♻️: Refactor task names and module references for clarity and consistency
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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: ''
|
||||
|
||||
Reference in New Issue
Block a user