From e1d11da2fb9ecbfbdf57370e4da9b7e944fc828b Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Fri, 12 May 2017 19:30:53 +0000 Subject: [PATCH] current --- defaults/main.yml | 8 ++++--- tasks/main.yml | 42 ++++++++++++++++----------------- templates/common.list.chroot.j2 | 4 ++-- templates/custom.list.chroot.j2 | 2 +- templates/isolinux.cfg.j2 | 2 +- templates/lb-config-args.j2 | 12 +++++----- vars/main.yml | 39 ++++++++++++++++++++++++++++-- 7 files changed, 73 insertions(+), 36 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index def9d97..8058558 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,5 @@ -live_build_serial: no -live_build_bootappend_live: boot=live components quiet {{ live_build_serial | ternary('console=ttyS0','') }} hostname={{ live_build_hostname }} -live_build_hostname: "{{ inventory_hostname }}" \ No newline at end of file +debian_mirror: http://deb.debian.org/debian + +debian_live_build_serial_console: false +debian_live_build_bootappend_live: boot=live components quiet {{ debian_live_build_serial_console | ternary('console=ttyS0','') }} hostname={{ debian_live_build_hostname }} +debian_live_build_hostname: "{{ inventory_hostname }}" diff --git a/tasks/main.yml b/tasks/main.yml index 4a069cb..b95c910 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -12,91 +12,91 @@ - memtest86 - memtest86+ -- name: live build directory +- name: debian live-build directory file: - path: "{{ live_build_directory }}" + path: "{{ debian_live_build_directory }}" state: directory - name: remove config directory file: - path: "{{ live_build_directory }}/config" + path: "{{ debian_live_build_directory }}/config" state: absent - name: lb clean command: lb clean args: - chdir: "{{ live_build_directory }}" + chdir: "{{ debian_live_build_directory }}" + when: live_build_clean is defined and live_build_clean - name: lb config command: lb config {{ lookup('template','lb-config-args.j2') }} args: - chdir: "{{ live_build_directory }}" + chdir: "{{ debian_live_build_directory }}" - name: ssh root access include_role: name: ssh_root_access vars: - root_target_directory: "{{ live_build_directory }}/config/includes.chroot/" + root_target_directory: "{{ debian_live_build_directory }}/config/includes.chroot/" - name: keyboard configuration include_role: name: keyboard_configuration vars: - root_target_directory: "{{ live_build_directory }}/config/includes.chroot/" - when: live_build_serial == false + root_target_directory: "{{ debian_live_build_directory }}/config/includes.chroot/" + when: debian_live_build_serial_console == false - name: include common packages template: src: common.list.chroot.j2 - dest: "{{ live_build_directory }}/config/package-lists/common.list.chroot" + dest: "{{ debian_live_build_directory }}/config/package-lists/common.list.chroot" - name: include console-setup package copy: content: console-setup - dest: "{{ live_build_directory }}/config/package-lists/console-setup.list.chroot" - when: live_build_serial == false + dest: "{{ debian_live_build_directory }}/config/package-lists/console-setup.list.chroot" + when: debian_live_build_serial_console == false - name: include custom packages template: src: custom.list.chroot.j2 - dest: "{{ live_build_directory }}/config/package-lists/custom.list.chroot" - when: live_build_custom_packages is defined + dest: "{{ debian_live_build_directory }}/config/package-lists/custom.list.chroot" + when: debian_live_build_custom_packages is defined - name: isolinx directory file: - path: "{{ live_build_directory }}/config/includes.binary/isolinux" + path: "{{ debian_live_build_directory }}/config/includes.binary/isolinux" state: directory - name: isolinux.cfg template: src: isolinux.cfg.j2 - dest: "{{ live_build_directory }}/config/includes.binary/isolinux/isolinux.cfg" + dest: "{{ debian_live_build_directory }}/config/includes.binary/isolinux/isolinux.cfg" - name: fix debian jessie generate ssh host ed25519 keys directory file: - path: "{{ live_build_directory }}/config/includes.chroot/lib/live/config" + path: "{{ debian_live_build_directory }}/config/includes.chroot/lib/live/config" state: directory when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' - name: fix debian jessie generate ssh host ed25519 keys copy: src: 1160-openssh-server - dest: "{{ live_build_directory }}/config/includes.chroot/lib/live/config/1160-openssh-server" + dest: "{{ debian_live_build_directory }}/config/includes.chroot/lib/live/config/1160-openssh-server" mode: 755 when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' - + - name: lb build command: lb build args: - chdir: "{{ live_build_directory }}" + chdir: "{{ debian_live_build_directory }}" register: _lb_build - name: save build log copy: content: "{{ _lb_build.stdout }}" - dest: "{{ live_build_directory }}/build.log" - + dest: "{{ debian_live_build_directory }}/build.log" diff --git a/templates/common.list.chroot.j2 b/templates/common.list.chroot.j2 index 00f3b68..7f87c6a 100644 --- a/templates/common.list.chroot.j2 +++ b/templates/common.list.chroot.j2 @@ -1,3 +1,3 @@ -{% for package in live_build_common_packages %} -{{package}} +{% for package in debian_live_build_common_packages %} +{{ package }} {% endfor %} diff --git a/templates/custom.list.chroot.j2 b/templates/custom.list.chroot.j2 index da979d9..439b8cb 100644 --- a/templates/custom.list.chroot.j2 +++ b/templates/custom.list.chroot.j2 @@ -1,3 +1,3 @@ -{% for package in live_build_custom_packages %} +{% for package in debian_live_build_custom_packages %} {{package}} {% endfor %} diff --git a/templates/isolinux.cfg.j2 b/templates/isolinux.cfg.j2 index 7b8b546..6a41761 100644 --- a/templates/isolinux.cfg.j2 +++ b/templates/isolinux.cfg.j2 @@ -1,5 +1,5 @@ include live.cfg default live-amd64 -{% if live_build_serial == true %} +{% if debian_live_build_serial_console == true %} serial 0 {% endif %} diff --git a/templates/lb-config-args.j2 b/templates/lb-config-args.j2 index 606c597..12ec36c 100644 --- a/templates/lb-config-args.j2 +++ b/templates/lb-config-args.j2 @@ -1,11 +1,11 @@ -{% if live_build_distribution is defined %} ---distribution "{{ live_build_distribution }}" +{% if debian_live_build_distribution is defined %} +--distribution "{{ debian_live_build_distribution }}" {% endif %} -{% if live_build_archive_areas is defined %} ---archive-areas "{{ live_build_archive_areas | join(' ') }}" +{% if debian_live_build_archive_areas is defined %} +--archive-areas "{{ debian_live_build_archive_areas | join(' ') }}" {% endif %} --mirror-bootstrap {{ debian_mirror }} --mirror-binary {{ debian_mirror }} -{% if live_build_bootappend_live is defined %} ---bootappend-live "{{ live_build_bootappend_live }}" +{% if debian_live_build_bootappend_live is defined %} +--bootappend-live "{{ debian_live_build_bootappend_live }}" {% endif %} diff --git a/vars/main.yml b/vars/main.yml index 70a6dc2..6ba9744 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,38 @@ -live_build_common_packages: - - task-ssh-server +debian_live_build_common_packages: + - openssh-server - python + + # hardware utils + - pciutils + - usbutils + - acpi + + # admin tools + - tmux + - rsync + - lsof + - vim + - pv + - less + + # network tools + - iputils-ping + - whois + - nmap + - tcpdump + + - dnsutils + # admin tools + - tmux + - rsync + - lsof + - vim + - pv + - less + + # network tools + - iputils-ping + - whois + - nmap + - tcpdump + - dnsutils