summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2018-08-21 13:55:00 +0200
committerJonathan Bauer2018-08-21 13:55:00 +0200
commita772c3f2e16a49eeea28697309014990b88bea0e (patch)
tree29113bc86a109147563e4a1c52bb7c544973db8d
parentrenamed 'dracut-initramfs-builder' to 'slx-builder' (diff)
downloadansible-dracut-a772c3f2e16a49eeea28697309014990b88bea0e.tar.gz
ansible-dracut-a772c3f2e16a49eeea28697309014990b88bea0e.tar.xz
ansible-dracut-a772c3f2e16a49eeea28697309014990b88bea0e.zip
[slx-builder] introduce tags 'install' and 'build'
-rw-r--r--slx-builder/meta/main.yml4
-rw-r--r--slx-builder/tasks/dnbd3-fixes.yml4
-rw-r--r--slx-builder/tasks/main.yml38
-rw-r--r--slx-builder/vars/main.yml6
4 files changed, 14 insertions, 38 deletions
diff --git a/slx-builder/meta/main.yml b/slx-builder/meta/main.yml
index bfd43d5..8a525a6 100644
--- a/slx-builder/meta/main.yml
+++ b/slx-builder/meta/main.yml
@@ -1,4 +1,4 @@
---
dependencies:
- - { role: setup-dev-tools }
- - { role: disable-selinux, when: ansible_os_family == 'RedHat' }
+ - { role: setup-dev-tools, tags: [install] }
+ - { role: disable-selinux, tags: [build], when: ansible_os_family == 'RedHat' }
diff --git a/slx-builder/tasks/dnbd3-fixes.yml b/slx-builder/tasks/dnbd3-fixes.yml
index e9bd6dd..6cc8e1c 100644
--- a/slx-builder/tasks/dnbd3-fixes.yml
+++ b/slx-builder/tasks/dnbd3-fixes.yml
@@ -1,7 +1,7 @@
---
- name: Hack fix dnbd3 blk.c for Ubuntu newer kernels
replace:
- dest: "{{ gittarget }}/builder/modules.d/dnbd3-rootfs/scripts/build.sh"
+ dest: "{{ builder_path | dirname }}/modules.d/dnbd3-rootfs/scripts/build.sh"
regexp: 'make -j4 dnbd3 dnbd3-client'
replace: 'sed -i "s/backing_dev_info.ra_pages/backing_dev_info->ra_pages/g" blk.c && make -j4 dnbd3 dnbd3-client'
backup: yes
@@ -9,7 +9,7 @@
- ansible_distribution == "Ubuntu"
- name: Hack fix dnbd3 blk.h for CentOS kernels with backports
replace:
- dest: "{{ gittarget }}/builder/modules.d/dnbd3-rootfs/scripts/build.sh"
+ dest: "{{ builder_path | dirname }}/modules.d/dnbd3-rootfs/scripts/build.sh"
regexp: 'make -j4 dnbd3 dnbd3-client'
replace: 'sed -i "s/KERNEL_VERSION.*/KERNEL_VERSION\(3, 10, 0\)/g" blk.h && make -j4 dnbd3 dnbd3-client'
backup: yes
diff --git a/slx-builder/tasks/main.yml b/slx-builder/tasks/main.yml
index fe64b37..c6e690f 100644
--- a/slx-builder/tasks/main.yml
+++ b/slx-builder/tasks/main.yml
@@ -1,34 +1,8 @@
---
-- include: tasks/distro.yml
+- import_tasks: tasks/install.yml
+ tags:
+ - install
-- name: Install dependencies for OpenSLX dracut module
- package: name={{ item }} state=installed
- with_items: "{{ pkgnames }}"
-
-- name: Checkout repository of OpenSLX dracut module
- git:
- repo: "{{ gitsource }}"
- dest: "{{ gittarget }}"
- depth: 1
-
-- include: tasks/dnbd3-fixes.yml
-
-- name: Build initramfs with dracut
- shell: "{{ gittarget }}/builder/build-initramfs.sh -s -d -p {{ gittarget }}/initramfs - --add 'kexec-reboot'"
- args:
- creates: "{{ gittarget }}/initramfs"
-
-- name: Fetch built initramfs and kernel (+ hack for weird /@ prefix of BOOT_IMAGE)
- fetch:
- src: "{{ item }}"
- dest: "{{ playbook_dir }}/boot_files/"
- fail_on_missing: yes
- flat: yes
- with_items:
- - "{{ gittarget }}/initramfs"
- - "{{ ansible_cmdline.BOOT_IMAGE | regex_replace('^/@(/boot/.*)+$', '\\1') }}"
-
-- name: Cleanup
- file:
- path: "{{ gittarget }}"
- state: absent
+- import_tasks: tasks/build.yml
+ tags:
+ - build
diff --git a/slx-builder/vars/main.yml b/slx-builder/vars/main.yml
index e8f7c48..b37cb37 100644
--- a/slx-builder/vars/main.yml
+++ b/slx-builder/vars/main.yml
@@ -1,2 +1,4 @@
-gitsource: "git://git.openslx.org/openslx-ng/systemd-init"
-gittarget: "/opt/systemd-init"
+builder_url: "http://git.openslx.org/openslx-ng/systemd-init.git/plain/builder/build-initramfs.sh"
+builder_checksum: "sha256:adcded46a08d433ae13304a27cfbd650f9abcf4298eec5934f2647e9b828bb9e"
+builder_path: "/opt/systemd-init/build-initramfs.sh"
+builder_target: "{{ builder_path | dirname }}/initramfs"