From 95993c623d680f22cd30565ba1e3b20373ffb7b0 2023-08-29 18:44:35 From: x Date: 2023-08-29 18:44:35 Subject: [PATCH] feat: initial_server, replace colorful PS1 w/ color+feat for root bashrc --- diff --git a/initial_server_setup/initial_setup.yml b/initial_server_setup/initial_setup.yml index d29d86365ec7f905015bfa7c41bc95e27e774f67..780347abf92ee3a75c56af11ad6f39068de916e1 100644 --- a/initial_server_setup/initial_setup.yml +++ b/initial_server_setup/initial_setup.yml @@ -129,24 +129,14 @@ name: "root" shell: /bin/bash tags: users - - name: Add colorful PS1 in default bashrc + - name: Add color etc. into root bashrc ansible.builtin.blockinfile: - path: /etc/bash.bashrc - state: absent - marker: "# {mark} ANSIBLE MANAGED BLOCK / Colorful PS1" - block: | - case "$TERM" in - xterm-color|*-256color) color_prompt=yes;; - esac - - if [ "$color_prompt" = yes ]; then - PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' - else - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' - fi - unset color_prompt force_color_prompt + marker: "# {mark} ANSIBLE MANAGED BLOCK / Enhanced root bashrc" + block: "{{ lookup('ansible.builtin.file', '{{ server_config_dir }}/bashrc_root_config') }}" + path: /root/.bashrc tags: users + - name: Add SSH key for users from vars ansible.posix.authorized_key: user: "{{ item.username }}"