Inital commit
Good start Added roles for setting up a user with zsh config and ssh keys Also installation and configuriation of some packages
This commit is contained in:
0
roles/common/files/alpine-repos
Normal file
0
roles/common/files/alpine-repos
Normal file
1
roles/common/files/doas.conf
Normal file
1
roles/common/files/doas.conf
Normal file
@@ -0,0 +1 @@
|
||||
permit nopass siv as root
|
44
roles/common/tasks/main.yml
Normal file
44
roles/common/tasks/main.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
- name: Install and configure packages
|
||||
block:
|
||||
- name: Install the good stuff (pacman)
|
||||
pacman: name={{ packages }} state=latest
|
||||
when: "'pacman' in group_names"
|
||||
tags: pacman
|
||||
- name: Add some repos (alpine)
|
||||
become: yes
|
||||
shell: cmd="cat > /etc/apk/repositories << EOF; $(echo)
|
||||
https://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/main/
|
||||
https://dl-cdn.alpinelinux.org/alpine/v$(cat /etc/alpine-release | cut -d'.' -f1,2)/community/
|
||||
https://dl-cdn.alpinelinux.org/alpine/edge/testing/
|
||||
EOF"
|
||||
when: "'alpine' in group_names"
|
||||
- name: Install the good stuff (apk)
|
||||
apk: name={{ packages }} state=latest
|
||||
when: "'apk' in group_names or 'alpine' in group_names"
|
||||
tags: apk
|
||||
- name: Install the good stuff (apt)
|
||||
apt: package={{ packages }} state=latest
|
||||
when: "'apt' in group_names"
|
||||
tags: apt
|
||||
|
||||
- name: Add /etc/doas.conf
|
||||
copy: src=doas.conf dest=/etc/doas.conf owner=root group=root mode=0644
|
||||
tags: system
|
||||
|
||||
rescue:
|
||||
- name: Uninstall the good stuff (pacman)
|
||||
pacman: name={{ packages }} state=absent
|
||||
when: "'pacman' in group_names"
|
||||
tags: pacman
|
||||
- name: Uninstall the good stuff (apk)
|
||||
apk: name={{ packages }} state=absent
|
||||
when: "'apk' in group_names or 'alpine' in group_names"
|
||||
tags: apk
|
||||
- name: Uninstall the good stuff (apt)
|
||||
apt: package={{ packages }} state=absent
|
||||
when: "'apt' in group_names"
|
||||
tags: apt
|
||||
|
||||
- name: Remove /etc/doas.conf
|
||||
file: state=absent path=/etc/doas.conf
|
||||
tags: system
|
Reference in New Issue
Block a user