@@ -1 +0,0 @@ | |||||
*~ |
@@ -1,4 +1,2 @@ | |||||
installer_directory: host_files/{{ inventory_hostname }}/installer | installer_directory: host_files/{{ inventory_hostname }}/installer | ||||
nonfree_firmware: false | nonfree_firmware: false | ||||
img_size: 8 | |||||
memory: 512 |
@@ -1,25 +0,0 @@ | |||||
--- | |||||
dependencies: | |||||
- name: static_host_vars | |||||
static_host_vars_default: | |||||
uuid: "{{ lookup('pipe','uuid') }}" | |||||
networks: "{{ { netname : { 'mac': '%02x' | format( (2**44)*5 + 2**41 + (2**32)*84 + (16777216|random) ) | hwaddr( 'linux' ) } } }}" | |||||
when: install=="vm" | |||||
- name: password | |||||
password_name: root | |||||
password_hash: sha512 | |||||
password_wordlists: ['en'] | |||||
password_space: true | |||||
password_bits: 96 | |||||
- name: password | |||||
password_name: "local-admin" | |||||
password_hash: sha512 | |||||
password_wordlists: ['en'] | |||||
password_space: true | |||||
password_bits: 96 | |||||
- name: password | |||||
password_name: grub | |||||
password_hash: md5 | |||||
password_wordlists: ['en'] | |||||
password_space: true | |||||
password_bits: 96 |
@@ -1,22 +1,28 @@ | |||||
--- | --- | ||||
- name: copy linux kernel | - name: copy linux kernel | ||||
copy: src=/usr/lib/debian-installer/images/8/amd64/text/debian-installer/amd64/linux dest={{installer_directory}}/linux remote_src=true | |||||
copy: | |||||
src: /usr/lib/debian-installer/images/8/amd64/text/debian-installer/amd64/linux | |||||
dest: {{installer_directory}}/linux remote_src=true | |||||
- name: copy initrd for customization | - name: copy initrd for customization | ||||
shell: gunzip -c /usr/lib/debian-installer/images/8/amd64/text/debian-installer/amd64/initrd.gz > {{installer_directory}}/initrd | |||||
shell: gunzip -c | |||||
/usr/lib/debian-installer/images/8/amd64/text/debian-installer/amd64/initrd.gz | |||||
> {{installer_directory}}/initrd | |||||
- name: insert files into initrd | - name: insert files into initrd | ||||
shell: echo {{item}} | cpio --create --format=newc --append --file=initrd | shell: echo {{item}} | cpio --create --format=newc --append --file=initrd | ||||
args: | args: | ||||
chdir: "{{installer_directory}}/" | |||||
chdir: "{{installer_directory}}" | |||||
with_items: | with_items: | ||||
- preseed.cfg | |||||
- run.sh | |||||
- preseed.cfg | |||||
- run.sh | |||||
- name: compress custom initrd | - name: compress custom initrd | ||||
command: gzip -f {{installer_directory}}/initrd | command: gzip -f {{installer_directory}}/initrd | ||||
- name: merge initrd.gz and firmware.cpio.gz | - name: merge initrd.gz and firmware.cpio.gz | ||||
shell: cat /usr/lib/debian-installer/images/8/amd64/text/debian-installer/firmware.cpio.gz >> {{installer_directory}}/initrd.gz | |||||
shell: cat | |||||
/usr/lib/debian-installer/images/8/amd64/text/debian-installer/firmware.cpio.gz | |||||
>> {{installer_directory}}/initrd.gz | |||||
when: nonfree_firmware | when: nonfree_firmware |
@@ -1,19 +1,17 @@ | |||||
--- | --- | ||||
#- include: tools.yml | |||||
- import_tasks: setup.yml | |||||
- name: host install directory | - name: host install directory | ||||
file: state=directory path={{installer_directory}} | |||||
file: | |||||
state: directory | |||||
path: "{{installer_directory}}" | |||||
- include: preseed.yml | |||||
- import_tasks: preseed.yml | |||||
- import_tasks: installer.yml | |||||
- include: installer.yml | |||||
- include: method/kexec.yml | |||||
when: debian_installer_method == "kexec" | |||||
- include: kexec.yml | |||||
when: install == "kexec" | |||||
- include: iso.yml | |||||
when: (install == "iso") or (install == "vm") | |||||
- include: vm.yml | |||||
when: install == "vm" | |||||
- include: method/iso.yml | |||||
when: debian_installer_method == "iso" |
@@ -11,4 +11,3 @@ | |||||
- name: generate iso image | - name: generate iso image | ||||
command: genisoimage -o {{installer_directory}}/installer.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table {{installer_directory}}/ | command: genisoimage -o {{installer_directory}}/installer.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table {{installer_directory}}/ | ||||
@@ -1,12 +1,16 @@ | |||||
--- | --- | ||||
- name: template run.sh | |||||
template: src=run.sh.j2 dest={{installer_directory}}/run.sh | |||||
- name: run.sh | |||||
template: | |||||
src: run.sh.j2 | |||||
dest: "{{installer_directory}}/run.sh" | |||||
- name: stat run.sh | - name: stat run.sh | ||||
stat: path={{installer_directory}}/run.sh | |||||
stat: | |||||
path: "{{installer_directory}}/run.sh" | |||||
register: run_sh | register: run_sh | ||||
- name: template preseed.cfg | |||||
template: src=preseed.cfg.j2 dest={{installer_directory}}/preseed.cfg | |||||
- name: preseed.cfg | |||||
template: | |||||
src: preseed.cfg.j2 | |||||
dest: "{{installer_directory}}/preseed.cfg" |
@@ -0,0 +1,17 @@ | |||||
--- | |||||
- name: install required software | |||||
apt: | |||||
name: "{{item}}" | |||||
with_items: | |||||
- cpio | |||||
- debian-installer-9-netboot-amd64 | |||||
- genisoimage | |||||
- syslinux | |||||
- isolinux | |||||
- pxelinux | |||||
- name: download unofficial firmware for debian-installer | |||||
get_url: | |||||
url: http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/stable/current/firmware.cpio.gz | |||||
dest: /opt/debian-installer-unofficial-firmware.cpio.gz |
@@ -1,14 +0,0 @@ | |||||
--- | |||||
- name: install required software | |||||
apt: name={{item}} state=present | |||||
with_items: | |||||
- cpio | |||||
- debian-installer-8-netboot-amd64 | |||||
- genisoimage | |||||
- syslinux | |||||
- isolinux | |||||
- pxelinux | |||||
- name: download d-i non-free firmware | |||||
get_url: url=http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/stable/current/firmware.cpio.gz dest=/usr/lib/debian-installer/images/8/amd64/text/debian-installer/firmware.cpio.gz |
@@ -1,3 +0,0 @@ | |||||
--- | |||||
- name: install vm | |||||
command: virt-install -n {{ inventory_hostname }} --memory {{memory}} --vcpus {{vcpus|default(1)}} --disk size={{img_size}} --network network={{netname}},mac={{networks[netname].mac}},model=e1000 --cdrom {{installer_directory}}/installer.iso --os-variant=debianwheezy |
@@ -9,6 +9,7 @@ d-i debian-installer/locale string de_DE.UTF-8 | |||||
d-i keyboard-configuration/xkb-keymap select de | d-i keyboard-configuration/xkb-keymap select de | ||||
d-i keyboard-configuration/toggle select No toggling | d-i keyboard-configuration/toggle select No toggling | ||||
{# | |||||
### Network configuration | ### Network configuration | ||||
{% if (networks is defined) and (netname is defined) and (networks[netname] is defined) %} | {% if (networks is defined) and (netname is defined) and (networks[netname] is defined) %} | ||||
d-i netcfg/choose_interface select {{ networks[netname].mac | default("auto") }} | d-i netcfg/choose_interface select {{ networks[netname].mac | default("auto") }} | ||||
@@ -22,6 +23,7 @@ d-i netcfg/get_nameservers string {{ networks[netname].nameservers | join(" ") } | |||||
d-i netcfg/confirm_static boolean true | d-i netcfg/confirm_static boolean true | ||||
{% endif %} | {% endif %} | ||||
{% endif %} | {% endif %} | ||||
#} | |||||
### Network console | ### Network console | ||||
{% if network_console is defined %} | {% if network_console is defined %} | ||||
@@ -50,7 +52,7 @@ d-i passwd/root-password-crypted password {{ passwords_hashed["root"] }} | |||||
# local-admin | # local-admin | ||||
d-i passwd/user-fullname string Administrator | d-i passwd/user-fullname string Administrator | ||||
d-i passwd/username string local-admin | |||||
d-i passwd/username string local-admin | |||||
d-i passwd/user-password-crypted password {{ passwords_hashed["local-admin"] }} | d-i passwd/user-password-crypted password {{ passwords_hashed["local-admin"] }} | ||||
d-i passwd/user-uid string 999 | d-i passwd/user-uid string 999 | ||||
@@ -1,7 +1,9 @@ | |||||
#!/bin/sh | #!/bin/sh | ||||
{% if root_ssh_authorized_keys is defined %} | |||||
mkdir -p /.ssh | mkdir -p /.ssh | ||||
cat > /.ssh/authorized_keys << EOF | cat > /.ssh/authorized_keys << EOF | ||||
{{ lookup('file', 'ssh_authorized_keys') }} | |||||
{% for key in root_ssh_authorized_keys %} | |||||
{{key}} | |||||
{% endfor %} | |||||
EOF | EOF |