- name: apt
  become: true
  apt:
    update_cache: true
    name: curl,wget,git,vim,sudo,byobu,iftop,iotop,build-essential,p7zip-full,p7zip-rar,xclip,astyle,tcpdump,rsync,htop,locales,mtr,dnsutils,net-tools,traceroute,tar,unzip,iperf,iperf3,nmap,mosh,subversion,nfs-common,fish,haveged,iptables,ipset,iproute2,python3-setuptools,python3-dev,python3-pip,wireguard-tools
- name: ctags in old Ubuntu
  become: true
  apt:
    name: exuberant-ctags
  when: ansible_distribution == 'Ubuntu' and ansible_distribution_release != 'focal'
- name: remove old ctags
  become: true
  apt:
    name: exuberant-ctags
    state: absent
    purge: true
    autoremove: true
  when: ansible_distribution == 'Debian' or ansible_distribution_release == 'focal'
- name: ctags in new Ubuntu and Debian
  become: true
  apt:
    name: universal-ctags
  when: ansible_distribution == 'Debian' or ansible_distribution_release == 'focal'
- name: non-focal packages
  become: true
  apt:
    name: python-setuptools,python-dev,python-pip
  when: ansible_distribution_release != 'focal' and ansible_distribution_release != 'sid'
- name: focal packages
  become: true
  apt:
    name: python-is-python3
  when: ansible_distribution_release == 'focal'
- name: pve kernel header
  become: true
  apt:
    name: 'pve-headers-{{ansible_kernel}},ifupdown2'
  when: ansible_kernel.endswith("-pve")
- name: open-vm-tools
  become: true
  apt:
    name: open-vm-tools
    state: '{{vm_agents_status}}'
  when: ansible_virtualization_role == "guest" and ansible_virtualization_type == "VMware"
- name: qemu-guest-agent
  become: true
  apt:
    name: qemu-guest-agent
    state: '{{vm_agents_status}}'
  when: ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm"
- name: apt autoremove
  become: true
  apt:
    autoremove: true
