From 0690f7decc4d1b305857225d2b20d0fb5509a2e9 Mon Sep 17 00:00:00 2001 From: lulzette Date: Sun, 11 Dec 2022 13:37:51 +0000 Subject: [PATCH] Tweaks --- ansible.cfg | 2 +- roles/configs/files/bashrc | 7 +++++-- roles/configs/tasks/root.yml | 15 +++++++++++++++ roles/packages/tasks/main.yml | 1 + roles/ssh/files/sshd_config | 36 ----------------------------------- 5 files changed, 22 insertions(+), 39 deletions(-) diff --git a/ansible.cfg b/ansible.cfg index be5c8f1..e9afcdd 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -2,7 +2,7 @@ INVENTORY = ~/inventory pipelining = True -strategy = free +#strategy = free [ssh_connection] ssh_args = -o ControlMaster=auto -o ControlPersist=60s diff --git a/roles/configs/files/bashrc b/roles/configs/files/bashrc index 3e743e8..f328fd7 100644 --- a/roles/configs/files/bashrc +++ b/roles/configs/files/bashrc @@ -16,8 +16,8 @@ HISTCONTROL=ignoreboth shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) -HISTSIZE=1000 -HISTFILESIZE=2000 +HISTSIZE=100000 +HISTFILESIZE=200000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. @@ -288,3 +288,6 @@ alias apt="sudo apt" export PS1='\e[0;35m\t \e[0;32m\u@\h:\w\e[m\n\$ ' figlet `hostname` +bind '"\e[A": history-search-backward' +bind '"\e[B": history-search-forward' + diff --git a/roles/configs/tasks/root.yml b/roles/configs/tasks/root.yml index a2d553e..765bf62 100644 --- a/roles/configs/tasks/root.yml +++ b/roles/configs/tasks/root.yml @@ -56,3 +56,18 @@ path: /etc/update-motd.d/10-help-text mode: 644 when: ansible_facts['os_family'] == "Debian" + +- name: Check for OMB + stat: + path: "{{ ansible_user_dir }}/.oh-my-bash" + register: omb_flag_root + +- debug: + msg: 'OMB is not installed for root' + when: not omb_flag_root.stat.exists + +- name: Put simple bashrc config + template: + src: files/bashrc + dest: "/root/.bashrc" + when: not omb_flag_root.stat.exists diff --git a/roles/packages/tasks/main.yml b/roles/packages/tasks/main.yml index 009e97f..2a312e3 100644 --- a/roles/packages/tasks/main.yml +++ b/roles/packages/tasks/main.yml @@ -27,6 +27,7 @@ notify: - Make initramfs when: ansible_facts['os_family'] == "Debian" + ignore_errors: true # TODO - name: Install CentOS epel yum: diff --git a/roles/ssh/files/sshd_config b/roles/ssh/files/sshd_config index 95d5e78..2d30b40 100644 --- a/roles/ssh/files/sshd_config +++ b/roles/ssh/files/sshd_config @@ -3,19 +3,10 @@ Port {{ ssh_port }} #ListenAddress 0.0.0.0 #ListenAddress :: -#HostKey /etc/ssh/ssh_host_rsa_key -#HostKey /etc/ssh/ssh_host_ecdsa_key -#HostKey /etc/ssh/ssh_host_ed25519_key - -# Ciphers and keying -#RekeyLimit default none - # Logging #SyslogFacility AUTH #LogLevel INFO -# Authentication: - #LoginGraceTime 2m PermitRootLogin prohibit-password #StrictModes yes @@ -27,39 +18,12 @@ AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2 /etc/ssh/auth_keys PasswordAuthentication no PermitEmptyPasswords no -# Change to yes to enable challenge-response passwords (beware issues with -# some PAM modules and threads) ChallengeResponseAuthentication no - UsePAM yes - -#AllowAgentForwarding yes -#AllowTcpForwarding yes -#GatewayPorts no X11Forwarding yes -#X11DisplayOffset 10 -#X11UseLocalhost yes -#PermitTTY yes PrintMotd no PrintLastLog yes -#TCPKeepAlive yes -#PermitUserEnvironment no -#Compression delayed -#ClientAliveInterval 0 -#ClientAliveCountMax 3 UseDNS no -#PidFile /var/run/sshd.pid -#MaxStartups 10:30:100 -#PermitTunnel no -#ChrootDirectory none -#VersionAddendum none - -# no default banner path -#Banner none - -# Allow client to pass locale environment variables AcceptEnv LANG LC_* - -# override default of no subsystems Subsystem sftp /usr/lib/openssh/sftp-server