-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(idrac_os_deployment): added support for ubuntu installation
Signed-off-by: sakethanne <asvn.saketh@gmail.com>
- Loading branch information
1 parent
54c1a2c
commit 8a8e291
Showing
8 changed files
with
191 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ubuntu_update_installer: true | ||
ubuntu_preserve_sources_list: false | ||
ubuntu_primary_mirror: "http://archive.ubuntu.com/ubuntu" | ||
ubuntu_primary_arches: [i386, amd64] | ||
ubuntu_secondary_mirror: "http://ports.ubuntu.com/ubuntu-ports" | ||
ubuntu_secondary_arches: [s390x, arm64, armhf, powerpc, ppc64el, riscv64] | ||
ubuntu_fallback_strategy: "abort" | ||
ubuntu_geoip: true | ||
ubuntu_git_ppa: "ppa:git-core/ppa" | ||
ubuntu_hostname: "ubuntu" | ||
# Initial user password "ubuntu" (hashed using SHA-512) | ||
ubuntu_user_password: "$6$xlpCfETR.9nMepDn$0GDk0yuTOOMXrxFQacjQdbTNwCys.wMlo.EDzfKJGvLhy61R8IxaSCNveo247McGthyg7vBUgDlmTS3wF.64k1" | ||
ubuntu_realname: "ubuntu" | ||
ubuntu_username: "ubuntu" | ||
ubuntu_keyboard: "us" | ||
ubuntu_keyboard_toggle: "" | ||
ubuntu_keyboard_variant: "" | ||
ubuntu_locale: "en_US" | ||
ubuntu_allow_pw: true | ||
ubuntu_authorized_keys: [] # Add public keys here as a YAML list | ||
ubuntu_install_ssh: true | ||
ubuntu_storage_layout: "lvm" | ||
ubuntu_match_size: "largest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
- name: Create 'server' folder inside the extract directory | ||
delegate_to: "{{ idrac_os_deployment_delegate }}" | ||
ansible.builtin.file: | ||
path: "{{ idrac_os_deployment_iso_extract_dir }}/server" | ||
state: directory | ||
mode: "{{ idrac_os_deployment_copy_mode }}" | ||
|
||
- name: Create an empty 'meta-data' file inside the server folder | ||
delegate_to: "{{ idrac_os_deployment_delegate }}" | ||
ansible.builtin.copy: | ||
content: "" | ||
dest: "{{ idrac_os_deployment_iso_extract_dir }}/server/meta-data" | ||
mode: "{{ idrac_os_deployment_copy_mode }}" | ||
|
||
- name: Copy KS user-data to extracted | ||
delegate_to: "{{ idrac_os_deployment_delegate }}" | ||
ansible.builtin.copy: | ||
src: "{{ idrac_os_deployment_kickstart_file }}" | ||
dest: "{{ idrac_os_deployment_iso_extract_dir }}/server/{{ idrac_os_deployment_ubuntu_ks_filename }}" | ||
mode: "{{ idrac_os_deployment_copy_mode }}" | ||
|
||
- name: Append autoinstall menu entry to grub.cfg | ||
delegate_to: "{{ idrac_os_deployment_delegate }}" | ||
ansible.builtin.lineinfile: | ||
path: "{{ idrac_os_deployment_iso_extract_dir }}/boot/grub/grub.cfg" | ||
insertafter: "^set menu_color_highlight=black/light-gray" | ||
line: | | ||
menuentry 'Install Ubuntu with Kickstart' { | ||
set gfxpayload=keep | ||
linux /casper/vmlinuz quiet autoinstall ds=nocloud\;s={{ idrac_os_deployment_ubuntu_ks_location }}server/ --- | ||
initrd /casper/initrd | ||
} | ||
- name: Get iso LABEL | ||
delegate_to: "{{ idrac_os_deployment_delegate }}" | ||
ansible.builtin.command: "blkid -s LABEL -o value {{ idrac_os_deployment_iso_file }}" | ||
register: idrac_os_deployment_blkid_output | ||
changed_when: idrac_os_deployment_blkid_output.rc != 0 | ||
|
||
- name: Set iso LABEL | ||
ansible.builtin.set_fact: | ||
idrac_os_deployment_iso_label: "{{ idrac_os_deployment_blkid_output.stdout | trim }}" | ||
|
||
- name: Compile custom ISO | ||
delegate_to: "{{ idrac_os_deployment_delegate }}" | ||
ansible.builtin.command: | ||
chdir: "{{ idrac_os_deployment_iso_extract_dir }}" | ||
cmd: "{{ idrac_os_deployment_ubuntu_mkiso_cmd | format(idrac_os_deployment_custom_iso_file, idrac_os_deployment_iso_label) }}" | ||
register: idrac_os_deployment_mkisofs_output | ||
changed_when: idrac_os_deployment_mkisofs_output.rc == 0 | ||
failed_when: idrac_os_deployment_mkisofs_output.rc != 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#cloud-config | ||
# vim: ft=yaml: | ||
autoinstall: | ||
version: 1 | ||
early-commands: | ||
- ["cat", "/autoinstall.yaml"] | ||
refresh-installer: | ||
update: {{ ubuntu_update_installer }} | ||
apt: | ||
preserve_sources_list: {{ ubuntu_preserve_sources_list }} | ||
mirror-selection: | ||
primary: | ||
- country-mirror | ||
- uri: "{{ ubuntu_primary_mirror }}" | ||
arches: {{ ubuntu_primary_arches }} | ||
- uri: "{{ ubuntu_secondary_mirror }}" | ||
arches: {{ ubuntu_secondary_arches }} | ||
fallback: {{ ubuntu_fallback_strategy }} | ||
geoip: {{ ubuntu_geoip }} | ||
sources: | ||
git-ppa: | ||
source: {{ ubuntu_git_ppa }} | ||
identity: | ||
hostname: "{{ ubuntu_hostname }}" | ||
password: "{{ ubuntu_user_password }}" | ||
realname: "{{ ubuntu_realname }}" | ||
username: "{{ ubuntu_username }}" | ||
keyboard: | ||
layout: "{{ ubuntu_keyboard }}" | ||
toggle: "{{ ubuntu_keyboard_toggle }}" | ||
variant: "{{ ubuntu_keyboard_variant }}" | ||
locale: "{{ ubuntu_locale }}" | ||
ssh: | ||
allow-pw: {{ ubuntu_allow_pw }} | ||
authorized-keys: {{ ubuntu_authorized_keys }} | ||
install-server: {{ ubuntu_install_ssh }} | ||
storage: | ||
layout: | ||
name: "{{ ubuntu_storage_layout }}" | ||
match: | ||
size: "{{ ubuntu_match_size }}" | ||
late-commands: | ||
- 'echo ''APT::Install-Recommends "false";'' >/target/etc/apt/apt.conf.d/02InstallRecommends' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters