-
Notifications
You must be signed in to change notification settings - Fork 203
Expand file tree
/
Copy pathmain.yml
More file actions
68 lines (58 loc) · 2.59 KB
/
main.yml
File metadata and controls
68 lines (58 loc) · 2.59 KB
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
58
59
60
61
62
63
64
65
66
67
68
---
- name: 'Setup CentOS 9 provisioning'
import_tasks: configure_centos_9.yml
- name: 'Setup Fedora 40 provisioning'
import_tasks: configure_fedora_40.yml
- name: 'Setup Debian 12.7 provisioning'
import_tasks: configure_debian_12_7.yml
- name: 'Setup Ubuntu 24.04 provisioning'
import_tasks: configure_ubuntu_24_04.yml
# TODO verify - should not be needed, DNS should work just fine
- name: 'set unattended_url'
theforeman.foreman.setting:
name: unattended_url
value: "http://{{ foreman_provisioning_ip_address }}"
- name: 'find hostgroup Base'
shell: >
{{ foreman_provisioning_hammer }} hostgroup info --name 'Base'
register: foreman_provisioning_hostgroup_base
ignore_errors: True
- name: 'prepare compute resource option'
set_fact:
foreman_provisioning_compute_resource_option: "{{ '--compute-resource libvirt' if foreman_provisioning_foreman_version == 'nightly' else '' }}"
- name: 'prepare compute profile option'
set_fact:
foreman_provisioning_compute_profile_option: "{{ '--compute-profile libvirt-profile' if 'Error' not in foreman_provisioning_compute_profile_cmd.stderr else '' }}"
# TODO compute-profile can't be specified by name until http://projects.theforeman.org/issues/21580/ so we hardcode 1
- name: 'create hostgroup Base'
shell: >
{{ foreman_provisioning_hammer }} hostgroup create
--name 'Base'
--architecture x86_64
--domain {{ foreman_provisioning_domain }}
--puppet-environment production
--puppet-ca-proxy-id {{ foreman_provisioning_smart_proxy.Id }}
--puppet-proxy-id {{ foreman_provisioning_smart_proxy.Id }}
--subnet '{{ foreman_provisioning_network }}/24'
{{ foreman_provisioning_compute_profile_option }}
{{ foreman_provisioning_compute_resource_option }}
--root-password changeme
--pxe-loader "PXELinux BIOS"
--organization '{{ foreman_provisioning_organization }}'
{{ foreman_provisioning_hammer_taxonomy_params }}
when: foreman_provisioning_hostgroup_base.stderr.find('not found') != -1
- name: 'find hostgroup CentOS 9'
shell: >
{{ foreman_provisioning_hammer }} hostgroup info --name 'CentOS 9 Mirror'
register: foreman_provisioning_hostgroup_centos_mirror
ignore_errors: True
- name: 'create hostgroup CentOS 9 Mirror'
shell: >
{{ foreman_provisioning_hammer }} hostgroup create
--name 'CentOS 9 Mirror'
--operatingsystem 'CentOS_Stream 9'
--medium 'CentOS Stream 9 mirror'
--partition-table 'Kickstart default'
--parent 'Base'
{{ foreman_provisioning_hammer_taxonomy_params }}
when: foreman_provisioning_hostgroup_centos_mirror.stderr.find('not found') != -1