base-system/roles/configs/tasks/root.yml

80 lines
1.6 KiB
YAML
Raw Normal View History

2022-04-11 15:20:12 +03:00
---
- name: Create wheel group
group:
name: wheel
state: present
when: "'localgroup' in group_names"
- name: Create losted user
user:
name: losted
state: present
group: wheel
shell: /bin/bash
when: "'localgroup' in group_names"
- name: Set NOPASSWORD in sudoers
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%sudo'
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
validate: 'visudo -cf %s'
when: "'localgroup' in group_names"
- name: Put htop config
template:
src: files/htoprc
dest: /etc/htoprc
- name: Put mc config
template:
src: files/mcrc
dest: /etc/mc/mc.ini
- name: Remove vim root config
become: yes
file:
path: /root/.viminfo
state: absent
- name: Put vim config
template:
src: files/vimrc
dest: /etc/vimrc
- name: Put screen config
template:
src: files/screenrc
dest: /etc/screenrc
- name: Change hostname
ansible.builtin.hostname:
name: "{{ inventory_hostname }}"
2023-09-16 08:41:35 +03:00
2022-04-11 15:20:12 +03:00
- name: Do not show news on login
2023-09-16 08:41:35 +03:00
ignore_errors: true
2022-04-11 15:20:12 +03:00
file:
path: /etc/update-motd.d/50-motd-news
mode: 644
2022-04-26 12:30:03 +03:00
when: ansible_facts['os_family'] == "Debian"
2023-09-16 08:41:35 +03:00
2022-04-11 15:20:12 +03:00
- name: Do not show help on login
2023-09-16 08:41:35 +03:00
ignore_errors: true
2022-04-11 15:20:12 +03:00
file:
path: /etc/update-motd.d/10-help-text
mode: 644
2022-04-26 12:30:03 +03:00
when: ansible_facts['os_family'] == "Debian"
2022-12-11 16:37:51 +03:00
- name: Check for OMB
stat:
path: "{{ ansible_user_dir }}/.oh-my-bash"
register: omb_flag_root
- name: Put simple bashrc config
template:
src: files/bashrc
dest: "/root/.bashrc"
when: not omb_flag_root.stat.exists
2023-09-16 08:41:35 +03:00
- name: Set timezone to Europe/Moscow
community.general.timezone:
name: Europe/Moscow