summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/ks.cfg.template
diff options
context:
space:
mode:
authorArun S A G <sagarun@gmail.com>2021-01-23 11:56:51 -0800
committerArun S A G <sagarun@gmail.com>2021-03-19 09:39:50 -0700
commit26040d4563ca683319d56aaecef478df6ee5390f (patch)
tree08155e27b96d12520a4057c644879a75ffb0d617 /ironic/drivers/modules/ks.cfg.template
parent121bc5a4c2ddb6a542323e55c593817df5805126 (diff)
downloadironic-26040d4563ca683319d56aaecef478df6ee5390f.tar.gz
Add anaconda configuration and template
This change adds 'anaconda' group and 'default_ks_template' configuration option under that group to ironic configuration file. Along with this change a new boot_option named 'kickstart' is added to identify anaconda kickstart deploy in the boot interface. deploy_utils.get_boot_option method is modified to check if node.deploy_interface is set to 'anaconda' and return boot_option 'kickstart'. This change also validates whether required parameters are set when the boot_option on the node is set to 'kickstart'. When boot_option is 'kickstart' we also validate if the glance image source has 'squashfs_id' property associated with it. Change-Id: I2ef7c33e2e63e6d08c084b4c5dbd77a44ddd2d14 Story: 2007839 Task: 41675
Diffstat (limited to 'ironic/drivers/modules/ks.cfg.template')
-rw-r--r--ironic/drivers/modules/ks.cfg.template37
1 files changed, 37 insertions, 0 deletions
diff --git a/ironic/drivers/modules/ks.cfg.template b/ironic/drivers/modules/ks.cfg.template
new file mode 100644
index 000000000..3d74c4f3c
--- /dev/null
+++ b/ironic/drivers/modules/ks.cfg.template
@@ -0,0 +1,37 @@
+lang en_US
+keyboard us
+timezone UTC --utc
+#platform x86, AMD64, or Intel EM64T
+text
+cmdline
+reboot
+selinux --enforcing
+firewall --enabled
+firstboot --disabled
+
+bootloader --location=mbr --append="rhgb quiet crashkernel=auto"
+zerombr
+clearpart --all --initlabel
+autopart
+
+# Downloading and installing OS image using liveimg section is mandatory
+liveimg --url {{ ks_options.liveimg_url }}
+
+# Following %pre, %onerror and %trackback sections are mandatory
+%pre
+/usr/bin/curl -X PUT -H 'Content-Type: application/json' -H 'Accept:application/json' -d '{"agent_token": "{{ ks_options.agent_token }}", "agent_state": "start", "agent_status": "Deployment starting. Running pre-installation scripts."}' {{ ks_options.heartbeat_url }}
+%end
+
+%onerror
+/usr/bin/curl -X PUT -H 'Content-Type: application/json' -H 'Accept:application/json' -d '{"agent_token": "{{ ks_options.agent_token }}", "agent_state": "error", "agent_status": "Error: Deploying using anaconda. Check console for more information."}' {{ ks_options.heartbeat_url }}
+%end
+
+%traceback
+/usr/bin/curl -X PUT -H 'Content-Type: application/json' -H 'Accept:application/json' -d '{"agent_token": "{{ ks_options.agent_token }}", "agent_state": "error", "agent_status": "Error: Installer crashed unexpectedly."}' {{ ks_options.heartbeat_url }}
+%end
+
+# Sending callback after the installation is mandatory
+%post
+/usr/bin/curl -X PUT -H 'Content-Type: application/json' -H 'Accept:application/json' -d '{"agent_token": "{{ ks_options.agent_token }}", "agent_state": "end", "agent_status": "Deployment completed successfully."}' {{ ks_options.heartbeat_url }}
+%end
+