{"id":16670467,"url":"https://github.com/hlapp/ansible-bbb","last_synced_at":"2026-04-22T12:02:17.138Z","repository":{"id":145825259,"uuid":"49403625","full_name":"hlapp/ansible-bbb","owner":"hlapp","description":"Ansible Playbook to set up a Beaglebone Blacks and Ninjablocks","archived":false,"fork":false,"pushed_at":"2016-02-07T17:49:16.000Z","size":40,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T17:27:10.438Z","etag":null,"topics":[],"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/hlapp.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}},"created_at":"2016-01-11T05:13:14.000Z","updated_at":"2024-11-28T10:50:28.000Z","dependencies_parsed_at":"2023-04-28T17:01:07.861Z","dependency_job_id":null,"html_url":"https://github.com/hlapp/ansible-bbb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlapp%2Fansible-bbb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlapp%2Fansible-bbb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlapp%2Fansible-bbb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hlapp%2Fansible-bbb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hlapp","download_url":"https://codeload.github.com/hlapp/ansible-bbb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243318778,"owners_count":20272136,"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":[],"created_at":"2024-10-12T11:38:33.158Z","updated_at":"2025-12-25T13:35:34.073Z","avatar_url":"https://github.com/hlapp.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ansible playbooks for Beaglebone Black\n\nAnsible playbooks and roles for setting up [Beaglebone Black] boards,\nand for deploying the [Ninjablock] software on systems that have\notherwise been properly set up.\n\n## Motivation\n\nThis project originally grew out of a desire to have a documented\nfully reproducible mechanism for taking a bare-bones (no pun intended)\n[Ubuntu image from ELinux] all the way to a fully installed\nNinjablocks device.\n\nThe later batches of Ninjablocks (mine is from those delivered 2013,\nfrom the [2012 Ninjablocks Kickstarter]) are essentially Beaglebone\nBlack boards (with a 2GB eMMC) with an Arduino-based cape. It ran\nUbuntu 13.04, with installation of software controlled by a byzantine\nmaze of shell scripts. Most software was very outdated, and the\nNinjablocks software itself was not only far from the latest versions\navailable from the company's Github repositories, but also contained a\ngood deal of local (uncommitted) changes. All this made it very difficult\nor impossible to test upgrades of any of the various components while\nretaining the possibility to either re-run or roll back changes.\n\nThe ELinux Ubuntu \"console\" images are quite minimal, and therefore\nbefore Ninjablocks can be deployed on top of them, they must undergo a\nvariety of networking and other basic system configuration and\nsoftware setup steps. This part is entirely independent of\nNinjablocks, and has been separated into its own 'role'.\n\n## How to use\n\nThe following playbooks and roles are currently available:\n\n* `bbb.yml`: playbook that applies the `bbb-init` role to hosts in the\n  `freshly-imaged` group.\n\n  The playbook can start from a BBB plugged into the USB port of the\n  host computer running Ansible and reachable at the default USB\n  gadget IP 192.168.7.2. To limit the playbook to this use-case,\n  append `--limit bb-usb` to the `ansible-playbook` command line (see\n  below).\n\n* `roles/bbb-init`: role that initializes Beaglebone Black boards,\n  starting from a (quite minimal) Elinux Ubuntu \"console\" image. Tasks\n  in the role include setting timezone, changing hostname, configuring\n  wireless network, ensuring network is up, and end in a reboot. The\n  role's play will fail if it fails to either find working network\n  (which will typically be via ethernet), or to bring up wireless network.\n\n* `ninjas.yml`: playbook that applies the `ninjablock` role to hosts\n  in the `ninjas` group. You can ignore this playbook and the\n  `ninjablock` role if you aren't looking to install a Ninjablock.\n\n* `roles/ninjablock`: role that installs all Ninjablocks software and\n  dependencies. So that it can be applied independently, the role is\n  intentionally not declared dependent on `bbb-init`, although in\n  practice almost all tasks in the role will fail if network and other\n  system setup tasks have not been performed yet.\n\nThe playbooks can be run in the following way:\n\n```sh\n$ ansible-playbook -k -K -v \u003cplaybook\u003e\n```\n\nLocal configuration variables can be set (and others overridden) on\nthe command line using `-e key=value`:\n\n```sh\n$ ansible-playbook -k -K -v -e timezone=America/New_York bbb.yml\n```\n\nThe following variables are by default expected to be set from the\ncommand line; they have no default, and the corresponding system set\nup tasks are skipped for those that aren't set:\n\n* `timezone`: name of timezone, if it is to be configured\n* `new_hostname`: hostname to change the board to\n* `wpa_ssid`: SSID of wireless network to which the board should be\n  able to connect. Wireless network configuration is skipped if not set.\n* `wpa_passkey`: passkey for the wireless network.\n* `wpa_keymgmt`: wireless key management, defaults to `WPA-PSK`.\n\nTypical applications will likely not have a whole farm of\nBBBs. Ansible allows limiting the hosts to which a playbook is applied\nvia the `--limit` parameter. For example, to limit to the default\nhostname under which a board with the Ubuntu image would appear on the\nlocal network, you would do this:\n\n```sh\n$ ansible-playbook -k -K -v -e timezone=America/New_York bbb.yml --limit arm.local\n```\n\n## Why Ansible\n\nObviously, all the tasks executed by the Ansible playbooks could be\neffected by shell scripts as well, and most use-cases (including my\nown) will likely not involve a whole complex farm of BBB boards. So\nwhy not just run a bunch of shell scripts on the one or two target\nboards?\n\nBased on spending countless hours trying to reverse engineer how a\nNinjablock environment is set up and deployed factory-wise, shell\nscripts can be byzantine and very challenging to decipher in terms of\nwhat they do under which conditions with which outcomes. Shell scripts\nare also almost always written to assume a certain starting\nenvironment. If this starting point can't be reliably recreated, for\nexample because the exact starting image isn't available - or, for\nthat matter, desirable - anymore, then shell scripts are at increased\nrisk of failing at some step(s) in typically difficult to diagnose and\ndebug ways.\n\nThough perhaps not as evident but IMO as or even more important,\nAnsible playbooks have status-checking built in through their\ndeclarative nature. Most tasks are (or can be) written by declaring\nthe desired state. If this state is already present, no action is\ntaken. This makes is possible to run the same playbook whether none,\nsome, or all of the tasks have already been done previously, without\nany alterations such as conditionals etc.\n\n## Prerequisites\n\nObviously, you must have Ansible installed. A version of at least 1.9+\nis required. (At present, the roles on purpose do not use features\navailable only since Ansible 2.+. This means that for example on Mac\nOSX, installing Ansible by `homebrew` will suffice.)\n\nThe Beaglebone board is assumed to be a Beaglebone Black; the `bbb`\nplaybook may also work with other boards in the Beaglebone family, but\nthis is untested (and I only own BBBs).\n\nAt present, the Linux distribution is assumed to be Ubuntu,\nrelease 14.04 (\"trusty\"). This is in part because Ninjablocks, which\noriginally motivated this project, use Ubuntu, and in part because (at\nleast for \"console\") the Ubuntu images from ELinux require (in my\nexperience anyway) much more setup to have functioning network and a\nreasonable system basis than the Debian images. I intend to expand the\nroles to Debian in the future. (One issue here is that Debian Jessie\nuses systemd, whereas Ubuntu Trusty still uses Upstart.)\n\n## License\n\nThis code is released under the terms of the MIT License, please see\nfile LICENSE.\n\n[Ninjablock]: https://discuss.ninjablocks.com/category/ninja-block\n[Beaglebone Black]: http://beagleboard.org/BLACK\n[Ubuntu image from ELinux]: http://elinux.org/BeagleBoardUbuntu#raw_microSD_img\n[2012 Ninjablocks Kickstarter]: https://www.kickstarter.com/projects/ninja/ninja-blocks-connect-your-world-with-the-web/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlapp%2Fansible-bbb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhlapp%2Fansible-bbb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhlapp%2Fansible-bbb/lists"}