Add tmux to music user
This commit is contained in:
parent
7ff22fe753
commit
5ca7161517
@ -4,15 +4,17 @@
|
||||
roles:
|
||||
- role: "music/datasets"
|
||||
tags: "music:datasets"
|
||||
- role: "music/user"
|
||||
tags: "music:user"
|
||||
vars:
|
||||
music_user_public_key_file: "\
|
||||
{% if (the_nine_worlds_production | bool) %}\
|
||||
~/.ssh/yggdrasil.pub\
|
||||
{% else %}\
|
||||
~/.ssh/debian-virt.pub\
|
||||
{% endif %}"
|
||||
- role: "music/rip"
|
||||
tags: "music:rip"
|
||||
vars:
|
||||
music_rip_public_key_file: "\
|
||||
{% if (the_nine_worlds_production | bool) %}\
|
||||
~/.ssh/yggdrasil.pub\
|
||||
{% else %}\
|
||||
~/.ssh/debian-virt.pub\
|
||||
{% endif %}"
|
||||
- role: "backups/snapshots/user"
|
||||
vars:
|
||||
backups_snapshots_user_name: "{{ music_user_name }}"
|
||||
|
@ -5,9 +5,6 @@ argument_specs:
|
||||
music_user_name:
|
||||
type: "str"
|
||||
required: true
|
||||
music_user_password:
|
||||
type: "str"
|
||||
required: true
|
||||
music_user_samba_password:
|
||||
type: "str"
|
||||
required: true
|
||||
@ -17,6 +14,3 @@ argument_specs:
|
||||
music_user_data_directory:
|
||||
type: "str"
|
||||
required: true
|
||||
music_rip_public_key_file:
|
||||
type: "str"
|
||||
required: true
|
||||
|
@ -1,37 +0,0 @@
|
||||
---
|
||||
- name: "user : create user"
|
||||
ansible.builtin.user:
|
||||
name: "{{ music_user_name }}"
|
||||
create_home: true
|
||||
home: "{{ music_user_home_directory }}"
|
||||
password: "{{ music_user_password }}"
|
||||
register: music_rip_user_create
|
||||
|
||||
- name: "rip : set default shell"
|
||||
ansible.builtin.user:
|
||||
name: "{{ music_user_name }}"
|
||||
shell: "/usr/bin/bash"
|
||||
|
||||
- block:
|
||||
|
||||
- name: "user : set home directory ownership"
|
||||
ansible.builtin.file:
|
||||
path: "{{ music_user_home_directory }}"
|
||||
state: "directory"
|
||||
owner: "{{ music_user_name }}"
|
||||
group: "{{ music_user_name }}"
|
||||
recurse: true
|
||||
|
||||
- name: "user : ensure XDG_RUNTIME_DIR is set"
|
||||
ansible.builtin.shell: |
|
||||
echo '\nexport XDG_RUNTIME_DIR=/run/user/$(id -u)' >> \
|
||||
{{ music_user_home_directory }}/.bashrc
|
||||
|
||||
when:
|
||||
music_rip_user_create.changed
|
||||
|
||||
- name: "user : set authorized key"
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ music_user_name }}"
|
||||
state: "present"
|
||||
key: "{{ lookup('ansible.builtin.file', music_rip_public_key_file) }}"
|
@ -1,9 +1,4 @@
|
||||
---
|
||||
- name: "play:music : role:rip : tasks:user"
|
||||
ansible.builtin.import_tasks: "include/user.yml"
|
||||
tags:
|
||||
- "music:rip:user"
|
||||
|
||||
- name: "play:music : role:rip : tasks:directories"
|
||||
ansible.builtin.import_tasks: "include/directories.yml"
|
||||
tags:
|
||||
|
16
playbooks/roles/music/user/meta/argument_specs.yml
Normal file
16
playbooks/roles/music/user/meta/argument_specs.yml
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
argument_specs:
|
||||
main:
|
||||
options:
|
||||
music_user_name:
|
||||
type: "str"
|
||||
required: true
|
||||
music_user_password:
|
||||
type: "str"
|
||||
required: true
|
||||
music_user_home_directory:
|
||||
type: "str"
|
||||
required: true
|
||||
music_user_public_key_file:
|
||||
type: "str"
|
||||
required: true
|
34
playbooks/roles/music/user/tasks/main.yml
Normal file
34
playbooks/roles/music/user/tasks/main.yml
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
- name: "create user"
|
||||
ansible.builtin.user:
|
||||
name: "{{ music_user_name }}"
|
||||
create_home: true
|
||||
home: "{{ music_user_home_directory }}"
|
||||
password: "{{ music_user_password }}"
|
||||
register: music_user_create
|
||||
|
||||
- name: "set default shell"
|
||||
ansible.builtin.user:
|
||||
name: "{{ music_user_name }}"
|
||||
shell: "/usr/bin/bash"
|
||||
|
||||
- name: "set home directory ownership"
|
||||
ansible.builtin.file:
|
||||
path: "{{ music_user_home_directory }}"
|
||||
state: "directory"
|
||||
owner: "{{ music_user_name }}"
|
||||
group: "{{ music_user_name }}"
|
||||
recurse: true
|
||||
when:
|
||||
music_user_create.changed
|
||||
|
||||
- ansible.builtin.import_role:
|
||||
name: "system/base/user"
|
||||
vars:
|
||||
system_base_user_become_user: "{{ music_user_name }}"
|
||||
|
||||
- name: "set authorized key"
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ music_user_name }}"
|
||||
state: "present"
|
||||
key: "{{ lookup('ansible.builtin.file', music_user_public_key_file) }}"
|
@ -98,6 +98,8 @@
|
||||
tags:
|
||||
- "system:base"
|
||||
- "system:base:user"
|
||||
vars:
|
||||
system_base_user_become_user: "{{ system_base_ssh_user }}"
|
||||
|
||||
- name: "system : asgard:&zfs"
|
||||
hosts: "asgard:&zfs"
|
||||
|
2
roles
2
roles
@ -1 +1 @@
|
||||
Subproject commit 483780a828ed5d2b8a197bbf1c8270a9c994f00d
|
||||
Subproject commit e91babde35eb600750e0dad30e28c4f0b4455e8e
|
Loading…
Reference in New Issue
Block a user