1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_collection_users.git synced 2024-08-16 10:29:50 +02:00

Update dotifles

This commit is contained in:
L3D 2024-04-06 22:59:38 +02:00
parent 7966fbb3dd
commit 7727d0384d
No known key found for this signature in database
GPG key ID: AD65B920933B4B20
9 changed files with 39 additions and 39 deletions

View file

@ -37,23 +37,18 @@ There is a third directory-variable called ``l3d_users__ssh_login: []`` which on
| name | default value | description |
| --- | --- | --- |
| ``l3d_users__limit_login`` | ``true`` | Only allow SSH login for specified users |
| ``l3d_users__sshd_port`` | ``22`` | Port for SSH |
| ``l3d_users__sshd_password_authentication`` | ``false`` | Allow login with Password |
| ``l3d_users__sshd_permitrootlogin`` | ``false`` | Allow login as root |
| ``l3d_users__create_ansible`` | ``true`` | Create Ansible User |
| ``l3d_users__ansible_user_state`` | ``present`` | Ansible User State |
| ``l3d_users__sshd_manage_server_key_types`` | ``true`` | Manage Server SSH Key types |
| ``l3d_users__sshd_server_key_types`` | ``['ed25519']`` | List of supported SSH Key Types |
| ``l3d_users__sshd_manage_key_algorithmus`` | ``true`` | Manage SSH Key Algorythmins |
| ``l3d_users__sshd_key_algorithmus`` | ``['ssh-ed25519-cert-v01@openssh.com', 'ssh-ed25519', 'ecdsa-sha2-nistp521-cert-v01@openssh.com', 'ecdsa-sha2-nistp384-cert-v01@openssh.com', 'ecdsa-sha2-nistp256-cert-v01@openssh.com']`` | Used SSH Key Algorithms |
| ``l3d_users__sshd_manage_kex_algorithmus`` | ``true`` | Manage SSH Kex Algorythms |
| ``l3d_users__sshd_kex_algorithmus`` | ``['curve25519-sha256@libssh.org', 'diffie-hellman-group-exchange-sha256', 'diffie-hellman-group-exchange-sha1']`` | Used Kex Algorythms |
| ``l3d_users__sshd_manage_ciphers`` | ``true`` | Manage SSH Ciphers |
| ``l3d_users__sshd_ciphers`` | ``['chacha20-poly1305@openssh.com', 'aes256-gcm@openssh.com', 'aes256-ctr']`` | Used SSH Ciphers |
| ``l3d_users__sshd_manage_macs`` | ``true`` | Manage Used MACs |
| ``l3d_users__sshd_macs`` | ``['hmac-sha2-512-etm@openssh.com', 'hmac-sha2-256-etm@openssh.com', 'hmac-sha2-512']`` | Used MACs |
| ``l3d_users__sshd_xforwarding`` |``true`` | Enable X-Forwarding |
| ``l3d_users__bashrc`` | ``true`` | Configure bashrc |
| ``l3d_users__dotfiles__bash_completion_enabled`` | ``true`` | Enable bash completion |
| ``l3d_users__dotfiles__aliases`` | *see [defaults/main.yml](defaults/main.yml)* | A predefined list of usefull aliases for your bash config |
| ``dotfiles__additional_user_bashrc_lines`` | ``[]`` | variable for additional bashrc lines |
| ``l3d_users__bashrc_path`` | ``$HOME/.local/bin:$HOME/bin:$HOME/.cargo/env:$PATH``| bashrc $PATH |
| ``l3d_users__dotfiles__user_prompt`` | *see [defaults/main.yml](defaults/main.yml)* | PS1 prompt for users |
| ``l3d_users__dotfiles__root_prompt`` | *see [defaults/main.yml](defaults/main.yml)* | PS1 prompt for root |
| ``l3d_users__dotfiles__history_control`` | ``ignoreboth`` | bashrc history control |
| ``l3d_users__dotfiles__history_size`` | ``-1`` | bashrc history size |
| ``l3d_users__dotfiles__history_file_size`` | ``-1`` | bashrc history filesize |
| ``l3d_users__vimrc`` | ``true`` | Create vim config |
| ``l3d_users__tmuxcfg`` | ``true`` | Create Tmux Config |
| ``submodules_versioncheck`` | ``false`` | Optionaly enable simple versionscheck of this role |
Example Playbook

View file

@ -41,7 +41,7 @@ l3d_users__dotfiles__aliases:
- {alias: "lz", command: "ls -Z", color: false}
- {alias: "EDITOR", command: "/usr/bin/vim", color: false}
- {alias: "VISUAL", command: "/usr/bin/gedit", color: false}
- {alias: "gitsubpull", command: "git submodule foreach '(git checkout $(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's@^origin/@@'); git pull ; git submodule foreach \"(git checkout $(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's@^origin/@@'); git pull)\")'", color: false}
- {alias: "gitsubpull", command: "git submodule foreach '(git checkout \\$(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's@^origin/@@'); git pull ; git submodule foreach \\\"(git checkout \\$(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's@^origin/@@'); git pull)\\\")'", color: false}
- {alias: "pwgen", command: "/usr/bin/pwgen --num-passwords=3000 --numerals --capitalize --secure --no-vowels --ambiguous 95 1", color: false}
- {alias: "gdiff", command: "git diff --submodule=diff", color: false}
dotfiles__additional_user_bashrc_lines: []
@ -59,6 +59,7 @@ l3d_users__dotfiles__history_file_size: '-1'
# vim config
l3d_users__vimrc: true
l3d_users__vim_colorscheme: 'elflord'
# tmux config
l3d_users__tmuxcfg: true

