machine_setup/ansible/roles/per_user/tasks/main.yaml

34 lines
702 B
YAML
Raw Normal View History

2022-10-12 00:33:16 +00:00
- 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:
2022-10-12 01:45:56 +00:00
- .config/ansible_deploy
2022-10-12 00:33:16 +00:00
2022-10-12 00:36:59 +00:00
- import_tasks: tasks/peruser_freebsd.yaml
2022-10-12 00:33:16 +00:00
when: 'os_flavor == "freebsd"'
2022-10-12 00:36:59 +00:00
- import_tasks: tasks/peruser_linux.yaml
2022-10-12 00:33:16 +00:00
when: 'os_flavor == "linux"'