This commit is contained in:
2022-04-11 12:20:12 +00:00
commit 5ac9ed8242
18 changed files with 846 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
---
- name: Do root tasks
import_tasks: root.yml
become: true
- name: Check for OMB
stat:
path: "{{ ansible_user_dir }}/.oh-my-bash"
register: omb_flag
- debug:
msg: 'OMB is not installed, run: bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"'
when: not omb_flag.stat.exists
- name: Put simple bashrc config
template:
src: files/bashrc
dest: "{{ ansible_user_dir }}/.bashrc"
when: not omb_flag.stat.exists
# - name: Put omb config
#template:
# src: files/omb-bashrc
# dest: "{{ ansible_user_dir }}/.bashrc"
#when: omb_flag.stat.exists
# FIXME: logout from shell
# - name: Install OMB
# shell: bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
# when: not omb_flag.stat.exists

View File

@@ -0,0 +1,56 @@
---
- 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 }}"
- name: Do not show news on login
file:
path: /etc/update-motd.d/50-motd-news
mode: 644
- name: Do not show help on login
file:
path: /etc/update-motd.d/10-help-text
mode: 644