General Improvements (#36)

* Add at and reword comment.

* Add cronie, thought this was already done but last pull request got wonky.

* Zypper is not happy about asking Brave repo to be added multiple times.

* Replace deprecated `include` commands.

* Add gcc.

* Add another cc command for openSUSE.

* include_tasks is not supporting ignore_errors like include used to, move to individual tasks.

* Do a better job of removing libreoffice from local package manager.

* Enhance reports.

* Add basic VIM setup.

* Undo some lynis changes, fix folder permissions so users can view.

* Change lynis back to chdir and local execution.

* Add doas.

* Add check against old usage of setup.sh BRANCH.

* Greatly reduce number of tasks, create temp file while building report.

* Create temp file while building report.
This commit is contained in:
2023-02-19 10:04:10 -06:00
committed by GitHub
parent 904dda6883
commit b162731c29
15 changed files with 211 additions and 80 deletions

View File

@ -0,0 +1,53 @@
---
# Install and configure doas.
- name: General | Software | DoAs | Facts
set_fact:
doas_config: |
permit persist :wheel as root
permit persist :admin as root
permit persist :sudo as root
doas_conf_file_linux: /etc/doas.conf
doas_conf_file_bsd: /usr/local/etc/doas.conf
- name: General | Software | DoAs | Install
package:
name:
- doas
ignore_errors: yes
- name: General | Software | DoAs | Configure [Linux]
blockinfile:
path: "{{ doas_conf_file_linux }}"
block: |
{{ doas_config }}
marker: '# {mark} MANAGED BY ANSIBLE | doas Linux'
state: present
create: yes
backup: yes
when: ansible_system in ("Linux")
- name: General | Software | DoAs | Configure [BSD]
blockinfile:
path: "{{ doas_conf_file_linux }}"
block: |
{{ doas_config }}
marker: '# {mark} MANAGED BY ANSIBLE | doas BSD'
state: present
create: yes
backup: yes
when: ansible_system in ("FreeBSD")
- name: General | Software | DoAs | Configure [Other]
blockinfile:
path: "{{ item }}"
block: |
{{ doas_config }}
marker: '# {mark} MANAGED BY ANSIBLE | doas Other'
state: present
create: yes
backup: yes
loop:
- "{{ doas_conf_file_linux }}"
- "{{ doas_conf_file_bsd }}"
when: ansible_system not in ("Linux", "FreeBSD")

View File

@ -102,6 +102,7 @@
- "{{ user_user.home }}/LBRY"
- "{{ user_user.home }}/TRASH"
- "{{ user_user.home }}/Downloads"
- "{{ user_user.home }}/Reports"
become_user: "{{ user }}"
when: user_user.home != ""
@ -277,6 +278,7 @@
return
echo "ERROR: Something went wrong while removing Flatpak apps!"
}
alias_vim: alias vi=vim
- name: General | Account Management | Users | Files | Common Variable
set_fact:
@ -302,6 +304,7 @@
{{ function_clean }}
{{ function_flatpak_usage }}
{{ function_flatpak_purge }}
{{ alias_vim }}
- name: General | Account Management | Users | Files | .bashrc
blockinfile:
@ -334,3 +337,28 @@
- "{{ user_user.home }}"
ignore_errors: yes
when: user_root.home != "" and user_user.home != ""
- name: General | Account Management | Users | Files | .vimrc
blockinfile:
path: "{{ item }}/.vimrc"
block: |
" Turn off syntax, flashy lights, etc. Make VIM into a basic editor.
syntax off
set nohlsearch
set noautoindent noautowrite noshowmatch wrapmargin=0 report=1 ts=3
set ignorecase
" Turn off auto-commenting.
autocmd Filetype * set fo-=c fo-=r fo-=o
" qq shortcut for immediately exiting all files without saving.
nnoremap qq :qa!<cr>
marker: '" {mark} MANAGED BY ANSIBLE | vimrc'
state: present
create: yes
backup: yes
loop:
- "{{ user_root.home }}"
- "{{ user_user.home }}"
ignore_errors: yes
when: user_root.home != "" and user_user.home != ""