Your Development Machine. From bare-metal to configuration-management.
This is an in-progress bringing together of my personal notes and playbooks etc. that I use to manage my own hardware. I'm learning as I go and hope that you might find something useful, or save yourself hitting as many brick-walls as I did trying to figure it all out.
Everything is based around a Debian system. While many ansible roles and scripts might also apply to other variants, to keep things simple, only Debian is targeted. Automation can get complicated quickly and I find Debian a good base to start from when trying to keep things minimal and create a solid platform for software development.
One of my goals in developing this repository was to be able to keep configuration-as-code for ad-hoc machines. While working in academia and engineering research I often encountered computers tucked away in a lab somewhere that had been all but forgotten, and no one knew how they had been configured, or how they were supposed to be configured. A preseed file and playbook of ansible roles can keep an easily reproducible record of how a system has been setup, even when that system is normally kept offline and larger enterprise solutions for bare-metal provisioning would not be as applicable.
cd ansible_playbooks
ansible-playbook --limit local --ask-become-pass playbook.yaml
or
ansible-playbook -l local -K playbook.yaml
To see a list of local machines
virsh list --all
Then to start the vm named debian-kde
, for example
virsh start debian-kde
Add public keys to remote authorized_keys
ssh-copy-id test@debian-kde.local
Then run the playbook
ansible-playbook --limit virtual playbook.yaml
See the ansible_playbooks
README for details about setting ansible vault environment variables.
An example directory layout you may wish to use with Ventoy:
/mnt/usb
├── debian
│ ├── debian-12.5.0-amd64-DVD-1.iso
│ └── debian-live-12.5.0-amd64-kde.iso
├── pop_os
│ └── pop-os_22.04_amd64_intel_20.iso
├── ventoy
│ ├── script
│ │ ├── laptop-preseed.cfg
│ │ ├── laptop-recipe.cfg
│ └── ventoy.json
└── windows
└── Win11_22H2_EnglishInternational_x64v1.iso
⚠️ Ventoy doesn't seem to read external recipe files during preseeding so the partman configuration should be inlined in the preseed file.
- Create Ansible task that copies a preseed template to ventoy with details (username, password...)
- Tidy Ansible Playbooks README
- Update Ansible Collections
- Use apt cache or similar for completely offline installs