---
- name: Install system packages
  apt:
    name: dconf-cli
    state: latest
    update_cache: yes
  become: true

- name: Upgrade psutil (required by ansible dconf module)
  pip:
    name: psutil
    state: latest
  become: true

- name: Disable language switcher keyboard shortcut
  dconf:
    key: "/org/gnome/desktop/wm/keybindings/switch-input-source"
    value: "@au []"
    state: present

- name: Configure US keyboard layouts
  dconf:
    key: "/org/gnome/desktop/input-sources/sources"
    value: "[('xkb', 'us')]"
    state: present

- name: Disable ibus-daemon keyboard shortcuts
  dconf:
    key: "/org/gnome/settings-daemon/plugins/keyboard/active"
    value: "false"
    state: present

---
- name: Install system packages
  apt:
    name:
      - dconf-cli
      - python-psutil
    state: latest
    update_cache: yes
  become: true

- name: Disable language switcher keyboard shortcut
  dconf:
    key: "/org/gnome/desktop/wm/keybindings/switch-input-source"
    value: "@au []"
    state: present

- name: Configure US keyboard layouts
  dconf:
    key: "/org/gnome/desktop/input-sources/sources"
    value: "[('xkb', 'us')]"
    state: present

- name: Disable ibus-daemon keyboard shortcuts
  dconf:
    key: "/org/gnome/settings-daemon/plugins/keyboard/active"
    value: "false"
    state: present

Install psutil via apt instead of pip
Install psutil via apt instead of pip
