Skip to content

Commit

Permalink
Add new blog
Browse files Browse the repository at this point in the history
  • Loading branch information
mcimam committed Jul 7, 2024
1 parent ad87c8e commit 32bb537
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 21 deletions.
91 changes: 91 additions & 0 deletions content/blogs/automate-ubuntu-install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
+++
title = 'Automate Ubuntu Install'
tags = ['devops', 'ubuntu']

date = 2024-07-07T20:30:09+07:00
draft = false
showtoc = false
hideSummary = true
disableShare = true
+++

# How to create ubuntu autoinstall

Creating an automated installation ISO for Ubuntu can save time and ensure consistency across deployments. Here's a step-by-step guide to create your own autoinstall ISO. Automatic Ubuntu installation is performed with the autoinstall format. You might also know this feature as “unattended”, “hands-off” or “preseeded” installation.

This format is supported in the following installers:
- Ubuntu Server, version 20.04 and later
- Ubuntu Desktop, version 23.04 and later

## Step 1 : Download ubuntu package
First, download the latest Ubuntu live server ISO from the official website.
Download [here](https://ubuntu.com/download)


## Step 2: Create file ´autoinstall-user-data´
Next, create a file named autoinstall-user-data. Here's an example configuration:
``` yml
#cloud-config
autoinstall:
version: 1
identity:
hostname: svr
password: "$y$j9T$eKDQKBfE.NOfLgQCzYNLB1$nmJbonWd.WtWoCKMtbTD4HlLK6lEkFj3AI378PDOw23"
username: mcimam
ssh:
allow-pw: true
install-server: true
shutdown: reboot
```
For more detail check [Ubuntu Autoinstall Ref](https://canonical-subiquity.readthedocs-hosted.com/en/latest/reference/autoinstall-reference.html)
## Step 3: Extract iso
Extract the contents of the ISO file using the following commands:
``` sh
mkdir source-files
xorriso -osirrox on -indev ubuntu-24.04-live-server-amd64.iso --extract_boot_images source-files/bootpart -extract / source-files
```

## Step 4: Add auto install configuration to iso
Add the autoinstall-user-data file to the extracted files:

```
cd source-files
mkdir nocloud
cd nocloud
cp ../../autoinstall-user-data user-data
touch meta-data
```

## Step 5. Add autoinstall menu to grub
Edit the GRUB configuration file to add an autoinstall menu entry:
``` sh
vi source-files/boot/grub/grub.cfg
```

Add following menu entry:
``` cfg
# Add this one
menuentry "Autoinstall Ubuntu Server" {
set gfxpayload=keep
linux /casper/vmlinuz quiet autoinstall ds=nocloud\;s=/cdrom/nocloud/ ---
initrd /casper/initrd
}
```

## Step 6. Repack iso file
Finally, repack the ISO with the following command:

```
xorriso -as mkisofs -r -V "ubuntu-autoinstall" -J -boot-load-size 4 -boot-info-table -input-charset utf-8 -eltorito-alt-boot -b bootpart/eltorito_img1_bios.img -no-emul-boot -o ../ubuntu-24.04-server-amd64-autoinstall.iso .
```
Now you have a custom Ubuntu autoinstall ISO ready to use!


## Video Reference
This note is based on tutorial provided by ubuntu and DanielPersson.

Full video reference from DanielPersson.

{{< youtube DtXZ6BMaKbA >}}

2 changes: 2 additions & 0 deletions content/blogs/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title = 'Hello World'
date = 2024-07-06T23:46:08+07:00
draft = false
showtoc = false
hideSummary = true
disableShare = true
+++

This is some Hello world for you:
Expand Down
5 changes: 5 additions & 0 deletions content/search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "Search"
placeholder: Search demo site with full text fuzzy search ...
layout: "search"
---
63 changes: 42 additions & 21 deletions hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
baseURL: https://example.org/
baseURL: https://mcimam.github.io/
languageCode: en-us
title: Mcimam - Portofolio
title: Mcimam - Personal Web
theme: [PaperMod]

enableRobotsTXT: true
Expand All @@ -12,12 +12,42 @@ minify:
disableXML: true
minifyOutput: true

languages:
en:
languageName: "English"
weight: 1
taxonomies:
tag: tags
menu:
main:
- identifier: home
name: Home
url: /
weight: 10
- identifier: blogs
name: Blogs
url: /blogs/
weight: 20
- identifier: tags
name: Tags
url: /tags/
weight: 30
- name: Search
url: search/
weight: 100

outputs:
home:
- HTML
- RSS
- JSON

params:
env: production # to enable google analytics, opengraph, twitter-cards and schema.
title: ExampleSite
description: "ExampleSite description"
keywords: [Blog, Portfolio, PaperMod]
author: Me
env: development # to enable google analytics, opengraph, twitter-cards and schema.
title: Mcimam
description: "Mcimam - Personal Web"
keywords: [Mcimam, Portfolio, Blogs]
author: Mcimam
# author: ["Me", "You"] # multiple authors
images: ["<link or path of image for opengraph, twitter-cards>"]
DateFormat: "January 2, 2006"
Expand Down Expand Up @@ -93,10 +123,10 @@ params:
hiddenInList: true # hide on list pages and home
hiddenInSingle: true # hide on single page

# editPost:
# URL: "https://github.com/<path_to_repo>/content"
# Text: "Suggest Changes" # edit text
# appendFilePath: true # to append file path to Edit link
editPost:
URL: "https://github.com/mcimam/mcimam.github.io/content"
Text: "Suggest Changes" # edit text
appendFilePath: true # to append file path to Edit link

# for search
# https://fusejs.io/api/options.html
Expand All @@ -109,16 +139,7 @@ params:
minMatchCharLength: 0
limit: 10 # refer: https://www.fusejs.io/api/methods.html#search
keys: ["title", "permalink", "summary", "content"]
menu:
main:
- identifier: home
name: Home
url: /
weight: 10
- identifier: blogs
name: Blogs
url: /blogs/
weight: 20

# Read: https://github.com/adityatelange/hugo-PaperMod/wiki/FAQs#using-hugos-syntax-highlighter-chroma
pygmentsUseClasses: true
markup:
Expand Down

0 comments on commit 32bb537

Please sign in to comment.