Feat: testing and multiple fixes

This commit is contained in:
2022-03-04 05:56:37 +01:00
parent 471d39bb86
commit f033b7e59d
8 changed files with 33 additions and 30 deletions

View File

@@ -12,3 +12,10 @@
state: present
update_cache: yes
become: true
- name: Install acl
apt:
name: acl
state: present
update_cache: yes
become: true

View File

@@ -1,7 +1,6 @@
---
- name: Install for arch
import_tasks: arch.yml
when: ansible_os_family == "Archlinux"
- name: Install os-specific packages
include_tasks: "{{ ansible_os_family | lower }}.yml"
- name: Install for debian
import_tasks: debian.yml
@@ -11,11 +10,8 @@
ansible.builtin.git:
repo: "{{ user.config.giturl }}"
dest: "/home/{{ user.username }}/.dotfiles"
- name: user owns its dotfiles
ansible.builtin.file:
path: "/home/{{ user.username }}/.dotfiles"
owner: "{{ user.username }}"
become: true
become_user: "{{ user.username }}"
- name: stow configs
ansible.builtin.command:

View File

@@ -5,12 +5,12 @@
username: "{{ user.username }}"
# Create user
- name: users -- Ensure wheel group exists
- name: Ensure wheel group exists
group:
name: wheel
state: present
- name: "{{ username }}: create user "
- name: "{{ username }} -- create user "
ansible.builtin.user:
name: "{{ user.username }}"
update_password: on_create
@@ -23,17 +23,15 @@
create_home: true
#
- name: "{{ username }}: Add public key"
- name: "{{ username }} -- Add public key"
authorized_key:
user: "{{ user.username }}"
key: "{{ lookup('file', item.keyfile) }}"
state: present
with_items: "{{ user.public_key }}"
#when: user.public_key
when: false
with_items: "{{ user.public_key | default([]) }}"
# Dotfiles
- name: "{{ username }}: set dotfiles"
- name: "{{ username }} -- set dotfiles"
import_tasks: dotfiles.yml
- name: "{{ username }}: gtk_settings"
@@ -41,12 +39,12 @@
key: "{{ item.key }}"
value: "{{ item.value }}"
state: present
with_items: "{{ user.gtk_settings | default('') }}"
with_items: "{{ user.gtk_settings | default([]) }}"
become: true
become_user: "{{ user.username }}"
- name: "{{ username }}: user owns its create_home"
- name: "{{ username }} -- user owns its create_home"
file:
path: "/home/{{ user.username }}/.dotfiles"
owner: "{{ user.username }}"

View File

@@ -16,9 +16,7 @@
repo: "https://github.com/wbthomason/packer.nvim"
dest: "/home/{{ user.username }}/.local/share/nvim/site/pack/packer/start/packer.nvim"
depth: 1
become: true
become_user: "{{ user.username }}"
- name: user owns packer
ansible.builtin.file:
path: "/home/{{ user.username }}/.local/share/nvim/site/pack/packer/start/packer.nvim"
owner: "{{ user.username }}"