View file

@ -8,6 +8,10 @@
ansible.builtin.include_tasks:
file: 'packages.yml'
- name: Merge default and locale Users
ansible.builtin.set_fact:
_l3d_users__merged_users: "{{ l3d_users__default_users + l3d_users__local_users }}"
- name: Setup and configure bashrc
ansible.builtin.include_tasks:
file: 'bashrc.yml'

View file

@ -1,5 +1,5 @@
# /etc/bashrc
{{ ansible_managed | comment }}
{{ ansible_managed | ansible.builtin.comment }}
# System wide functions and aliases
# Environment stuff goes in /etc/profile
@ -41,13 +41,13 @@ fi
HISTCONTROL={{ l3d_users__dotfiles__history_control }}
shopt -s histappend
{% if ansible_os_family == 'Redhat' %}
# HISTSIZE={{ dotfiles__history_size }}
# HISTFILESIZE={{ dotfiles__history_file_size }}
# HISTSIZE={{ l3d_users__dotfiles__history_size }}
# HISTFILESIZE={{ l3d_users__dotfiles__history_file_size }}
{% elif ansible_distribution == "CentOS" %}
# HISTSIZE={{ dotfiles__history_size }}
# HISTFILESIZE={{ dotfiles__history_file_size }}
# HISTSIZE={{ l3d_users__dotfiles__history_size }}
# HISTFILESIZE={{ l3d_users__dotfiles__history_file_size }}
{% else %}
HISTSIZE={{ dotfiles__history_size }}
HISTFILESIZE={{ dotfiles__history_file_size }}
HISTSIZE={{ l3d_users__dotfiles__history_size }}
HISTFILESIZE={{ l3d_users__dotfiles__history_file_size }}
{% endif %}
# vim:ts=4:sw=4

View file

@ -1,6 +1,6 @@
# {{ user.home | default('/home/' + user.name) }}/.bashrc"
# for user {{ user.name }}
{{ ansible_managed | comment }}
{{ ansible_managed | ansible.builtin.comment }}
# Source global definitions
if [ -f /etc/bash.bashrc ]; then
@ -44,18 +44,18 @@ export PS1='{{ l3d_users__dotfiles__user_prompt }} '
HISTCONTROL={{ l3d_users__dotfiles__history_control }}
shopt -s histappend
{% if ansible_os_family == 'Redhat' %}
# HISTSIZE={{ dotfiles__history_size }}
# HISTFILESIZE={{ dotfiles__history_file_size }}
# HISTSIZE={{ l3d_users__dotfiles__history_size }}
# HISTFILESIZE={{ l3d_users__dotfiles__history_file_size }}
{% elif ansible_distribution == "CentOS" %}
# HISTSIZE={{ dotfiles__history_size }}
# HISTFILESIZE={{ dotfiles__history_file_size }}
# HISTSIZE={{ l3d_users__dotfiles__history_size }}
# HISTFILESIZE={{ l3d_users__dotfiles__history_file_size }}
{% else %}
HISTSIZE={{ dotfiles__history_size }}
HISTFILESIZE={{ dotfiles__history_file_size }}
HISTSIZE={{ l3d_users__dotfiles__history_size }}
HISTFILESIZE={{ l3d_users__dotfiles__history_file_size }}
{% endif %}
# additional general rules
{% for _row in dotfiles__additional_user_bashrc_lines | default() %}
{% for _row in l3d_users__dotfiles__additional_user_bashrc_lines | default() %}
{{ _row }}
{% endfor %}

View file

@ -1,2 +1,2 @@
{{ ansible_managed | ansible.builtin.comment }}
set -g history-limit 65536

View file

@ -1,5 +1,6 @@
{{ ansible_managed | comment }}
"
" {{ ansible_managed }}
"
" gopass secure editor
au BufNewFile,BufRead /dev/shm/gopass.* setlocal noswapfile nobackup noundofile
@ -8,7 +9,7 @@ syntax on " enable syntax highlighting
set cursorline " highlight the current line
set fileencoding=utf-8
set encoding=utf-8
colorscheme elflord
colorscheme {{ l3d_users__vim_colorscheme }}
set cursorline " highlight the current line
" tabs and indenting

View file

@ -5,5 +5,5 @@ l3d_users__dotfiles_packages:
- htop
- tmux
playbook_version_number: 6
playbook_version_number: 7
playbook_version_path: 'l3d.users.dotfiles.version'

View file

@ -8,7 +8,6 @@
ansible.builtin.set_fact:
_l3d_users__merged_users: "{{ l3d_users__default_users + l3d_users__local_users }}"
- name: Create ansible user with superuser permissions
ansible.builtin.include_tasks:
file: 'user_ansible.yml'