aboutsummaryrefslogtreecommitdiffstats
path: root/roles/common/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/common/tasks')
-rw-r--r--roles/common/tasks/init_alpine.yml38
-rw-r--r--roles/common/tasks/init_openbsd.yml10
-rw-r--r--roles/common/tasks/main.yml35
3 files changed, 60 insertions, 23 deletions
diff --git a/roles/common/tasks/init_alpine.yml b/roles/common/tasks/init_alpine.yml
new file mode 100644
index 0000000..68689bc
--- /dev/null
+++ b/roles/common/tasks/init_alpine.yml
@@ -0,0 +1,38 @@
+
+# common ~~ tasks/init_alpine.yml
+# specific tasks for Alpine initalization
+
+---
+
+- name: Setup repositories for Alpine
+ shell: |
+ echo "https://mirror.ungleich.ch/mirror/packages/alpine/edge/main/" > /etc/apk/repositories
+ echo "https://mirror.ungleich.ch/mirror/packages/alpine/edge/community/" >> /etc/apk/repositories
+ echo "https://mirror.ungleich.ch/mirror/packages/alpine/edge/releases/" >> /etc/apk/repositories
+
+- name: Download virtio_vmmci
+ git:
+ repo: "https://github.com/voutilad/virtio_vmmci"
+ dest: /data/git/virtio_vmmci
+
+- name: Install virtio_vmmci
+ shell: make && make install && modprobe virtio_vmmci
+ args:
+ chdir: /data/git/virtio_vmmci
+
+- name: Enable virtio_vmmci module
+ shell: echo "virtio_vmmci" > /etc/modules-load.d/virtio_vmmci.conf
+
+- name: Download vmm_clock module
+ git:
+ repo: "https://github.com/voutilad/vmm_clock"
+ dest: /data/git/vmm_clock
+
+- name: Install vmm_clock module
+ shell: make && make install && modprobe vmm_clock
+ args:
+ chdir: /data/git/vmm_clock
+
+- name: Enable vmm_clock module
+ shell: echo "vmm_clock" > /etc/modules-load.d/vmm_clock.conf
+
diff --git a/roles/common/tasks/init_openbsd.yml b/roles/common/tasks/init_openbsd.yml
new file mode 100644
index 0000000..d4dae41
--- /dev/null
+++ b/roles/common/tasks/init_openbsd.yml
@@ -0,0 +1,10 @@
+
+# common ~~ tasks/init_alpine.yml
+# specific tasks for Openbsd initalization
+
+---
+
+- name: Setup repositories for Openbsd
+ shell: echo "https://mirror.ungleich.ch/pub/OpenBSD/" > /etc/installurl
+
+
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index acbcb1c..1bc657f 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -3,38 +3,30 @@
---
-- name: Setup repositories for Alpine
- shell: |
- echo "https://mirror.ungleich.ch/mirror/packages/alpine/edge/main/" > /etc/apk/repositories
- echo "https://mirror.ungleich.ch/mirror/packages/alpine/edge/community/" >> /etc/apk/repositories
- echo "https://mirror.ungleich.ch/mirror/packages/alpine/edge/releases/" >> /etc/apk/repositories
- when: "'alpine' in group_names"
-
-- name: Check installation of package "{{ item }}"
+- name: Check installation of packages
package:
name: "{{ item }}"
state: present
+ loop: "{{ common_packages +lookup('vars', 'common_packages_' + ansible_distribution | lower) }}"
+ ignore_errors: true
+- name: Check existence of primary directory
+ file:
+ path: /data/{{ item }}
+ state: directory
loop:
- - "{{ packages.zsh }}"
- - "{{ packages.curl }}"
- - "{{ packages.tmux }}"
- - "{{ packages.wget }}"
- - "{{ packages.figlet }}"
- - "{{ packages.neovim }}"
- - "{{ packages.pip }}"
- - util-linux
- - shadow
+ - git
- ignore_errors: yes
+- include: "init_{{ ansible_distribution | lower }}.yml"
+ ignore_errors: true
- name: Copy zshrc configuration file
copy:
src: zshrc
dest: "{{ path_zshrc }}"
owner: root
- group: "{{ group.root }}"
+ group: "{{ group_root }}"
mode: 0644
- name: Copy tmux configuration file
@@ -42,7 +34,7 @@
src: tmux.conf
dest: /etc/tmux.conf
owner: root
- group: "{{ group.root }}"
+ group: "{{ group_root }}"
mode: 0644
- name: Synchronize host hostname with config hostname
@@ -53,9 +45,6 @@
shell: awk -F ":" '{ if($3 == 0 || $3 > 999 && $3 < 16000) { print $1 }}' /etc/passwd
register: valid_users_shell
-- debug:
- var: valid_users_shell.stdout
-
- name: Change shell for all valid users to zsh
user:
name: "{{ item }}"
remember that computers suck.