Changeset - 5f63e04fc9da
[Not reviewed]
0 1 0
x - 20 months ago 2023-08-29 18:32:06
xbr@c3l.lu
feat: initial_server, remove global bashrc edit
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
initial_server_setup/initial_setup.yml
Show inline comments
 
@@ -111,48 +111,49 @@
 
          - sudo
 
        append: true
 
        shell: /bin/bash
 
        state: present
 
      loop: "{{ users_member }}"
 
      tags: users
 
    - name: Create system users (no password)
 
      ansible.builtin.user:
 
        name: "{{ item.username }}"
 
        groups:
 
          - sudo
 
        append: true
 
        shell: /bin/bash
 
        state: present
 
      loop: "{{ users_system }}"
 
      tags: users
 
    - name: Change shell for root to bash
 
      ansible.builtin.user:
 
        name: "root"
 
        shell: /bin/bash
 
      tags: users
 
    - name: Add colorful PS1 in default 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
 
      tags: users
 

	
 
    - name: Add SSH key for users from vars
 
      ansible.posix.authorized_key:
 
        user: "{{ item.username }}"
 
        state: present
 
        key: "{{ lookup('file', item.key_path) }}"
 
      tags: users
 
      loop: "{{ users_member | union(users_system) }}"
 

	
 
    - name: Allow for password-less sudo
 
      community.general.sudoers:
0 comments (0 inline, 0 general)