From: Christian Heller Date: Sat, 18 Mar 2017 04:35:47 +0000 (+0100) Subject: In ansible attempt, differentiate symlink file directories. X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7Bdb.prefix%7D%7D/todos?a=commitdiff_plain;h=d063fbff02867ba87168ea35a852d161689520f7;p=config In ansible attempt, differentiate symlink file directories. --- diff --git a/ansible/config.yml b/ansible/config.yml index 3afcbf7..b34b529 100644 --- a/ansible/config.yml +++ b/ansible/config.yml @@ -6,7 +6,7 @@ - name: symlink system files file: state=link force=yes src={{item}} dest={{item|basename|regex_replace('___','/')}} - with_fileglob: ~/config/ansible/files/* + with_fileglob: ~/config/ansible/files/system/* - name: set hostname for current session shell: hostname w530 @@ -23,6 +23,9 @@ apt: upgrade=dist # Configure console. + - name: symlink console config files + file: state=link force=yes src={{item}} dest={{item|basename|regex_replace('___','/')}} + with_fileglob: ~/config/ansible/files/console/* - name: ensure locales and console-setup are installed apt: name={{item}} state=present with_items: @@ -36,7 +39,9 @@ # Miscellaneous. - name: Ensure dotfile symlinks file: state=link force=yes src={{item}} dest=~/.{{item|basename}} - with_fileglob: ~/config/ansible/dotfiles/* + with_fileglob: ~/config/ansible/files/dotfiles/* + - name: ensure ~/.vimbackups directory + file: state=directory dest=~/.vimbackups - name: ensure man-db, manpages is installed apt: name={{item}} state=present with_items: diff --git a/ansible/dotfiles/bashrc b/ansible/dotfiles/bashrc deleted file mode 100644 index 4dc08f7..0000000 --- a/ansible/dotfiles/bashrc +++ /dev/null @@ -1,5 +0,0 @@ -# Bash as a non-login shell in non-POSIX-mode does not read in the startup -# script at the path in $ENV. This forces it to still read in the ~/.shinit -# startup script for non-login shells. - -. ~/.shinit diff --git a/ansible/dotfiles/gitconfig b/ansible/dotfiles/gitconfig deleted file mode 100644 index 5cdc162..0000000 --- a/ansible/dotfiles/gitconfig +++ /dev/null @@ -1,3 +0,0 @@ -[user] - name = Christian Heller - email = c.heller@plomlompom.de diff --git a/ansible/dotfiles/profile b/ansible/dotfiles/profile deleted file mode 100644 index 5a58435..0000000 --- a/ansible/dotfiles/profile +++ /dev/null @@ -1,6 +0,0 @@ -# Initialization for login shells. - -# Tell interactive shells to look in ~/.shinit for setup. -ENV=$HOME/.shinit -export ENV -. $ENV diff --git a/ansible/dotfiles/shinit b/ansible/dotfiles/shinit deleted file mode 100644 index 25d1396..0000000 --- a/ansible/dotfiles/shinit +++ /dev/null @@ -1,37 +0,0 @@ -# Settings for interactive shells. - -# Ensure shell truly is interactive to avoid confusing non-interactive shells. -if [[ $- == *i* ]]; then - - # Fancy colors for ls. - alias ls="ls --color=auto" - - # Use vim as default editor for anything. - export VISUAL=vim - export EDITOR=$VISUAL - - # Colored prompt with username, hostname, date/time, directory. - colornumber=7 # Default to white if no color set via colornumber dotfile. - colornumber_file=~/.shinit_color - if [ -f $colornumber_file ]; then - colornumber=`cat $colornumber_file` - fi - tput_color="$(tput setaf $colornumber)$(tput bold)" - tput_reset="$(tput sgr0)" - # Bash confuses the line length when not told to not count escape sequences. - if [ ! "$BASH" = "" ]; then - tput_color="\[$tput_color\]" - tput_reset="\[$tput_reset\]" - fi - PS1="${tput_color}["\$\(date\ +%Y-%m-%d/%H:%M:%S/%Z\)" $USER@$(hostname):"\$\(pwd\)"]$ $tput_reset" - PS2="${tput_color}> $tput_reset" - PS3="${tput_color}select: $tput_reset" - PS4="${tput_color}+ $tput_reset" - - # Add local additions. - local_shinit_file=~/.shinit_add - if [ -f $local_shinit_file ]; then - . $local_shinit_file - fi - -fi diff --git a/ansible/dotfiles/shinit_color b/ansible/dotfiles/shinit_color deleted file mode 100644 index d00491f..0000000 --- a/ansible/dotfiles/shinit_color +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/ansible/dotfiles/vimrc b/ansible/dotfiles/vimrc deleted file mode 100644 index b1434ed..0000000 --- a/ansible/dotfiles/vimrc +++ /dev/null @@ -1,30 +0,0 @@ -" Activate syntax highlighting. -syntax on -filetype plugin on - -" Number lines. -set number - -" Don't add unsolicited final newline. -set binary - -" Indentation rules (tabs to 4 spaces). -set expandtab -set shiftwidth=2 -set softtabstop=2 - -" Backups. -set backup -set backupdir=~/.vimbackups -let myvar = strftime("%Y-%m-%d_%H-%M-%S") -let myvar = "set backupext=_". myvar -execute myvar - -" Keep syntax highlighting healthy. -autocmd BufEnter * :syntax sync fromstart - -" Mark the 80-th column. -set colorcolumn=80 - -" Source additions -source ~/.vimrc_add diff --git a/ansible/dotfiles/vimrc_add b/ansible/dotfiles/vimrc_add deleted file mode 100644 index e69de29..0000000 diff --git a/ansible/files/___etc___apt___apt.conf.d___99mindeps b/ansible/files/___etc___apt___apt.conf.d___99mindeps deleted file mode 100644 index 4aaef79..0000000 --- a/ansible/files/___etc___apt___apt.conf.d___99mindeps +++ /dev/null @@ -1,4 +0,0 @@ -APT::AutoRemove::RecommendsImportant "false"; -APT::AutoRemove::SuggestsImportant "false"; -APT::Install-Recommends "false"; -APT::Install-Suggests "false"; diff --git a/ansible/files/___etc___apt___sources.list b/ansible/files/___etc___apt___sources.list deleted file mode 100644 index e64d6ee..0000000 --- a/ansible/files/___etc___apt___sources.list +++ /dev/null @@ -1,4 +0,0 @@ -deb http://ftp.debian.org/debian/ stretch main contrib non-free -deb http://ftp.debian.org/debian/ stretch-updates main contrib non-free -deb http://ftp.debian.org/debian stretch-backports main contrib non-free -deb http://security.debian.org/ stretch/updates main contrib non-free diff --git a/ansible/files/___etc___default___console-setup b/ansible/files/___etc___default___console-setup deleted file mode 100644 index 090d241..0000000 --- a/ansible/files/___etc___default___console-setup +++ /dev/null @@ -1,4 +0,0 @@ -CHARMAP="UTF-8" -CODESET="Lat15" -FONTFACE="Terminus" -FONTSIZE="6x12" diff --git a/ansible/files/___etc___default___keyboard b/ansible/files/___etc___default___keyboard deleted file mode 100644 index b8f918b..0000000 --- a/ansible/files/___etc___default___keyboard +++ /dev/null @@ -1 +0,0 @@ -XKBLAYOUT="de" diff --git a/ansible/files/___etc___hostname b/ansible/files/___etc___hostname deleted file mode 100644 index 8769fca..0000000 --- a/ansible/files/___etc___hostname +++ /dev/null @@ -1 +0,0 @@ -w530 diff --git a/ansible/files/___etc___hosts b/ansible/files/___etc___hosts deleted file mode 100644 index d920e4f..0000000 --- a/ansible/files/___etc___hosts +++ /dev/null @@ -1,7 +0,0 @@ -127.0.0.1 localhost -127.0.1.1 w530 - -# The following lines are desirable for IPv6 capable hosts -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters diff --git a/ansible/files/___etc___profile b/ansible/files/___etc___profile deleted file mode 100644 index 5884d7b..0000000 --- a/ansible/files/___etc___profile +++ /dev/null @@ -1,35 +0,0 @@ -# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) -# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). - -if [ "`id -u`" -eq 0 ]; then - PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" -else - PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" -fi -export PATH - -if [ "${PS1-}" ]; then - if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then - # The file bash.bashrc already sets the default PS1. - # PS1='\h:\w\$ ' - if [ -f /etc/bash.bashrc ]; then - . /etc/bash.bashrc - fi - else - if [ "`id -u`" -eq 0 ]; then - PS1='# ' - else - PS1='$ ' - fi - fi -fi - -if [ -d /etc/profile.d ]; then - for i in /etc/profile.d/*.sh; do - if [ -r $i ]; then - . $i - fi - done - unset i -fi -export LC_ALL="en_US.UTF-8" diff --git a/ansible/files/___etc___timezone b/ansible/files/___etc___timezone deleted file mode 100644 index 94d5acc..0000000 --- a/ansible/files/___etc___timezone +++ /dev/null @@ -1 +0,0 @@ -Europe/Berlin diff --git a/ansible/files/console/___etc___default___console-setup b/ansible/files/console/___etc___default___console-setup new file mode 100644 index 0000000..090d241 --- /dev/null +++ b/ansible/files/console/___etc___default___console-setup @@ -0,0 +1,4 @@ +CHARMAP="UTF-8" +CODESET="Lat15" +FONTFACE="Terminus" +FONTSIZE="6x12" diff --git a/ansible/files/console/___etc___default___keyboard b/ansible/files/console/___etc___default___keyboard new file mode 100644 index 0000000..b8f918b --- /dev/null +++ b/ansible/files/console/___etc___default___keyboard @@ -0,0 +1 @@ +XKBLAYOUT="de" diff --git a/ansible/files/dotfiles/bashrc b/ansible/files/dotfiles/bashrc new file mode 100644 index 0000000..4dc08f7 --- /dev/null +++ b/ansible/files/dotfiles/bashrc @@ -0,0 +1,5 @@ +# Bash as a non-login shell in non-POSIX-mode does not read in the startup +# script at the path in $ENV. This forces it to still read in the ~/.shinit +# startup script for non-login shells. + +. ~/.shinit diff --git a/ansible/files/dotfiles/gitconfig b/ansible/files/dotfiles/gitconfig new file mode 100644 index 0000000..5cdc162 --- /dev/null +++ b/ansible/files/dotfiles/gitconfig @@ -0,0 +1,3 @@ +[user] + name = Christian Heller + email = c.heller@plomlompom.de diff --git a/ansible/files/dotfiles/profile b/ansible/files/dotfiles/profile new file mode 100644 index 0000000..5a58435 --- /dev/null +++ b/ansible/files/dotfiles/profile @@ -0,0 +1,6 @@ +# Initialization for login shells. + +# Tell interactive shells to look in ~/.shinit for setup. +ENV=$HOME/.shinit +export ENV +. $ENV diff --git a/ansible/files/dotfiles/shinit b/ansible/files/dotfiles/shinit new file mode 100644 index 0000000..25d1396 --- /dev/null +++ b/ansible/files/dotfiles/shinit @@ -0,0 +1,37 @@ +# Settings for interactive shells. + +# Ensure shell truly is interactive to avoid confusing non-interactive shells. +if [[ $- == *i* ]]; then + + # Fancy colors for ls. + alias ls="ls --color=auto" + + # Use vim as default editor for anything. + export VISUAL=vim + export EDITOR=$VISUAL + + # Colored prompt with username, hostname, date/time, directory. + colornumber=7 # Default to white if no color set via colornumber dotfile. + colornumber_file=~/.shinit_color + if [ -f $colornumber_file ]; then + colornumber=`cat $colornumber_file` + fi + tput_color="$(tput setaf $colornumber)$(tput bold)" + tput_reset="$(tput sgr0)" + # Bash confuses the line length when not told to not count escape sequences. + if [ ! "$BASH" = "" ]; then + tput_color="\[$tput_color\]" + tput_reset="\[$tput_reset\]" + fi + PS1="${tput_color}["\$\(date\ +%Y-%m-%d/%H:%M:%S/%Z\)" $USER@$(hostname):"\$\(pwd\)"]$ $tput_reset" + PS2="${tput_color}> $tput_reset" + PS3="${tput_color}select: $tput_reset" + PS4="${tput_color}+ $tput_reset" + + # Add local additions. + local_shinit_file=~/.shinit_add + if [ -f $local_shinit_file ]; then + . $local_shinit_file + fi + +fi diff --git a/ansible/files/dotfiles/shinit_color b/ansible/files/dotfiles/shinit_color new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/ansible/files/dotfiles/shinit_color @@ -0,0 +1 @@ +1 diff --git a/ansible/files/dotfiles/vimrc b/ansible/files/dotfiles/vimrc new file mode 100644 index 0000000..b1434ed --- /dev/null +++ b/ansible/files/dotfiles/vimrc @@ -0,0 +1,30 @@ +" Activate syntax highlighting. +syntax on +filetype plugin on + +" Number lines. +set number + +" Don't add unsolicited final newline. +set binary + +" Indentation rules (tabs to 4 spaces). +set expandtab +set shiftwidth=2 +set softtabstop=2 + +" Backups. +set backup +set backupdir=~/.vimbackups +let myvar = strftime("%Y-%m-%d_%H-%M-%S") +let myvar = "set backupext=_". myvar +execute myvar + +" Keep syntax highlighting healthy. +autocmd BufEnter * :syntax sync fromstart + +" Mark the 80-th column. +set colorcolumn=80 + +" Source additions +source ~/.vimrc_add diff --git a/ansible/files/dotfiles/vimrc_add b/ansible/files/dotfiles/vimrc_add new file mode 100644 index 0000000..e69de29 diff --git a/ansible/files/system/___etc___apt___apt.conf.d___99mindeps b/ansible/files/system/___etc___apt___apt.conf.d___99mindeps new file mode 100644 index 0000000..4aaef79 --- /dev/null +++ b/ansible/files/system/___etc___apt___apt.conf.d___99mindeps @@ -0,0 +1,4 @@ +APT::AutoRemove::RecommendsImportant "false"; +APT::AutoRemove::SuggestsImportant "false"; +APT::Install-Recommends "false"; +APT::Install-Suggests "false"; diff --git a/ansible/files/system/___etc___apt___sources.list b/ansible/files/system/___etc___apt___sources.list new file mode 100644 index 0000000..e64d6ee --- /dev/null +++ b/ansible/files/system/___etc___apt___sources.list @@ -0,0 +1,4 @@ +deb http://ftp.debian.org/debian/ stretch main contrib non-free +deb http://ftp.debian.org/debian/ stretch-updates main contrib non-free +deb http://ftp.debian.org/debian stretch-backports main contrib non-free +deb http://security.debian.org/ stretch/updates main contrib non-free diff --git a/ansible/files/system/___etc___hostname b/ansible/files/system/___etc___hostname new file mode 100644 index 0000000..8769fca --- /dev/null +++ b/ansible/files/system/___etc___hostname @@ -0,0 +1 @@ +w530 diff --git a/ansible/files/system/___etc___hosts b/ansible/files/system/___etc___hosts new file mode 100644 index 0000000..d920e4f --- /dev/null +++ b/ansible/files/system/___etc___hosts @@ -0,0 +1,7 @@ +127.0.0.1 localhost +127.0.1.1 w530 + +# The following lines are desirable for IPv6 capable hosts +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters diff --git a/ansible/files/system/___etc___profile b/ansible/files/system/___etc___profile new file mode 100644 index 0000000..5884d7b --- /dev/null +++ b/ansible/files/system/___etc___profile @@ -0,0 +1,35 @@ +# /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) +# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). + +if [ "`id -u`" -eq 0 ]; then + PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +else + PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games" +fi +export PATH + +if [ "${PS1-}" ]; then + if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then + # The file bash.bashrc already sets the default PS1. + # PS1='\h:\w\$ ' + if [ -f /etc/bash.bashrc ]; then + . /etc/bash.bashrc + fi + else + if [ "`id -u`" -eq 0 ]; then + PS1='# ' + else + PS1='$ ' + fi + fi +fi + +if [ -d /etc/profile.d ]; then + for i in /etc/profile.d/*.sh; do + if [ -r $i ]; then + . $i + fi + done + unset i +fi +export LC_ALL="en_US.UTF-8" diff --git a/ansible/files/system/___etc___timezone b/ansible/files/system/___etc___timezone new file mode 100644 index 0000000..94d5acc --- /dev/null +++ b/ansible/files/system/___etc___timezone @@ -0,0 +1 @@ +Europe/Berlin