{"id":21221647,"url":"https://github.com/perryflynn/iac","last_synced_at":"2026-05-14T05:32:07.545Z","repository":{"id":232667173,"uuid":"784884041","full_name":"perryflynn/iac","owner":"perryflynn","description":"Infrastructure as Code","archived":false,"fork":false,"pushed_at":"2025-03-10T20:08:48.000Z","size":6526,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-10T21:23:02.874Z","etag":null,"topics":["ansible","arch-iso","arch-linux","automated-installation","automation","debian","ubuntu","unattended-installation"],"latest_commit_sha":null,"homepage":"https://serverless.industries/projects.html#iac","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perryflynn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-10T18:47:10.000Z","updated_at":"2025-03-10T20:08:52.000Z","dependencies_parsed_at":"2024-04-21T00:47:47.498Z","dependency_job_id":"2e14301c-c901-44b9-a8dc-d51446cb92f6","html_url":"https://github.com/perryflynn/iac","commit_stats":null,"previous_names":["perryflynn/iac"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perryflynn%2Fiac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perryflynn%2Fiac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perryflynn%2Fiac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perryflynn%2Fiac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perryflynn","download_url":"https://codeload.github.com/perryflynn/iac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243668234,"owners_count":20328042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","arch-iso","arch-linux","automated-installation","automation","debian","ubuntu","unattended-installation"],"created_at":"2024-11-20T22:30:44.635Z","updated_at":"2026-05-14T05:32:07.515Z","avatar_url":"https://github.com/perryflynn.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iac\n\nInfrastructure as Code.\n\nThis project installs and configures Arch Linux, Debian or Ubuntu operating systems fully automated.\n\n\u003e ⚠ Make sure to create a `.env` file and reference to the correct code branch with the env vars in it!\n\nFeatures:\n\n- 💿 Build the installer ISO image in a Docker environment\n- 💡 Read hostname and OS type from UEFI variables or use cloud-init\n- 🔨 Install a minimal Arch Linux OS, Debian OS or Ubuntu OS\n- ❓ Decide target disk for installation, etc by hostname\n- 🔐 Setup root password, SSH keys and user accounts\n- 🚀 Autostart OS configuration at first boot\n- 💻 Autostart Desktop configuration at first Desktop logon\n- ⏱ From blank disk to booted system in ~15 Minutes\n\nWorkflow base installation \u0026 hostname based configuration:\n\n```mermaid\ngraph LR\n    build[\"Build\u003cbr\u003eISO\"] --\u003e boot[\"Boot\u003cbr\u003eISO\"]\n    boot --\u003e bootstrap[\"Run\u003cbr\u003ebootstrap\"]\n    bootstrap --\u003e reboot1[\"Reboot into\u003cbr\u003enew OS\"]\n    autorun1[\"Autorun host\u003cbr\u003eplaybook on\u003cbr\u003efirst boot\u003cbr\u003e(Install OS components)\"]\n    autorun1 --\u003e reboot2[\"Reboot\"]\n    reboot2 --\u003e xfce[\"Boot into\u003cbr\u003eXFCE4\"]\n    xfce --\u003e autorun2[\"Run host\u003cbr\u003eplaybook on\u003cbr\u003efirst XFCE Login\u003cbr\u003e(Configure XFCE4)\"]\n    autorun2 --\u003e logout[\"Logout\u003cbr\u003eto load\u003cbr\u003eXFCE settings\"]\n    logout --\u003e done[\"Done!\"]\n```\n\n## Known Issues\n\n- `selfsignedcert` role is not idempotent\n\n## Architecture\n\nAll packages are installed from the official sources.\n\n- bash\n- systemd\n- systemd-networkd (DHCP on all ens* interfaces)\n- systemd-timesyncd\n- systemd-resolved\n- net-tools + dnsutils\n- nano + vim\n- curl + wget\n- Ansible\n\n| OS                   | #Packages | #Processes | Size  | Memory |\n|----------------------|-----------|------------|-------|--------|\n| Ubuntu 24.04 \"Noble\" |      ~390 |         14 | 2.5GB |  280MB |\n| Debian 12 \"Bookworm\" |      ~390 |         14 | 2.2GB |  270MB |\n| Arch Linux           |      ~170 |         20 | 2.7GB |  300MB |\n\n## archiso\n\n[Archiso](https://wiki.archlinux.org/title/archiso) is used as a base for the Installer ISO. \n[archiso/](./archiso/) contains a Dockerfile and some scripts to build a custom Arch Linux installer \nISO with additional scripts.\n\n- `./archiso/build.sh` builds the container image\n- `./archiso/pack.sh` runs the container image to build the Arch Linux ISO image\n- ISO Image can be found in `./archiso/output/`\n\nRequires Docker CE, `pack.sh` executes a container **in privileged mode**.\n\n## Automatic configuration with Cloud-Init\n\nWorks with terraform, to be documented here.\n\n## Automatic hostname detection with UEFI varables\n\nThe `perrys-bootstrapper.sh` script is using UEFI variables to fetch the hostname from the system and use the\ncorrect ansible inventory variables.\n\nSet hostname in UEFI variable:\n\n```sh\necho -n myhostname \u003e efi-hostname\nefivar --name ed38a5bf-1135-4b0f-aa72-49d30b05dfd4-PerryHostname -w -f efi-hostname\n```\n\nGet the hostname from UEFI variable:\n\n```sh\ncat /sys/firmware/efi/efivars/PerryHostname-ed38a5bf-1135-4b0f-aa72-49d30b05dfd4\n```\n\nIn addition the variable `PerryFlavor-ed38a5bf-1135-4b0f-aa72-49d30b05dfd4` can be used to\nset the flavor (`debian` or `archlinux`).\n\n## How to install a OS\n\n- Build the Arch Linux ISO image\n- Boot ISO in a virtual machine or on a physical system\n- Ensure that the `diskdev` and `bootmode` are correct in the [inventoy](./inventory/defaults.yml)\n- Run installer\n    - Debian: `perrys-bootstrapper.sh --flavor debian --hostname biostest`\n    - Arch Linux: `perrys-bootstrapper.sh --flavor archlinux --hostname biostest`\n- Reboot into the new OS\n\n## How to decide which settings should be used\n\nThe `bootstrapparameters` in the Ansible inventory decide which hostname uses which settings.\n\n- `bootmode`: One of `uefi` or `bios`\n- `diskdev`: For example `/dev/sda`\n- `firstbootplaybook`: Boolean, running host-specific playbook on first boot?\n- `networking`: One of `network-manager` or `systemd-networkd`\n- `encryptedfs`: Boolean, encrypt the root filesystem?\n\n## Configure OS\n\nRun `perrys-ansible-apply.sh` as root.\n\nIt pulls automatically the correct playbook from this repo by the hostname of the operating system.\n\n## Ansible Roles\n\nEvery role was created for a specific case and may support only a single OS, please see task code and readme file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperryflynn%2Fiac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperryflynn%2Fiac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperryflynn%2Fiac/lists"}