Add shell playbook

This commit is contained in:
LinuxSquare 2024-06-27 22:33:38 +02:00
parent b459470590
commit d13417911c
3 changed files with 54 additions and 1 deletions

View file

@ -0,0 +1,34 @@
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:{{ CUSTOM_BIN }}"
export PAGER=less
export EDITOR=vim
umask 022
# use nicer PS1 for bash and busybox ash
if [ -n "$BASH_VERSION" -o "$BB_ASH_VERSION" ]; then
PS1='[%n@%m %~]%# '
# use nicer PS1 for zsh
elif [ -n "$ZSH_VERSION" ]; then
PS1='[%n@%m %~]%# '
# set up fallback default PS1
else
: "${HOSTNAME:=$(hostname)}"
PS1='${HOSTNAME%%.*}:$PWD'
[ "$(id -u)" -eq 0 ] && PS1="${PS1}# " || PS1="${PS1}\$ "
fi
if [ -n "$BASH_VERSION" ] && [ "$BASH" != "/bin/sh" ]; then
# if we're bash (and not /bin/sh bash), also source the bashrc
# by default, bash sources the bashrc for non-login,
# and only /etc/profile on login (-l). so, make it do both on login.
# this ensures that login-shell bash (e.g. -bash or bash -l) still sources the
# system bashrc, which e.g. loads bash-completion
. /etc/bash/bashrc
fi
for script in /etc/profile.d/*.sh ; do
if [ -r "$script" ] ; then
. "$script"
fi
done
unset script

View file

@ -2,6 +2,6 @@
- import_playbook: bootloader.ansible.yml - import_playbook: bootloader.ansible.yml
- import_playbook: disks.ansible.yml - import_playbook: disks.ansible.yml
- import_playbook: user.ansible.yml - import_playbook: user.ansible.yml
# - import_playbook: shell.ansible.yml - import_playbook: shell.ansible.yml
# - import_playbook: ansible.ansible.yml # - import_playbook: ansible.ansible.yml

View file

@ -0,0 +1,19 @@
- hosts: localhost
vars_files:
- ../map.yml
tasks:
- name: Install shell base-packages
package:
name:
- zsh
- alpine-zsh-config
- bash
- name: Populate shell profile
template:
src: files/shell_profile.j2
dest: /etc/profile
owner: root
group: root
mode: '0644'
vars:
CUSTOM_BIN: "{{ bin_dir }}"