commit d478449580bcd8d31fbc05613c50123d6dd30a1a Author: Jorge E. Gomez Date: Mon Oct 10 17:18:41 2022 -0500 first commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..79b50cb --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +# Ansible role to set a Raspberry Pi for registering attendance + +To be used from a `cloud-init` script when booting the Raspberry Pi for the +first time. + +The script uses **Ansible-pull** to run the playbook from this repo. + +## Cloud-init script + +Should be stored in the SD card used to boot the Raspberry Pi, in the file +`/system-boot/user-data`: + + +```yaml +config: + user.vendor-data: | + #cloud-config + package_upgrade: true + packages: + - ansible + users: + - name: sistemas + ssh-import-id: gh:jorgeegomez + write_files: + - encoding: gzip + owner: root:root + path: /root/.ssh/id_ed25519.pub + permissions: '0644' + content: !!binary | + H4sIC ... 🔒 gzipped and base64-encoded public key, + registered in Gitea as deploy key for this repo ... AAA== + - encoding: gzip + owner: root:root + path: /root/.ssh/id_ed25519 + permissions: '0600' + content: !!binary | + H4sIC ... 🔒 corresponding private key, gzipped and + base64-encoded ... AAA== + - encoding: gzip + owner: root:root + path: /root/.ssh/known_hosts + permissions: '0644' + content: !!binary | + H4sICPS ... 🔒 gzipped and base64-encoded host key for gitea ... AAA== + runcmd: + - [ ansible-pull, -U, "ssh://git@gitea.agofer.net:22001/jegomez/ansible-role-raspberry-attendance.git" ] +``` +