summaryrefslogtreecommitdiffstats
path: root/mltk-core
diff options
context:
space:
mode:
Diffstat (limited to 'mltk-core')
-rw-r--r--mltk-core/defaults/main.yml6
-rw-r--r--mltk-core/tasks/distro/Ubuntu-20.yml13
-rw-r--r--mltk-core/tasks/main.yml41
-rw-r--r--mltk-core/tasks/repo.yml5
-rw-r--r--mltk-core/templates/mltk-config.j24
-rw-r--r--mltk-core/templates/pin-xalt7x-chromium-deb-vaapi.j23
6 files changed, 65 insertions, 7 deletions
diff --git a/mltk-core/defaults/main.yml b/mltk-core/defaults/main.yml
new file mode 100644
index 0000000..9441637
--- /dev/null
+++ b/mltk-core/defaults/main.yml
@@ -0,0 +1,6 @@
+mltk_git_source: "git://git.openslx.org/openslx-ng/mltk"
+mltk_git_target: "/opt/build-env/mltk"
+mltk_git_branch: "installer"
+mltk_nvidia_versions: "390.143 460.73.01"
+mltk_vmware_version: "16.1.1"
+mltk_vbox_version: "6.1.22"
diff --git a/mltk-core/tasks/distro/Ubuntu-20.yml b/mltk-core/tasks/distro/Ubuntu-20.yml
new file mode 100644
index 0000000..23b1219
--- /dev/null
+++ b/mltk-core/tasks/distro/Ubuntu-20.yml
@@ -0,0 +1,13 @@
+- name: Add PPA chromium repo for Ubuntu 20.x
+ apt_repository:
+ repo: ppa:xalt7x/chromium-deb-vaapi
+
+- name: Pin release
+ template:
+ src: templates/pin-xalt7x-chromium-deb-vaapi.j2
+ dest: /etc/apt/preferences.d/pin-xalt7x-chromium-deb-vaapi
+
+- name: Run apt update
+ apt:
+ update_cache: yes
+
diff --git a/mltk-core/tasks/main.yml b/mltk-core/tasks/main.yml
index 95a7cd7..8440943 100644
--- a/mltk-core/tasks/main.yml
+++ b/mltk-core/tasks/main.yml
@@ -1,6 +1,4 @@
---
-- import_tasks: tasks/repo.yml
-
- name: mltk | Install git
package:
name: git
@@ -11,4 +9,43 @@
repo: "{{ mltk_git_source }}"
dest: "{{ mltk_git_target }}"
version: "{{ mltk_git_branch }}"
+ force: yes
+ update: yes
depth: 1
+
+- name: mltk | Create mltk configuration file
+ template:
+ src: templates/mltk-config.j2
+ dest: "{{ mltk_git_target }}/config"
+
+- name: mltk | Patch virtualbox version
+ replace:
+ path: "{{ mltk_git_target }}/core/modules/vbox-src/module.conf"
+ regexp: '^(REQUIRED_VBOX_VERSION=).*'
+ replace: '\g<1>{{ mltk_vbox_version }}'
+
+- name: mltk | Patch vmware16 version
+ replace:
+ path: "{{ mltk_git_target }}/core/modules/vmware16/module.conf"
+ regexp: '^(REQUIRED_VERSION=).*'
+ replace: '\g<1>{{ mltk_vmware_version }}'
+
+- name: mltk | HACKS patch packagemanager.inc to prevent installing recommended packages
+ replace:
+ path: "{{ mltk_git_target }}/core/includes/packagemanager.inc"
+ regexp: '(apt-get install) (-y \${PKG})'
+ replace: '\1 --no-install-recommends \2'
+
+- name: mltk | HACKS patch chroot.inc to include the build environment mount point
+ replace:
+ path: "{{ mltk_git_target }}/core/includes/chroot.inc"
+ regexp: '^(declare -rg CHROOT_BINDMOUNTS=")(/dev[^"]+")'
+ replace: '\1/opt/build-env \2'
+
+- name: mltk | Distro-specific tasks
+ include_tasks: "{{ item }}"
+ with_first_found:
+ - "{{ role_path }}/tasks/distro/{{ ansible_distribution }}-{{ ansible_distribution_version}}.yml"
+ - "{{ role_path }}/tasks/distro/{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml"
+ - "{{ role_path }}/tasks/distro/{{ ansible_distribution }}.yml"
+ ignore_errors: yes
diff --git a/mltk-core/tasks/repo.yml b/mltk-core/tasks/repo.yml
deleted file mode 100644
index b16f97a..0000000
--- a/mltk-core/tasks/repo.yml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-- set_fact:
- mltk_git_source: "git://git.openslx.org/openslx-ng/mltk"
- mltk_git_target: "/opt/mltk"
- mltk_git_branch: "installer"
diff --git a/mltk-core/templates/mltk-config.j2 b/mltk-core/templates/mltk-config.j2
new file mode 100644
index 0000000..d3334cc
--- /dev/null
+++ b/mltk-core/templates/mltk-config.j2
@@ -0,0 +1,4 @@
+export http_proxy=http://132.230.4.234:8123/
+sourceforge_mirror=netcologne
+
+NVIDIA_VERSIONS="{{ mltk_nvidia_versions }}"
diff --git a/mltk-core/templates/pin-xalt7x-chromium-deb-vaapi.j2 b/mltk-core/templates/pin-xalt7x-chromium-deb-vaapi.j2
new file mode 100644
index 0000000..7adc90d
--- /dev/null
+++ b/mltk-core/templates/pin-xalt7x-chromium-deb-vaapi.j2
@@ -0,0 +1,3 @@
+Package: *
+Pin: release o=LP-PPA-xalt7x-chromium-deb-vaapi
+Pin-Priority: 1337