updated users / zsh states after users structure changes
This commit is contained in:
parent
2b1faf1daa
commit
4cb3cc6d49
@ -1,3 +1,3 @@
|
|||||||
---
|
---
|
||||||
users: []
|
users: {}
|
||||||
groups: []
|
groups: {}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
---
|
---
|
||||||
{%- from "users/map.jinja" import groups with context -%}
|
{%- from "users/map.jinja" import groups with context -%}
|
||||||
|
|
||||||
{%- for group in groups %}
|
{%- for name,group in groups.items() %}
|
||||||
group-{{ group.name }}:
|
group-{{ name }}:
|
||||||
{%- if group.enabled %}
|
{%- if group.enabled %}
|
||||||
group.present:
|
group.present:
|
||||||
{%- else %}
|
{%- else %}
|
||||||
group.absent:
|
group.absent:
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
- name: {{ group.name }}
|
- name: {{ name }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
---
|
---
|
||||||
{%- from "users/map.jinja" import users with context -%}
|
{%- from "users/map.jinja" import users with context -%}
|
||||||
|
|
||||||
{%- for user in users %}
|
{%- for username,user in users.items() %}
|
||||||
{%- if user.sshkeys is defined %}
|
{%- if user.sshkeys is defined %}
|
||||||
{%- for key in user.sshkeys %}
|
{%- for key in user.sshkeys %}
|
||||||
ssh-key-{{ user.name }}-{{ key.name }}:
|
ssh-key-{{ username }}-{{ key.name }}:
|
||||||
ssh_auth.{{ key.state }}:
|
ssh_auth.{{ key.state }}:
|
||||||
- user: {{ user.name }}
|
- user: {{ username }}
|
||||||
- names:
|
- names:
|
||||||
- {{ key.value }}
|
- {{ key.value }}
|
||||||
- require:
|
- require:
|
||||||
- user: user-{{ user.name }}
|
- user: user-{{ username }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
---
|
---
|
||||||
{%- from "users/map.jinja" import users with context -%}
|
{%- from "users/map.jinja" import users with context -%}
|
||||||
|
|
||||||
{%- for user in users %}
|
{%- for name, user in users.items() %}
|
||||||
|
|
||||||
{%- if not user.enabled %}
|
{%- if not user.enabled %}
|
||||||
user-{{ user.name }}:
|
user-{{ name }}:
|
||||||
user.absent:
|
user.absent:
|
||||||
- name: {{ user.name }}
|
- name: {{ name }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- if user.enabled %}
|
{%- if user.enabled %}
|
||||||
user-{{ user.name }}:
|
user-{{ name }}:
|
||||||
user.present:
|
user.present:
|
||||||
- name: {{ user.name }}
|
- name: {{ name }}
|
||||||
- fullname: {{ user.fullname }}
|
- fullname: {{ user.fullname }}
|
||||||
- shell: {{ user.shell }}
|
- shell: {{ user.shell }}
|
||||||
- home: {{ user.home }}
|
- home: {{ user.home }}
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
{%- set defaults = salt['grains.filter_by'](default_settings, default='zsh') -%}
|
{%- set defaults = salt['grains.filter_by'](default_settings, default='zsh') -%}
|
||||||
|
|
||||||
{%- set zsh = salt['pillar.get']('zsh', default=defaults, merge=True) -%}
|
{%- set zsh = salt['pillar.get']('zsh', default=defaults, merge=True) -%}
|
||||||
{%- set users = salt['pillar.get']('users', default=defaults, merge=True) -%}
|
{%- set users = salt['pillar.get']('users') -%}
|
@ -1,17 +1,17 @@
|
|||||||
---
|
---
|
||||||
{%- from "zsh/map.jinja" import users with context %}
|
{%- from "zsh/map.jinja" import users with context %}
|
||||||
{%- for user in users %}
|
{%- for name, user in users.items() %}
|
||||||
{%- if user.enabled %}
|
{%- if user.enabled %}
|
||||||
zshrc-user-{{ user.name }}:
|
zshrc-user-{{ name }}:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ user.home }}/.zshrc
|
- name: {{ user.home }}/.zshrc
|
||||||
- source: salt://zsh/zshrc.j2
|
- source: salt://zsh/zshrc.j2
|
||||||
- user: {{ user.name }}
|
- user: {{ name }}
|
||||||
- group: {{ user.gid }}
|
- group: {{ user.gid }}
|
||||||
- mode: 0644
|
- mode: 0644
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- require:
|
- require:
|
||||||
- pkg: zsh-pkg
|
- pkg: zsh-pkg
|
||||||
- user: user-{{ user.name }}
|
- user: user-{{ name }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
@ -53,7 +53,11 @@ then
|
|||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
alias vim=nvim
|
# Neovim aliases
|
||||||
|
for i in v vi vim
|
||||||
|
do
|
||||||
|
alias $i=nvim
|
||||||
|
done
|
||||||
alias weather="curl -s wttr.in/caen"
|
alias weather="curl -s wttr.in/caen"
|
||||||
|
|
||||||
# Misc settings
|
# Misc settings
|
||||||
|
Loading…
Reference in New Issue
Block a user