---
- name: Deploy http proxy config
  copy:
    dest: /etc/environment.d/10-lmn-proxy.conf
    content: |
      http_proxy="{{ proxy }}"
      https_proxy="{{ proxy }}"
      ftp_proxy="{{ proxy }}"
      no_proxy="{{ no_proxy }}"
  when: not (groups.teacherlaptop is defined and inventory_hostname in groups.teacherlaptop)

- name: Set aptcache
  ansible.builtin.copy:
    dest: /etc/apt/apt.conf
    content: >
      {{ apt_conf }}

- name: Set NTP server
  ansible.builtin.lineinfile:
    path: /etc/systemd/timesyncd.conf
    insertafter: '^#NTP='
    line: NTP={{ ntp_serv }}

- name: Add proposed-updates repository
  apt_repository:
    repo: >
      deb http://deb.debian.org/debian/ {{ ansible_distribution_release }}-proposed-updates
      main non-free-firmware
    state: present
  when: groups.R202 is defined and inventory_hostname in groups.R202