Fix user creation
This commit is contained in:
parent
828f7b7274
commit
4aa6a08a95
|
@ -4,7 +4,8 @@
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ user.username }}"
|
name: "{{ user.username }}"
|
||||||
state: "{{ user.state | default(omit) }}"
|
state: "{{ user.state | default(omit) }}"
|
||||||
groups: "{{ user.groups | default(omit) | join(',') }}"
|
group: "{{ user.group | default(omit) }}"
|
||||||
|
groups: "{{ user.groups | default(omit) }}"
|
||||||
comment: "{{ user.comment | default(omit) }}"
|
comment: "{{ user.comment | default(omit) }}"
|
||||||
shell: "{{ user.shell | default(omit) }}"
|
shell: "{{ user.shell | default(omit) }}"
|
||||||
password: "{{ user.password | default(omit) }}"
|
password: "{{ user.password | default(omit) }}"
|
||||||
|
@ -72,24 +73,26 @@
|
||||||
|
|
||||||
- name: "Install antigen for '{{ user.username }}'."
|
- name: "Install antigen for '{{ user.username }}'."
|
||||||
tags: users
|
tags: users
|
||||||
become: true
|
|
||||||
become_user: "{{ user.username }}"
|
|
||||||
ansible.builtin.get_url:
|
ansible.builtin.get_url:
|
||||||
url: https://git.io/antigen
|
url: https://git.io/antigen
|
||||||
dest: "{{ user.home_dir | default('/home/' + user.username) }}/.zsh/antigen.zsh"
|
dest: "{{ user.home_dir | default('/home/' + user.username) }}/.zsh/antigen.zsh"
|
||||||
mode: 0600
|
mode: 0600
|
||||||
when:
|
|
||||||
- user.shell is defined
|
|
||||||
- "'/zsh' in user.shell"
|
|
||||||
|
|
||||||
- name: "Install tpm for user '{{ user.username }}'."
|
- name: "Install tpm for user '{{ user.username }}'."
|
||||||
tags: users
|
tags: users
|
||||||
become: true
|
|
||||||
become_user: "{{ user.username }}"
|
|
||||||
ansible.builtin.git:
|
ansible.builtin.git:
|
||||||
repo: "https://github.com/tmux-plugins/tpm"
|
repo: "https://github.com/tmux-plugins/tpm"
|
||||||
dest: "{{ user.home_dir | default('/home/' + user.username) }}/.tmux/plugins/tpm"
|
dest: "{{ user.home_dir | default('/home/' + user.username) }}/.tmux/plugins/tpm"
|
||||||
version: v3.0.0
|
version: v3.0.0
|
||||||
|
|
||||||
|
- name: "Fix permissions for user '{{ user.username }}'"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
owner: "{{ user.username }}"
|
||||||
|
recurse: yes
|
||||||
|
with_items:
|
||||||
|
- "{{ user.home_dir | default('/home/' + user.username) }}/.tmux/plugins/tpm"
|
||||||
|
- "{{ user.home_dir | default('/home/' + user.username) }}/.zsh"
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- user.state | default('present') == 'present'
|
- user.state | default('present') == 'present'
|
||||||
|
|
Loading…
Reference in New Issue