Tentativo di aggiustamento dell'utente su cui applicare le modifiche.
This commit is contained in:
parent
bce44c1622
commit
816ec1f32b
@ -1,2 +1,3 @@
|
|||||||
---
|
---
|
||||||
|
additional_user: syntaxerrormmm
|
||||||
dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles"
|
dotfdir: "{{ lookup('ansible.builtin.env', 'HOME' ) }}/.dotfiles"
|
||||||
|
@ -1,14 +1,44 @@
|
|||||||
---
|
---
|
||||||
# Configuring the nix installation.
|
# Configuring the nix installation.
|
||||||
|
|
||||||
- name: Adding user to nix-users
|
- name: Manipulation over {{ additional_user }}
|
||||||
|
when: ansible_user_id == 'root'
|
||||||
|
tags:
|
||||||
|
- nix
|
||||||
|
- nix-config
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Adding user to nix-users
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ additional_user }}"
|
||||||
|
groups: nix-users
|
||||||
|
append: true
|
||||||
|
become_user: root
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Adding configuration to local user
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: "{{ dotfdir }}/nix"
|
||||||
|
dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nix"
|
||||||
|
state: link
|
||||||
|
become_user: "{{ additional_user }}"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Manipulation over {{ ansible_user_id }}
|
||||||
|
when: ansible_user_id != 'root'
|
||||||
|
tags:
|
||||||
|
- nix
|
||||||
|
- nix-config
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Adding user to nix-users
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ ansible_user }}"
|
name: "{{ ansible_user }}"
|
||||||
groups: nix-users
|
groups: nix-users
|
||||||
append: true
|
append: true
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Adding configuration to local user
|
- name: Adding configuration to local user
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
src: "{{ dotfdir }}/nix"
|
src: "{{ dotfdir }}/nix"
|
||||||
dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nix"
|
dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/nix"
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
---
|
---
|
||||||
|
additional_user: syntaxerrormmm
|
||||||
dotfdir: "{{ lookup('ansible.builtin.env', 'HOME') }}/.dotfiles"
|
dotfdir: "{{ lookup('ansible.builtin.env', 'HOME') }}/.dotfiles"
|
||||||
|
@ -4,20 +4,49 @@
|
|||||||
- name: Fixing base settings
|
- name: Fixing base settings
|
||||||
ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml"
|
ansible.builtin.include_tasks: "{{ ansible_os_family | lower }}.yml"
|
||||||
|
|
||||||
- name: Set zsh as default shell for user
|
- name: Applying modifications to {{ additional_user }}
|
||||||
|
when: ansible_user_id == 'root'
|
||||||
|
become: true
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Set zsh as default shell for user
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ ansible_user }}"
|
name: "{{ additional_user }}"
|
||||||
|
shell: /usr/bin/zsh
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
- name: Creating personal folder for customization
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zsh/conf.d"
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
become_user: "{{ additional_user }}"
|
||||||
|
|
||||||
|
- name: Linking main file
|
||||||
|
ansible.builtin.file:
|
||||||
|
src: "{{ dotfdir }}/zshrc"
|
||||||
|
dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc"
|
||||||
|
state: link
|
||||||
|
become_user: "{{ additional_user }}"
|
||||||
|
|
||||||
|
- name: Applying results to {{ ansible_user_id }}
|
||||||
|
when: ansible_user_id != 'root'
|
||||||
|
block:
|
||||||
|
|
||||||
|
- name: Set zsh as default shell for user
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ ansible_user_id }}"
|
||||||
shell: /usr/bin/zsh
|
shell: /usr/bin/zsh
|
||||||
become_user: root
|
become_user: root
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Creating personal folder for customization
|
- name: Creating personal folder for customization
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zsh/conf.d"
|
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zsh/conf.d"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Linking main file
|
- name: Linking main file
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
src: "{{ dotfdir }}/zshrc"
|
src: "{{ dotfdir }}/zshrc"
|
||||||
dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc"
|
dest: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc"
|
||||||
|
Loading…
Reference in New Issue
Block a user