- name: apt-get update
  apt:
    update_cache: yes
    cache_valid_time: 300
  ignore_errors: True

- name: install basic packages
  apt: name={{ item }} state=present
  with_items:
      - aptitude
      - curl
      - hdparm
      - heirloom-mailx
      - iftop
      - iotop
      - lsof
      - ncdu
      - netcat
      - openssl
      - screen
      - smartmontools
      - sysstat
      - telnet
      - tmux
      - unzip
      - vim
      - virt-what
      - wget

- name: install additional packages
  apt: name={{ item }} state=present
  with_items:
      - aria2
      - atop
      - bc
      - byobu
      - git
      - htop
      - iperf
      - linux-tools
      - lshw
      - mosh
      - netdiag
      - nethogs
      - ngrep
      - pv
      - tcpdump
      - tcpflow
      - tree
      - unzip
  ignore_errors: True
  when: not common_utils_ascetic_install

- name: check if Russian locale exists
  command: bash -c "locale -a | grep ru_RU"
  changed_when: result.rc > 0
  failed_when: false
  register: result

- name: generate Russian locale
  command: bash -c "locale-gen ru_RU.UTF-8"
  when: result.rc > 0

- name: apt-get update
  apt:
    update_cache: yes
    cache_valid_time: 300
  ignore_errors: True

- name: install basic packages
  apt: name={{ item }} state=present
  with_items:
      - aptitude
      - curl
      - hdparm
      - heirloom-mailx
      - iftop
      - iotop
      - lsof
      - ncdu
      - netcat
      - openssl
      - screen
      - smartmontools
      - sysstat
      - telnet
      - tmux
      - unzip
      - vim
      - virt-what
      - wget

- name: install additional packages
  apt: name={{ item }} state=present
  with_items:
      - aria2
      - atop
      - bc
      - byobu
      - git
      - htop
      - iperf
      - lshw
      - mosh
      - netdiag
      - nethogs
      - ngrep
      - pv
      - tcpdump
      - tcpflow
      - tree
      - unzip
  ignore_errors: True
  when: not common_utils_ascetic_install

- name: install perf-related packages
  apt: name={{ item }} state=present
  with_items:
      - linux-tools
  ignore_errors: True
  when: not common_utils_ascetic_install

- name: check if Russian locale exists
  command: bash -c "locale -a | grep ru_RU"
  changed_when: result.rc > 0
  failed_when: false
  register: result

- name: generate Russian locale
  command: bash -c "locale-gen ru_RU.UTF-8"
  when: result.rc > 0

Move perf tools to a separate task
Move perf tools to a separate task
