All Projects → sergevs → ansible-os-autoinstall

sergevs / ansible-os-autoinstall

Licence: MIT License
Unattended OS installation configuration system

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to ansible-os-autoinstall

minimyth2
Distro to make disk-less MythTV appliance
Stars: ✭ 43 (-20.37%)
Mutual labels:  pxe-boot
SnowFlake
Technology is free, SnowFlakeOS
Stars: ✭ 38 (-29.63%)
Mutual labels:  uefi-boot
ubuntu-serial-install
Ubuntu installation for servers without video card
Stars: ✭ 116 (+114.81%)
Mutual labels:  uefi-boot
arch-secure-boot
UEFI Secure Boot for Arch Linux + btrfs snapshot recovery
Stars: ✭ 60 (+11.11%)
Mutual labels:  uefi-boot
simonpi
A quick & dirty script to emulate Raspberry PI family devices on your laptop.
Stars: ✭ 61 (+12.96%)
Mutual labels:  uefi-boot
UEFI MULTI
UEFI_MULTI - Make Multi-Boot USB-Drive
Stars: ✭ 33 (-38.89%)
Mutual labels:  uefi-boot
OpenWrt-UEFI-Support
Add UEFI-Boot Support to Openwrt v19.07 & v18.06 (Unofficial Support)
Stars: ✭ 13 (-75.93%)
Mutual labels:  uefi-boot
packer-kvm
Create VM templates with Packer for usage with Libvirt/KVM virtualization : CentOS 7, CentOS 8, CentOS 8 Stream, Alma Linux, Rocky Linux, Bionic (Ubuntu 1804), Focal (Ubuntu 2004), Debian 11 (stable), Kali Linux, Fedora 33 and Fedora 34.
Stars: ✭ 99 (+83.33%)
Mutual labels:  kickstart
pxe-pilot
API and CLI to manage PXE configurations
Stars: ✭ 56 (+3.7%)
Mutual labels:  pxe-boot
payton
Payton! Kickstart any 3D OpenGL + GTK Ideas in a few seconds!
Stars: ✭ 45 (-16.67%)
Mutual labels:  kickstart
A600 ACCEL RAM
Amiga 600 Accelerator And RAM Expansion
Stars: ✭ 22 (-59.26%)
Mutual labels:  kickstart
codejam
Solutions of Code Jam problems will be here
Stars: ✭ 17 (-68.52%)
Mutual labels:  kickstart
rpi-pxe-server
A ready-to-go PXE + TFTP network boot server for Raspberry Pi, with Resin deployment
Stars: ✭ 68 (+25.93%)
Mutual labels:  pxe-boot
centos-7-kickstart
build a centos 7 iso/ovf/ova with kickstart
Stars: ✭ 22 (-59.26%)
Mutual labels:  kickstart
drevops
💧 + 🐳 + ✓✓✓ + 🤖 + ❤️ Build, Test, Deploy scripts for Drupal using Docker and CI/CD
Stars: ✭ 55 (+1.85%)
Mutual labels:  kickstart
GoogleKickStart-2021
🏃 Python Solutions of All 32 Problems in GKS 2021
Stars: ✭ 84 (+55.56%)
Mutual labels:  kickstart
kickstart
Kickstart is a CSS library designed for modularity and fast page performance
Stars: ✭ 1,884 (+3388.89%)
Mutual labels:  kickstart
PXESetupWizard
PXE Setup Wizard. Netboot Debian, Ubuntu, System Rescue CD, FreeDOS and more.
Stars: ✭ 96 (+77.78%)
Mutual labels:  pxe-boot
GoogleKickStart2020 Solutions
This repository will contain solutions of "Google Kick Start 2020" in C/C++/Java/Python. If you loved it, give a 🌟!
Stars: ✭ 137 (+153.7%)
Mutual labels:  kickstart
ubuntu-kickstart
Kickstart config files for Ubuntu
Stars: ✭ 69 (+27.78%)
Mutual labels:  kickstart

Ansible for OS autoinstall

Overview

The project goal is to provide a flexible and as simple as possible configuration tool for unattended OS installation via network for various linux distributions. It was designed to setup dozen of production and other servers and can be used by professional system administrators or for development/testing/education purposes. The playbook contains ready to use installation templates for various distributions.

A copy of a OS distribution itself is not required(!) and with the supplied default configuration an OS installation will be performed via internet from http://mirror.yandex.ru site. However if you are going to setup dozens of servers it's highly recommended to make and configure a local mirror for the required OS.

Features

