Переместил хлам в trash, переименовал ansible-base в base-system, добавил добавление юзера и группы, а также правку sudoers, сделал возможность запуска base-system не от рута
This commit is contained in:
32
ansible/base-system/roles/configs/tasks/main.yml
Normal file
32
ansible/base-system/roles/configs/tasks/main.yml
Normal 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
|
||||
|
||||
|
||||
36
ansible/base-system/roles/configs/tasks/root.yml
Normal file
36
ansible/base-system/roles/configs/tasks/root.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- name: Create wheel group
|
||||
group:
|
||||
name: wheel
|
||||
state: present
|
||||
- name: Create losted user
|
||||
user:
|
||||
name: losted
|
||||
state: present
|
||||
group: wheel
|
||||
shell: /bin/bash
|
||||
|
||||
- name: Set NOPASSWORD in sudoers
|
||||
lineinfile:
|
||||
dest: /etc/sudoers
|
||||
state: present
|
||||
regexp: '^%sudo'
|
||||
line: '%sudo ALL=(ALL) NOPASSWD: ALL'
|
||||
validate: 'visudo -cf %s'
|
||||
|
||||
- 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: Put vim config
|
||||
template:
|
||||
src: files/vimrc
|
||||
dest: /etc/vimrc
|
||||
- name: Put screen config
|
||||
template:
|
||||
src: files/screenrc
|
||||
dest: /etc/screenrc
|
||||
Reference in New Issue
Block a user