Infra/ansible/roles/proxmox/tasks/main.yml

35 lines
848 B
YAML
Raw Normal View History

2022-10-18 22:15:55 +02:00
# - name: Get users
# become: "{{ do_become }}"
# command:
# argv:
# - pvesh
# - get
# - /access/users
# - --output-format=json
# register: pve_users
2022-04-15 15:51:58 +02:00
2022-10-18 22:15:55 +02:00
# - name: Create users
# when: item.username not in (pve_users.stdout | from_json | community.general.json_query('[*].userid') |replace("@pam", ""))
# include_tasks: create_user.yml
# loop: "{{ users | selectattr('system', 'contains', 'proxmox') | flatten(levels=1) }}"
2022-04-15 15:51:58 +02:00
- name: Disable SWAP sysctl on host
become: true
ansible.posix.sysctl:
name: vm.swappiness
value: "0"
state: present
- name: Disable SWAP on host
become: true
ansible.builtin.command: swapoff -a
- name: Remove swapfile from /etc/fstab on host
become: true
ansible.posix.mount:
name: "{{ item }}"
fstype: swap
state: absent
with_items:
- swap