Templates for unattended installation included in the playbook:

  • CentOS 6-7
  • Fedora 24-26
  • Debian Wheezy, Jessie, Stretch
  • Ubunty Trusty, Xenial, Bionic
  • OpenSuse 12.*, 13.*
  • (OpenSuse)Leap 41.*, 42.*, 15.0

Other distributions which support kickstart/preseed/autoyast can be easily added.

The playbook generates pxe boot and EFI grub menu files, so if you setup pxe boot environment(briefly described at the end) you'll have a convenient way to manage servers installation.

The playbook supports any number of an OS configurations so if you have several groups of servers with different configuration you can describe it in separate autoinstall 'receipt' files.

Caveats

The playbook is not supposed to cover setup for network boot services environment but focused on providing a ‘framework’ for generation autoinstall files for various distributions.

In the order to effectively use the playbook for your particular purposes you have to understand the principles of Linux network boot and have a base knowledge about autoinstall files for the required OS:

Requirements

Ansible version >= 2.2.1.0

In the order to perform install you need working PXE boot environment services:

  • dhcp: network boot ip address configuration
  • tftp: pxe/efi image serving
  • http: serve autoinstall (kickstart/preseed/autoyast) files

Description

Playbook structure

Global configuration variables defined at site_vars.yml Templates for autoinstall files at templates/ks , templates/preseed and templates/yast directories.

The configuration is performed via hosts file and autoinstall files customization.

Host variables

Networking parameters

If ip is not specified, DHCP will be used

  • ip : ip address of the host
  • mac : mac address of the interface. if supplied, the host will not be shown in default menu but only menu for host will be displayed
  • netmask : netmask of network
  • gateway : default network gateway
  • hostname : inventory host record
  • domain : host domain
  • nameservers : list of DNS servers
  • netargs : additional parameters to configure network. as an example for kickstart bonding: netargs='--bondopts=miimon=100,mode=1 --bondslaves=eth0,eth1'
  • bootargs : additional boot parameters. as for previous example it's required to add: bootargs='linux bond=bond0:eth0,eth1:mode=1'

OS parameters

Autoinstall file location and name convention: templates/<ks|preseed|yast>/<os>.<osver>[.type].cfg.j2 as an instance centos.7.cfg.j2

  • drive : block device to use for partition excluding /dev/ ( sda | hda | vda ). Default: sda
  • os : the name of OS
  • osver : OS version
  • type : a custom variant for installation
  • rootpw : encrypted root password. default password is root

Menu parameters

  • menu : all hosts with the same menu will be grouped and shown on the second level menu items

Inventory groups

A host must belong to at least one of the groups:

  • ks : the group for kickstart
  • preseed : the group for preseed
  • yast : the group for autoyast

The group is used to identify the type of autoinstall.

Usage

ansible-playbook -i hosts site.yaml

See also example hosts & site_vars.yml

An example to setup network boot services for CentOS 7

# configure epel release
yum install http://mirror.yandex.ru/epel/7/x86_64/e/epel-release-7-10.noarch.rpm

# install required packages
yum install syslinux-tftpboot tftp-server dhcp xinetd nginx 

# if you are going to use UEFI boot, you need to put grub2 efi loader, as an instance
mkdir -p /var/lib/tftpboot/efi.cfg
curl https://mirror.yandex.ru/centos/7/os/x86_64/EFI/BOOT/grubx64.efi > /var/lib/tftpboot/efi.cfg/grubx64.efi 

# provide minimal dhcp configuration
cat <<'EOF' > /etc/dhcp/dhcpd.conf
allow unknown-clients;
default-lease-time 1800;
max-lease-time 7200;
option arch code 93 = unsigned integer 16; # RFC4578
set pxetype = option arch;

subnet 10.0.0.0 netmask 255.255.255.0 {
  range 10.0.0.128 10.0.0.254;
  option broadcast-address 10.0.0.255;
  option domain-name-servers 10.0.0.1;
  option domain-name localdomain;
  default-lease-time 1800;
  max-lease-time 7200;
  option netbios-name-servers 10.0.0.1;
  option routers 10.0.0.1;
  next-server 10.0.0.1;
  class "pxeclients" {
    match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
    if pxetype=00:09 or pxetype=00:07 {
      filename "efi.cfg/grubx64.efi";
    } else {
      filename "gpxelinux.0";
    }
  }
}
EOF

# configure nginx to serve autoinstall files
cat <<'EOF' >/etc/nginx/default.d/ks.conf                                             
location /kickstart {
root /var/lib/;
}
EOF

# start services
service dhcpd start
service xinetd start
service nginx start
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].