---
- hosts: all
  become: True
  environment:
    http_proxy: "{{ proxy_env }}"
    https_proxy: "{{ proxy_env }}"
  vars_files:
    - group_vars/all
  vars:
    - user_web: web
    - user_webapp: webapp
    - user_websource: websource
    - user_webprivate: webprivate
    - role_users: "{{ users }}"

  roles:
    - { role: apt-proxy-client, tags: apt-proxy-client }
    - { role: hosts, tags: hosts }
    - { role: bootstrap-client1804, tags: bootstrap }
    - { role: pip-1804 , tags: pip }
    - { role: usermachine-1804 , tags: usermachine }
    - { role: fcitx-1804 , tags: fcitx}
    - { role: depot , tags: depot }
    - { role: gohttp-depot, tags: gohttp }
  post_tasks:
    - name: Autoremove unused packages
      command: apt-get -y autoremove
      register: autoremove_output
      changed_when: "'The following packages will be REMOVED' in autoremove_output.stdout"

