diff --git a/tasks/main.yml b/tasks/main.yml index e470ac0..b72f078 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -31,17 +31,23 @@ name: "{{ packages }}" state: present - - name: Install packages for DHCP/PXE install + - name: Install packages for DHCP install package: name: "{{ dhcppkgs }}" state: present - when: not staticips + when: not staticips and not externaldhcp + + - name: Install packages for PXE install + package: + name: "{{ pxepkgs }}" + state: present + when: not staticips and baremetal - name: Install additional package for Intel platforms package: name: "{{ syslinuxpkgs }}" state: present - when: not staticips and not ppc64le + when: not staticips and not ppc64le and baremetal - name: Remove existing config files import_tasks: remove_old_config_files.yaml @@ -53,7 +59,7 @@ dest: /etc/dhcp/dhcpd.conf notify: - restart dhcpd - when: not staticips and not uefi + when: not staticips and not uefi and not externaldhcp - name: Write out dhcp file (UEFI) template: @@ -61,7 +67,7 @@ dest: /etc/dhcp/dhcpd.conf notify: - restart dhcpd - when: not staticips and uefi + when: not staticips and uefi and not externaldhcp - name: Setup named configuration files block: @@ -147,14 +153,14 @@ url: "{{ ocp_bios }}" dest: /var/www/html/install/bios.raw.gz mode: 0555 - when: ("metal" in ocp_bios) and (download_imgs or force_ocp_download) + when: ("metal" in ocp_bios) and (download_imgs or force_ocp_download) and baremetal - name: Downloading OCP4 installer rootfs get_url: url: "{{ ocp_bios }}" dest: /var/www/html/install/rootfs.img mode: 0555 - when: ("rootfs" in ocp_bios) and (download_imgs or force_ocp_download) + when: ("rootfs" in ocp_bios) and (download_imgs or force_ocp_download) and baremetal - name: Start firewalld service systemd: @@ -204,18 +210,18 @@ mode: 0755 notify: - restart tftp - when: not staticips and not ppc64le + when: not staticips and not ppc64le and baremetal - name: generate netboot entry for grub2 shell: grub2-mknetdir --net-directory=/var/lib/tftpboot - when: not staticips and ppc64le + when: not staticips and ppc64le and baremetal - name: Create TFTP RHCOS dir file: path: /var/lib/tftpboot/rhcos state: directory mode: 0755 - when: not staticips + when: not staticips and baremetal - name: SEBool allow haproxy connect any port seboolean: @@ -427,14 +433,14 @@ - helper-tftp when: not staticips and baremetal - - name: Starting DHCP/PXE services + - name: Starting DHCP services for non baremetal service: name: "{{ item }}" enabled: yes state: started with_items: - dhcpd - when: not staticips and not baremetal + when: not staticips and not baremetal and not externaldhcp - name: Unmasking Services systemd: @@ -443,7 +449,7 @@ masked: no with_items: - tftp - when: not staticips and not ipi + when: not staticips and not ipi and not baremetal - name: Copy info script over template: diff --git a/tasks/set_facts_.yaml b/tasks/set_facts_.yaml index 5274751..778b5f9 100644 --- a/tasks/set_facts_.yaml +++ b/tasks/set_facts_.yaml @@ -18,7 +18,7 @@ - block: - set_fact: critical_services: "{{ critical_services + [ 'dhcpd' ] }}" - when: not staticips + when: not staticips and not externaldhcp - block: - set_fact: @@ -60,6 +60,9 @@ - set_fact: dhcppkgs: - dhcp + + - set_fact: + pxepkgs: - tftp-server - set_fact: @@ -105,6 +108,9 @@ - set_fact: dhcppkgs: - dhcp-server + + - set_fact: + pxepkgs: - tftp-server - set_fact: