You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.7 KiB
YAML
74 lines
1.7 KiB
YAML
---
|
|
|
|
- name: Install required packages
|
|
apt:
|
|
state: present
|
|
name:
|
|
- git
|
|
- httpie
|
|
- man
|
|
- thefuck
|
|
- tmux
|
|
- zsh
|
|
|
|
- name: Configure user account {{ username }}
|
|
user:
|
|
name: "{{ username }}"
|
|
home: "{{ user_directory }}"
|
|
create_home: yes
|
|
move_home: yes
|
|
shell: /bin/zsh
|
|
groups:
|
|
- "{{ sudo | ternary('sudo', '') }}"
|
|
append: yes
|
|
password: "{{ password | password_hash('sha512', LOCAL_SALT) }}"
|
|
update_password: on_create
|
|
generate_ssh_key: yes
|
|
ssh_key_type: ed25519
|
|
ssh_key_file: .ssh/id_ed25519
|
|
ssh_key_passphrase: "{{ password }}"
|
|
ssh_key_comment: "{{ username }}@{{ ansible_fqdn }} {{ ansible_date_time.date }}"
|
|
|
|
- name: Configure home directory
|
|
file:
|
|
path: "{{ user_directory }}"
|
|
state: directory
|
|
owner: "{{ username }}"
|
|
group: "{{ username }}"
|
|
mode: "u=rwx,g=rx,o="
|
|
|
|
- name: Configure ssh configration directory
|
|
file:
|
|
path: "{{ user_directory }}/.ssh"
|
|
state: directory
|
|
owner: "{{ username }}"
|
|
group: "{{ username }}"
|
|
mode: "u=rwx,g=rx,o="
|
|
|
|
- name: Configure authorized_keys
|
|
get_url:
|
|
url: "{{ authorized_keys }}"
|
|
dest: "{{ user_directory }}/.ssh/authorized_keys"
|
|
force: yes
|
|
owner: "{{ username }}"
|
|
group: "{{ username }}"
|
|
mode: "u=rwx,g=rx,o="
|
|
|
|
- name: Download oh-my-zsh for user {{ username }}
|
|
become_user: "{{ username }}"
|
|
git:
|
|
repo: https://github.com/robbyrussell/oh-my-zsh.git
|
|
version: master
|
|
dest: ~/.oh-my-zsh
|
|
|
|
- name: Configure oh-my-zsh
|
|
become_user: "{{ username }}"
|
|
template:
|
|
src: template.zshrc
|
|
dest: ~/.zshrc
|
|
force: no
|
|
|
|
# TODO tmux configuration
|
|
|
|
# TODO vim configuration
|