From 1ed97c1a37bfa8575e4f29cbf00199b17ab36ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Ramalho?= Date: Tue, 29 Nov 2016 11:03:28 -0300 Subject: [PATCH] Add ldlinux.c32 to the tftp directory This patch adds a task to copy ldlinux.c32 to the tftp directory when on ubuntu 16.04. Also, changed the copy tasks to a unique task making use of the copy module with 'remote_src: True'. Change-Id: I4a71c198ad11d293e15f8a80bc1dcd0c6e6aa479 --- tasks/ironic_conductor_post_install.yml | 33 +++++++++---------------- vars/ubuntu-14.04.yml | 5 ++-- vars/ubuntu-16.04.yml | 6 +++-- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/tasks/ironic_conductor_post_install.yml b/tasks/ironic_conductor_post_install.yml index 6d8b2e78..74a23ef7 100644 --- a/tasks/ironic_conductor_post_install.yml +++ b/tasks/ironic_conductor_post_install.yml @@ -15,8 +15,8 @@ - name: Copy in sample dhcpd.conf file copy: - src: dhcpd.conf - dest: /etc/dhcp/ + src: "dhcpd.conf" + dest: "/etc/dhcp/" when: ironic_standalone notify: - Restart isc-dhcp-server @@ -31,30 +31,21 @@ - name: Copy in tftpd-hpa config file template: - src: tftpd-hpa.j2 - dest: /etc/default/tftpd-hpa + src: "tftpd-hpa.j2" + dest: "/etc/default/tftpd-hpa" notify: - Restart tftpd-hpa - name: Copy in tftpd-hpa map file copy: - src: map-file - dest: /tftpboot/map-file + src: "map-file" + dest: "/tftpboot/map-file" notify: - Restart tftpd-hpa -## TODO(odyssey4me): Switch this to the copy module and make use of -## remote_src: True once we move to Ansible 2.x. For Ansible 1.9x -## there is no idempotent way of doing this without several tasks -## which is a wasted effort. -- name: Copy syslinux pxlinux.0 - command: "cp {{ ironic_pxelinux_path }} /tftpboot/pxelinux.0" - changed_when: false - -## TODO(odyssey4me): Switch this to the copy module and make use of -## remote_src: True once we move to Ansible 2.x. For Ansible 1.9x -## there is no idempotent way of doing this without several tasks -## which is a wasted effort. -- name: Copy syslinux chain.c32 - command: "cp {{ ironic_chainc32_path }} /tftpboot/chain.c32" - changed_when: false +- name: Copy library modules into /tftpboot + copy: + src: "{{ item }}" + dest: "/tftpboot/" + remote_src: True + with_items: "{{ ironic_library_modules_paths }}" diff --git a/vars/ubuntu-14.04.yml b/vars/ubuntu-14.04.yml index 94885b86..67906e11 100644 --- a/vars/ubuntu-14.04.yml +++ b/vars/ubuntu-14.04.yml @@ -38,5 +38,6 @@ ironic_conductor_distro_packages: ironic_conductor_standalone_distro_packages: - isc-dhcp-server -ironic_pxelinux_path: "/usr/lib/syslinux/pxelinux.0" -ironic_chainc32_path: "/usr/lib/syslinux/chain.c32" +ironic_library_modules_paths: + - "/usr/lib/syslinux/pxelinux.0" + - "/usr/lib/syslinux/chain.c32" diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index b29e73e6..02f1c64f 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -40,5 +40,7 @@ ironic_conductor_distro_packages: ironic_conductor_standalone_distro_packages: - isc-dhcp-server -ironic_pxelinux_path: "/usr/lib/PXELINUX/pxelinux.0" -ironic_chainc32_path: "/usr/lib/syslinux/modules/efi64/chain.c32" +ironic_library_modules_paths: + - "/usr/lib/PXELINUX/pxelinux.0" + - "/usr/lib/syslinux/modules/efi64/chain.c32" + - "/usr/lib/syslinux/modules/bios/ldlinux.c32"