vn-ansible/roles/debian-base/tasks/root.yaml

27 lines
775 B
YAML

- name: Delete default user
user:
name: "{{ default_user }}"
state: absent
remove: yes
- name: Change root password
user:
name: root
password: "{{ ssh_password | password_hash('sha512') }}"
- name: Configure bashrc
lineinfile:
dest: /root/.bashrc
regexp: "{{item.regexp}}"
line: "{{item.line}}"
state: present
with_items:
- regexp: "^# export LS_OPTIONS"
line: "export LS_OPTIONS='--color=auto"
- regexp: "^# eval"
line: 'eval "$(dircolors)"'
- regexp: "^# alias ls='ls $LS_OPTIONS'"
line: "alias ls='ls $LS_OPTIONS'"
- regexp: "^# alias ll='ls $LS_OPTIONS -l'"
line: "alias ll='ls $LS_OPTIONS -l'"
- regexp: "# alias la='ls $LS_OPTIONS -la'"
line: "alias la='ls $LS_OPTIONS -la'"