Start of zsh role, per-user section not yet implemented.

This commit is contained in:
Tom Alexander 2022-10-11 20:21:38 -04:00
parent b1532c38cc
commit d51770a4b4
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
9 changed files with 70 additions and 2 deletions

View File

@ -1,7 +1,6 @@
os_flavor: "linux" os_flavor: "linux"
users: users:
talexander: talexander:
per_user: true
initialize: true initialize: true
uid: 11235 uid: 11235
gid: 1000 gid: 1000

View File

@ -5,3 +5,4 @@
- sudo - sudo
- users - users
- zrepl - zrepl
- zsh

View File

@ -1,6 +1,5 @@
users: users:
talexander: talexander:
per_user: true
initialize: true initialize: true
uid: 11235 uid: 11235
gid: 11235 gid: 11235

View File

@ -0,0 +1,4 @@
- name: restart zrepl
service:
name: zrepl
state: restarted

View File

@ -0,0 +1,2 @@
dependencies:
- users

View File

@ -0,0 +1,17 @@
- name: Install packages
package:
name:
- zsh
- sqlite3
- git
- py39-jmespath # Needed on machine running ansible for json_query
state: present
- include_tasks:
file: tasks/peruser.yaml
apply:
become: yes
become_user: "{{ initialize_user }}"
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
loop_control:
loop_var: initialize_user

View File

@ -0,0 +1,8 @@
- name: Install packages
package:
name:
- zsh
- sqlite
- git
- python-jmespath # Needed on machine running ansible for json_query
state: present

View File

@ -0,0 +1,5 @@
- include: tasks/freebsd.yaml
when: 'os_flavor == "freebsd"'
- include: tasks/linux.yaml
when: 'os_flavor == "linux"'

View File

@ -0,0 +1,33 @@
- include_role:
name: per_user
# - name: clone zsh-histdb repo
# git:
# repo: "https://github.com/larkery/zsh-histdb.git"
# dest: "{{ account_homedir.stdout }}/.ansible_deploy/zsh-histdb"
# version: "6c7159be9de8586ac2f19d179d562cf5d10a2bab"
# diff: false
# - name: Create zshrc additional imports directory
# file:
# name: "{{ account_homedir.stdout }}/.ansible_deploy/zshrc"
# state: directory
# mode: 0700
# owner: "{{ account_name.stdout }}"
# group: "{{ group_name.stdout }}"
# - name: Configure zshrc additional imports
# copy:
# src: "files/zshrc_{{ item }}"
# dest: "{{ account_homedir.stdout }}/.ansible_deploy/zshrc/{{ item }}.zsh"
# mode: 0600
# owner: "{{ account_name.stdout }}"
# group: "{{ group_name.stdout }}"
# with_items: "{{ additional_zshrc_files }}"
# - name: Configure zshrc
# copy:
# src: files/zshrc
# dest: "{{ account_homedir.stdout }}/.zshrc"
# mode: 0600
# owner: "{{ account_name.stdout }}"
# group: "{{ group_name.stdout }}"