-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsite.yml
57 lines (46 loc) · 2.13 KB
/
site.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
- name: setup pxe
hosts: boot
tasks:
- include_vars: "{% if site is not defined %}site_vars.yml{% else %}{{ site }}.site_vars.yml{% endif %}"
tags:
- hosts
- name: create pxe & efi dir
file: name={{ item }} state=directory
with_items:
- "{{ menu_dir }}"
- "{{ efi_dir }}"
- name: create pxe menu workdir
local_action: file dest={{ playbook_dir }}/workdir/{{ item }} state=directory
with_items: "{{ (groups['ks'] + groups['preseed'] + groups['yast'])|map('extract', hostvars, 'menu')|unique|list }}"
run_once: true
- name: create efi menu workdir
local_action: file dest={{ playbook_dir }}/workdir/{{ item }}-grub2efi state=directory
with_items: "{{ (groups['ks'] + groups['preseed'] + groups['yast'])|map('extract', hostvars, 'menu')|unique|list }}"
run_once: true
- include: gen_pxe_files.yml
with_items: "{{ dtypes }}"
loop_control:
loop_var: atype
- name: assemble pxe menus
assemble: src={{ playbook_dir }}/workdir/{{ item }} dest={{ menu_dir }}/menu.{{ item }} remote_src=False
with_items: "{{ (groups['ks'] + groups['preseed'] + groups['yast'])|map('extract', hostvars, 'menu')|unique|list }}"
- name: install default pxe menu
template: src=templates/default.j2 dest={{ menu_dir }}/default
- name: assemble efi menus
local_action: assemble src={{ playbook_dir }}/workdir/{{ item }}-grub2efi dest={{ playbook_dir }}/workdir/{{ item }}-grub2efi/menu.{{ item }} remote_src=False
with_items: "{{ (groups['ks'] + groups['preseed'] + groups['yast'])|map('extract', hostvars, 'menu')|unique|list }}"
- name: install default efi menu
template: src=templates/default_grub2efi.j2 dest={{ efi_dir }}/grub.cfg
- name: cleanup workdir
local_action: file dest={{ playbook_dir }}/workdir state=absent
run_once: true
- name: setup kickstart, preseed, autoyast files
hosts: kickstart
tasks:
- name: create kickstart dir
file: name={{ ks_dir }} state=directory
- include: gen_ks_files.yml
with_items: "{{ dtypes }}"
loop_control:
loop_var: atype