Giter Site home page Giter Site logo

ansible-role-debian-boot's Introduction

Ansible role debian-boot

If your server does not have DHCP, PXE, or IPMI in your network, it can be challenging to automate the deployment of Debian operating systems. In such cases, you may want to consider using an Ansible role to simplify the process. This role downloads the Debian Net Installer kernel and launch the OS by command kexec -l <kernel-image> --initrd=<initrd-image> --append=<kernel-command-line-args>. It also sets the networks configuration in kernel parameters, witch helps you to boot OS with static IP.

Unfortunately, not all servers support booting a kernel through kexec. Some servers may have hardware or firmware limitations that prevent the use of kexec, or the operating system may not have the necessary drivers or support for kexec. In such cases, you can set the boot menu to boot the Debian Installer on the next boot and then install the debian.

Install

ansible-galaxy role install git+https://github.com/sergelogvinov/ansible-role-debian-boot.git,main

Options

Useful variables

  1. debian_version: bookworm - version on distributive
  2. debian_grub: true - add boot menu to the grub (boot menu)
  3. debian_kexec: true - download and run talos
  4. debian_interface: eth0 - network interface
  5. debian_rebuild_initrd: true - rebuild initrd image and add network configuration to it
  6. debian_preseed: proxmox.cfg - preseed file name
    • proxmox.cfg - preseed file for proxmox with software raid1
    • proxmox-lvm.cfg - preseed file for proxmox with one disk

Prepare and launch Debian Installer

# debian.yml

- hosts: all
  vars:
    debian_grub: true
    debian_kexec: true
    debian_rebuild_initrd: true

    # If the server has bond interface
    debian_interface: bond0

    # debian_preseed: proxmox.cfg
    # debian_console: nomodeset console=tty0 console=ttyS0,115200n8
    # debian_cmdline_addon: "iommu=pt"
  roles:
    - ansible-role-debian-boot
# debian.ini

[all]
debian   ansible_host=1.2.3.4 ansible_ssh_user=root # ansible_port=112233

Deploy debian to the server

ansible-playbook -Dv -i debian.ini debian.yml

Disk partitioning

proxmox.cfg (RAID1)

Partitions:

  • 1,2 - BIOS/EFI
  • 3 - Softraid + ext4 /boot
  • 4 - swap
  • 5 - Softraid + lvm
/dev/md0               943M  197M  682M  23% /boot
/dev/sdb2              512M  164K  512M   1% /boot/efi
/dev/mapper/data-root   20G  3.0G   17G  16% /
/dev/mapper/data-vz    3.8G   60M  3.7G   2% /var/lib/vz

proxmox-lvm.cfg

Partitions:

  • 1,2 - BIOS/EFI
  • 3 - ext4 /boot
  • 4 - swap
  • 5 - lvm
/dev/sdb3              943M  197M  682M  23% /boot
/dev/sdb2              512M  164K  512M   1% /boot/efi
/dev/mapper/data-root   20G  3.0G   17G  16% /
/dev/mapper/data-vz    3.8G   60M  3.7G   2% /var/lib/vz

Resources

ansible-role-debian-boot's People

Contributors

github-actions[bot] avatar sergelogvinov avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

dot-mike

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.