From 2e5b51cc24b6f6c91e7f969fe14e3adc2d4e80f2 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 21 Apr 2018 23:28:35 +0200 Subject: rename all .yaml to .yml --- roles/vm-host/defaults/main.yaml | 7 ------ roles/vm-host/defaults/main.yml | 7 ++++++ roles/vm-host/handlers/main.yaml | 5 ---- roles/vm-host/handlers/main.yml | 5 ++++ roles/vm-host/tasks/main.yaml | 54 ---------------------------------------- roles/vm-host/tasks/main.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 66 insertions(+), 66 deletions(-) delete mode 100644 roles/vm-host/defaults/main.yaml create mode 100644 roles/vm-host/defaults/main.yml delete mode 100644 roles/vm-host/handlers/main.yaml create mode 100644 roles/vm-host/handlers/main.yml delete mode 100644 roles/vm-host/tasks/main.yaml create mode 100644 roles/vm-host/tasks/main.yml (limited to 'roles/vm-host') diff --git a/roles/vm-host/defaults/main.yaml b/roles/vm-host/defaults/main.yaml deleted file mode 100644 index 0e3cddf1..00000000 --- a/roles/vm-host/defaults/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -vm_host_force_download_installer: False -vm_host_installer_url: - # debian: "{{ debian_mirror.packages | default('http://deb.debian.org/debian') }}" - # ubuntu: "{{ ubuntu_mirror | default('http://archive.ubuntu.com/ubuntu') }}" - debian: "http://deb.debian.org/debian" - ubuntu: "http://archive.ubuntu.com/ubuntu" diff --git a/roles/vm-host/defaults/main.yml b/roles/vm-host/defaults/main.yml new file mode 100644 index 00000000..0e3cddf1 --- /dev/null +++ b/roles/vm-host/defaults/main.yml @@ -0,0 +1,7 @@ +--- +vm_host_force_download_installer: False +vm_host_installer_url: + # debian: "{{ debian_mirror.packages | default('http://deb.debian.org/debian') }}" + # ubuntu: "{{ ubuntu_mirror | default('http://archive.ubuntu.com/ubuntu') }}" + debian: "http://deb.debian.org/debian" + ubuntu: "http://archive.ubuntu.com/ubuntu" diff --git a/roles/vm-host/handlers/main.yaml b/roles/vm-host/handlers/main.yaml deleted file mode 100644 index 158f4dcd..00000000 --- a/roles/vm-host/handlers/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: restart inetd - service: - name: openbsd-inetd - state: restarted diff --git a/roles/vm-host/handlers/main.yml b/roles/vm-host/handlers/main.yml new file mode 100644 index 00000000..158f4dcd --- /dev/null +++ b/roles/vm-host/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: restart inetd + service: + name: openbsd-inetd + state: restarted diff --git a/roles/vm-host/tasks/main.yaml b/roles/vm-host/tasks/main.yaml deleted file mode 100644 index a5e98fa9..00000000 --- a/roles/vm-host/tasks/main.yaml +++ /dev/null @@ -1,54 +0,0 @@ ---- -- name: install tftpd and python-libvirt - with_items: - - atftpd - - openbsd-inetd - - qemu-kvm - - libvirt-bin - - python-libvirt - apt: - name: "{{ item }}" - state: present - -- name: configure tftpd via inetd - lineinfile: - regexp: "^#?({{ vm_host.network.ip }}:)?tftp" - line: "{{ vm_host.network.ip }}:tftp dgram udp4 wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd --tftpd-timeout 300 --retry-timeout 5 --maxthread 10 --verbose=5 {{ vm_host.installer.preseed_path }}" - path: /etc/inetd.conf - notify: restart inetd - -- name: make sure installer directories exists - with_items: - - "{{ vm_host.installer.path }}" - - "{{ vm_host.installer.preseed_path }}" - file: - name: "{{ item }}" - state: directory - -- name: prepare directories for installer images - with_subelements: - - "{{ vm_host.installer.distros }}" - - arch - file: - name: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}" - state: directory - -- name: download installer kernel images - with_subelements: - - "{{ vm_host.installer.distros }}" - - arch - get_url: - url: "{{ vm_host_installer_url[item.0.distro] }}/dists/{{ item.0.codename }}/main/installer-{{ item.1 }}/current/images/netboot/{{ item.0.distro }}-installer/{{ item.1 }}/linux" - dest: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/linux" - mode: 0644 - force: "{{ vm_host_force_download_installer }}" - -- name: download installer initrd.gz - with_subelements: - - "{{ vm_host.installer.distros }}" - - arch - get_url: - url: "{{ vm_host_installer_url[item.0.distro] }}/dists/{{ item.0.codename }}/main/installer-{{ item.1 }}/current/images/netboot/{{ item.0.distro }}-installer/{{ item.1 }}/initrd.gz" - dest: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/initrd.gz" - mode: 0644 - force: "{{ vm_host_force_download_installer }}" diff --git a/roles/vm-host/tasks/main.yml b/roles/vm-host/tasks/main.yml new file mode 100644 index 00000000..a5e98fa9 --- /dev/null +++ b/roles/vm-host/tasks/main.yml @@ -0,0 +1,54 @@ +--- +- name: install tftpd and python-libvirt + with_items: + - atftpd + - openbsd-inetd + - qemu-kvm + - libvirt-bin + - python-libvirt + apt: + name: "{{ item }}" + state: present + +- name: configure tftpd via inetd + lineinfile: + regexp: "^#?({{ vm_host.network.ip }}:)?tftp" + line: "{{ vm_host.network.ip }}:tftp dgram udp4 wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd --tftpd-timeout 300 --retry-timeout 5 --maxthread 10 --verbose=5 {{ vm_host.installer.preseed_path }}" + path: /etc/inetd.conf + notify: restart inetd + +- name: make sure installer directories exists + with_items: + - "{{ vm_host.installer.path }}" + - "{{ vm_host.installer.preseed_path }}" + file: + name: "{{ item }}" + state: directory + +- name: prepare directories for installer images + with_subelements: + - "{{ vm_host.installer.distros }}" + - arch + file: + name: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}" + state: directory + +- name: download installer kernel images + with_subelements: + - "{{ vm_host.installer.distros }}" + - arch + get_url: + url: "{{ vm_host_installer_url[item.0.distro] }}/dists/{{ item.0.codename }}/main/installer-{{ item.1 }}/current/images/netboot/{{ item.0.distro }}-installer/{{ item.1 }}/linux" + dest: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/linux" + mode: 0644 + force: "{{ vm_host_force_download_installer }}" + +- name: download installer initrd.gz + with_subelements: + - "{{ vm_host.installer.distros }}" + - arch + get_url: + url: "{{ vm_host_installer_url[item.0.distro] }}/dists/{{ item.0.codename }}/main/installer-{{ item.1 }}/current/images/netboot/{{ item.0.distro }}-installer/{{ item.1 }}/initrd.gz" + dest: "{{ vm_host.installer.path }}/{{ item.0.distro }}-{{ item.0.codename }}/{{ item.1 }}/initrd.gz" + mode: 0644 + force: "{{ vm_host_force_download_installer }}" -- cgit v1.2.3