From 60560e9c57e62afe8105bd369299a8cb79229b71 Mon Sep 17 00:00:00 2001 From: nicoo Date: Sun, 17 Jun 2018 22:30:39 +0200 Subject: [PATCH] Add (start of) USB installer --- ansible/roles/usb-install/meta/main.yml | 8 ++++++++ ansible/usb-install.sh | 1 + ansible/usb-install.yml | 13 +++++++++++++ ansible/vm-install.sh | 4 ++-- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 ansible/roles/usb-install/meta/main.yml create mode 120000 ansible/usb-install.sh create mode 100644 ansible/usb-install.yml diff --git a/ansible/roles/usb-install/meta/main.yml b/ansible/roles/usb-install/meta/main.yml new file mode 100644 index 0000000..4fbb746 --- /dev/null +++ b/ansible/roles/usb-install/meta/main.yml @@ -0,0 +1,8 @@ +dependencies: + - role: debian-installer + distros: + - distro: "{{ distro }}" + codename: "{{ distcodename }}" + arch: [ "{{ install.arch }}" ] + + - role: preseed diff --git a/ansible/usb-install.sh b/ansible/usb-install.sh new file mode 120000 index 0000000..bd4a66a --- /dev/null +++ b/ansible/usb-install.sh @@ -0,0 +1 @@ +vm-install.sh \ No newline at end of file diff --git a/ansible/usb-install.yml b/ansible/usb-install.yml new file mode 100644 index 0000000..20b3ae6 --- /dev/null +++ b/ansible/usb-install.yml @@ -0,0 +1,13 @@ +--- +- name: Fetch debian installer and bake initrd + hosts: "{{ hostname }}" + connection: local + pre_tasks: + - set_fact: + install_cooked: "{{ install }}" + network_cooked: "{{ network }}" + roles: + - usb-install + vars: + preseed_path: "{{ global_artifacts_dir }}" + debian_installer_path: "{{ global_cache_dir }}/debian-installer" diff --git a/ansible/vm-install.sh b/ansible/vm-install.sh index 47291ed..0846422 100755 --- a/ansible/vm-install.sh +++ b/ansible/vm-install.sh @@ -12,8 +12,8 @@ shift codename=$1 shift -echo "installing vm: $name with $distro/$codename" +echo "installing $name with $distro/$codename" echo "" echo "######## running the install playbook ########" -exec ansible-playbook -e "hostname=$name" -e "distro=$distro" -e "distcodename=$codename" $@ vm-install.yml +exec ansible-playbook -e "hostname=$name" -e "distro=$distro" -e "distcodename=$codename" $@ $(basename "$0" .sh).yml -- 1.7.10.4