---
- name: Update apt cache
  apt: update_cache=yes

- name: Install updates
  apt: upgrade=dist dpkg_options='force-confold'
  when: not lookup('env','CI') # skip the step in CI to avoid large updates

- name: Install common packages
  apt: name={{ item }} state=latest 
  with_items: packages

- name: Ensure user exists
  user: name={{ user }} uid=1040 group={{ user }}

- name: Configure vim
  copy: src=files/.vimrc dest=/home/{{ user }} owner={{ user }} group={{ user }} mode="u=rw,g=r,o=r"

- name: Configure git
  copy: src=files/.gitconfig dest=/home/{{ user }} owner={{ user }} group={{ user }} mode="u=rw,g=r,o=r"


---
- name: Update apt cache
  apt: update_cache=yes

- name: Install updates
  apt: upgrade=dist dpkg_options='force-confold'
  when: not lookup('env','CI') # skip the step in CI to avoid large updates

- name: Install common packages
  apt: name={{ item }} state=latest 
  with_items: packages

- name: Ensure group exists
  group: name={{ user }}

- name: Ensure user exists
  user: name={{ user }} uid=1040 group={{ user }}

- name: Configure vim
  copy: src=files/.vimrc dest=/home/{{ user }} owner={{ user }} group={{ user }} mode="u=rw,g=r,o=r"

- name: Configure git
  copy: src=files/.gitconfig dest=/home/{{ user }} owner={{ user }} group={{ user }} mode="u=rw,g=r,o=r"


Fix issue with missing group
Fix issue with missing group
