machine_setup/ansible/roles/per_user/tasks/main.yaml
2022-10-11 21:45:56 -04:00

34 lines
702 B
YAML

- 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"'