{"id":21726733,"url":"https://github.com/escalate/ansible-gitops-raspberry-pi-os-custom-disk-image","last_synced_at":"2025-07-10T01:36:01.820Z","repository":{"id":79361023,"uuid":"332277827","full_name":"escalate/ansible-gitops-raspberry-pi-os-custom-disk-image","owner":"escalate","description":"A build tool to create a customized Raspberry Pi OS disk image which initiates the Ansible GitOps workflow on first boot","archived":false,"fork":false,"pushed_at":"2025-03-16T13:53:59.000Z","size":60,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T17:41:39.414Z","etag":null,"topics":["ansible","gitops","raspberry","raspberry-pi","raspberrypi","self-hosted","selfhosted"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/escalate.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":"https://paypal.me/felixboerner"}},"created_at":"2021-01-23T18:16:00.000Z","updated_at":"2025-03-16T13:54:01.000Z","dependencies_parsed_at":"2025-03-16T11:33:30.368Z","dependency_job_id":null,"html_url":"https://github.com/escalate/ansible-gitops-raspberry-pi-os-custom-disk-image","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escalate%2Fansible-gitops-raspberry-pi-os-custom-disk-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escalate%2Fansible-gitops-raspberry-pi-os-custom-disk-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escalate%2Fansible-gitops-raspberry-pi-os-custom-disk-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/escalate%2Fansible-gitops-raspberry-pi-os-custom-disk-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/escalate","download_url":"https://codeload.github.com/escalate/ansible-gitops-raspberry-pi-os-custom-disk-image/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647249,"owners_count":21139081,"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","gitops","raspberry","raspberry-pi","raspberrypi","self-hosted","selfhosted"],"created_at":"2024-11-26T03:39:33.909Z","updated_at":"2025-07-10T01:36:01.811Z","avatar_url":"https://github.com/escalate.png","language":"Shell","funding_links":["https://paypal.me/felixboerner"],"categories":[],"sub_categories":[],"readme":"[![Test](https://github.com/escalate/ansible-gitops-raspberry-pi-os-custom-disk-image/actions/workflows/test.yml/badge.svg?branch=master\u0026event=push)](https://github.com/escalate/ansible-gitops-raspberry-pi-os-custom-disk-image/actions/workflows/test.yml)\n\n# Ansible GitOps - Raspberry Pi OS custom disk image\n\nA build tool based on [CustoPiZe](https://github.com/OctoPrint/CustoPiZer) to create a custom Raspberry Pi OS disk image that starts the Ansible GitOps workflow on first boot.\n\n## How does it work?\n\nThe build tool downloads the latest [Raspberry Pi OS Lite (32-bit / 64-bit)](https://www.raspberrypi.com/software/operating-systems/) disk image and creates a systemd service in it that starts the Ansible GitOps workflow on first boot.\n\nAfter the Raspberry Pi has successfully booted with the customized disk image, the systemd service prepares all required [dependencies](https://github.com/escalate/ansible-gitops-raspberry-pi-os-custom-disk-image/blob/master/scripts/files/gitops-preparation.sh) and executes a [bootstrap script](https://github.com/escalate/ansible-gitops-raspberry-pi-os-custom-disk-image/blob/master/scripts/files/gitops-bootstrap.sh) with the settings preconfigured by the user.\n\nThe [bootstrap script](https://github.com/escalate/ansible-gitops-raspberry-pi-os-custom-disk-image/blob/master/scripts/files/gitops-bootstrap.sh) checks out the preconfigured [Git repository](https://github.com/escalate/ansible-gitops-example-repository/), installs required roles and collections and runs the `bootstrap.yml` playbook.\nThe `bootstrap.yml` playbook must contain all steps for the further process, e.g. the preparation of an external USB drive and a cronjob for the regular execution of the [rollout script](https://github.com/escalate/ansible-gitops-raspberry-pi-os-custom-disk-image/blob/master/scripts/files/gitops-rollout.sh).\n\nAfter the successful run of the `bootstrap.yml` playbook, markers are set to prevent the scripts from being restarted at the next system start. Finally, the system is rebooted to complete all changes.\n\nAll configuration changes on the Raspberry Pi should now be possible via the `site.yml` of the configured [Git repository](https://github.com/escalate/ansible-gitops-example-repository/).\n\n## How to create a customized disk image?\n\n1. Define necessary environment variables needed for the later ansible-playbook run.\n\n```\n# The Fully Qualified Domain Name (FQDN) of your server\nexport ANSIBLE_HOSTNAME=\"testserver.fritz.box\"\n\n# The Ansible inventory group name where your server belongs to. For more information see https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html\nexport ANSIBLE_HOSTGROUP=\"testing\"\n\n# The URL of your Ansible control repository\nexport ANSIBLE_REPOSITORY_URL=\"https://github.com/escalate/ansible-gitops-example-repository.git\"\n\n# The secret password to decrypt your Ansible Vault file. For more information see https://docs.ansible.com/ansible/latest/user_guide/vault.html\nexport ANSIBLE_VAULT_PASSWORD=\"s3cret\"\n```\n\n2. Start the build process with one of the following commands.\n\n32-bit OS version:\n\n```\nmake build-32bit\n```\n\n64-bit OS version:\n\n```\nmake build-64bit\n```\n\n3. Flash the customized disk image with [balena Etcher](https://etcher.balena.io/) to the SD card.\n\n4. Insert the SD card into the Raspberry Pi and power it up. Done.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescalate%2Fansible-gitops-raspberry-pi-os-custom-disk-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fescalate%2Fansible-gitops-raspberry-pi-os-custom-disk-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fescalate%2Fansible-gitops-raspberry-pi-os-custom-disk-image/lists"}