Browse Source

current

master
parent
commit
e1d11da2fb
7 changed files with 73 additions and 36 deletions
  1. +5
    -3
      defaults/main.yml
  2. +21
    -21
      tasks/main.yml
  3. +2
    -2
      templates/common.list.chroot.j2
  4. +1
    -1
      templates/custom.list.chroot.j2
  5. +1
    -1
      templates/isolinux.cfg.j2
  6. +6
    -6
      templates/lb-config-args.j2
  7. +37
    -2
      vars/main.yml

+ 5
- 3
defaults/main.yml View File

@@ -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 }}"
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 }}"

+ 21
- 21
tasks/main.yml View File

@@ -12,91 +12,91 @@
- memtest86 - memtest86
- memtest86+ - memtest86+


- name: live build directory
- name: debian live-build directory
file: file:
path: "{{ live_build_directory }}"
path: "{{ debian_live_build_directory }}"
state: directory state: directory


- name: remove config directory - name: remove config directory
file: file:
path: "{{ live_build_directory }}/config"
path: "{{ debian_live_build_directory }}/config"
state: absent state: absent


- name: lb clean - name: lb clean
command: command:
lb clean lb clean
args: args:
chdir: "{{ live_build_directory }}"
chdir: "{{ debian_live_build_directory }}"
when: live_build_clean is defined and live_build_clean


- name: lb config - name: lb config
command: command:
lb config lb config
{{ lookup('template','lb-config-args.j2') }} {{ lookup('template','lb-config-args.j2') }}
args: args:
chdir: "{{ live_build_directory }}"
chdir: "{{ debian_live_build_directory }}"


- name: ssh root access - name: ssh root access
include_role: include_role:
name: ssh_root_access name: ssh_root_access
vars: vars:
root_target_directory: "{{ live_build_directory }}/config/includes.chroot/"
root_target_directory: "{{ debian_live_build_directory }}/config/includes.chroot/"


- name: keyboard configuration - name: keyboard configuration
include_role: include_role:
name: keyboard_configuration name: keyboard_configuration
vars: 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 - name: include common packages
template: template:
src: common.list.chroot.j2 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 - name: include console-setup package
copy: copy:
content: console-setup 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 - name: include custom packages
template: template:
src: custom.list.chroot.j2 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 - name: isolinx directory
file: file:
path: "{{ live_build_directory }}/config/includes.binary/isolinux"
path: "{{ debian_live_build_directory }}/config/includes.binary/isolinux"
state: directory state: directory


- name: isolinux.cfg - name: isolinux.cfg
template: template:
src: isolinux.cfg.j2 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 - name: fix debian jessie generate ssh host ed25519 keys directory
file: file:
path: "{{ live_build_directory }}/config/includes.chroot/lib/live/config"
path: "{{ debian_live_build_directory }}/config/includes.chroot/lib/live/config"
state: directory state: directory
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie'


- name: fix debian jessie generate ssh host ed25519 keys - name: fix debian jessie generate ssh host ed25519 keys
copy: copy:
src: 1160-openssh-server 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 mode: 755
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie' when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie'
- name: lb build - name: lb build
command: command:
lb build lb build
args: args:
chdir: "{{ live_build_directory }}"
chdir: "{{ debian_live_build_directory }}"
register: _lb_build register: _lb_build


- name: save build log - name: save build log
copy: copy:
content: "{{ _lb_build.stdout }}" content: "{{ _lb_build.stdout }}"
dest: "{{ live_build_directory }}/build.log"

dest: "{{ debian_live_build_directory }}/build.log"

+ 2
- 2
templates/common.list.chroot.j2 View File

@@ -1,3 +1,3 @@
{% for package in live_build_common_packages %}
{{package}}
{% for package in debian_live_build_common_packages %}
{{ package }}
{% endfor %} {% endfor %}

+ 1
- 1
templates/custom.list.chroot.j2 View File

@@ -1,3 +1,3 @@
{% for package in live_build_custom_packages %}
{% for package in debian_live_build_custom_packages %}
{{package}} {{package}}
{% endfor %} {% endfor %}

+ 1
- 1
templates/isolinux.cfg.j2 View File

@@ -1,5 +1,5 @@
include live.cfg include live.cfg
default live-amd64 default live-amd64
{% if live_build_serial == true %}
{% if debian_live_build_serial_console == true %}
serial 0 serial 0
{% endif %} {% endif %}

+ 6
- 6
templates/lb-config-args.j2 View File

@@ -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 %} {% 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 %} {% endif %}
--mirror-bootstrap {{ debian_mirror }} --mirror-bootstrap {{ debian_mirror }}
--mirror-binary {{ 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 %} {% endif %}

+ 37
- 2
vars/main.yml View File

@@ -1,3 +1,38 @@
live_build_common_packages:
- task-ssh-server
debian_live_build_common_packages:
- openssh-server
- python - 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

Loading…
Cancel
Save