arch-install/roles/07_user/tasks/main.yml

36 lines
933 B
YAML
Raw Permalink Normal View History

2024-06-06 19:49:55 +00:00
---
- name: Make sure we have a 'wheel' group
2024-06-07 07:04:58 +00:00
ansible.builtin.group:
2024-06-06 19:49:55 +00:00
name: wheel
state: present
2024-06-07 07:04:58 +00:00
2024-06-06 19:49:55 +00:00
- name: Create user
ansible.builtin.user:
name: "{{ user.name }}"
2024-06-07 07:04:58 +00:00
# Use: openssl passwd -salt <salt> -1 <plaintext>
password: "{{ user.password }}"
2024-06-06 19:49:55 +00:00
update_password: on_create
comment: "{{ user.full_name }}"
groups: "{{ user.additional_groups }}"
append: yes
shell: "{{ user.shell }}"
state: present
2024-06-06 21:59:49 +00:00
expires: -1
2024-06-06 19:49:55 +00:00
become: true
- name: Setup sudo
2024-06-06 20:17:09 +00:00
ansible.builtin.copy:
2024-06-06 19:49:55 +00:00
dest: /etc/sudoers.d/{{ user.name }}
2024-06-06 21:01:51 +00:00
content: "{{ user.name }} ALL=(ALL:ALL) ALL"
2024-06-06 19:49:55 +00:00
mode: 0440
2024-06-06 21:59:08 +00:00
validate: /usr/sbin/visudo -cf %s
2024-06-07 07:04:58 +00:00
become: true
2024-06-07 11:44:37 +00:00
2024-06-10 08:44:29 +00:00
- name: Configure pinentry for gnome3
ansible.builtin.lineinfile:
path: ~/.gnupg/gpg-agent.conf
line: "pinentry-program /usr/bin/pinentry-gnome3"
2024-06-10 14:23:13 +00:00
create: yes
- name: Install Bitwarden CLI settings
ansible.builtin.import_tasks: rbw.yml