- name: account $HOME
  shell: "echo $HOME"
  register: account_homedir
  changed_when: false
  check_mode: no

- name: account name
  command: id -un
  register: account_name
  changed_when: false
  check_mode: no

- name: group name
  command: id -gn
  register: group_name
  changed_when: false
  check_mode: no

- name: Create directories
  file:
    name: "{{ account_homedir.stdout }}/{{ item }}"
    state: directory
    mode: 0700
    owner: "{{ account_name.stdout }}"
    group: "{{ group_name.stdout }}"
  loop:
    - .config/ansible_deploy

- import_tasks: tasks/peruser_freebsd.yaml
  when: 'os_flavor == "freebsd"'

- import_tasks: tasks/peruser_linux.yaml
  when: 'os_flavor == "linux"'
