mirror of
https://github.com/outbackdingo/ansible-hw-bootstrap.git
synced 2026-01-27 02:18:12 +00:00
Added install play
This commit is contained in:
29
plays/install.yml
Normal file
29
plays/install.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- hosts: kickstart
|
||||
gather_facts: no
|
||||
vars:
|
||||
reboot: False
|
||||
|
||||
tasks:
|
||||
- name: Host inventory entry has a MAC address
|
||||
assert:
|
||||
that: hostvars[item]['mac'] is defined
|
||||
loop: "{{ groups['initialise'] }}"
|
||||
|
||||
- name: Set PXE menu to install
|
||||
file:
|
||||
state: link
|
||||
src: install
|
||||
dest: "/var/lib/tftpboot/pxelinux.cfg/01-{{ hostvars[item]['mac'] | lower | regex_replace(':','-') }}"
|
||||
become: true
|
||||
loop: "{{ groups['initialise'] }}"
|
||||
|
||||
- name: Reboot target host for PXE boot
|
||||
hpilo_boot:
|
||||
host: "{{ hostvars[item]['ilo_ip'] }}"
|
||||
media: network
|
||||
password: "{{ hostvars[item]['ilo_password'] }}"
|
||||
force: true
|
||||
loop: "{{ groups['initialise'] }}"
|
||||
delegate_to: localhost
|
||||
when: reboot
|
||||
Reference in New Issue
Block a user