{"id":41582422,"url":"https://github.com/mnussbaum/base16-builder-ansible","last_synced_at":"2026-01-24T08:44:38.982Z","repository":{"id":53101080,"uuid":"123871062","full_name":"mnussbaum/base16-builder-ansible","owner":"mnussbaum","description":"A Base16 builder for Ansible","archived":false,"fork":false,"pushed_at":"2025-12-22T20:27:52.000Z","size":152,"stargazers_count":10,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-24T09:50:35.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/mnussbaum.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":"2018-03-05T05:49:06.000Z","updated_at":"2025-12-22T20:27:56.000Z","dependencies_parsed_at":"2022-09-08T05:01:41.491Z","dependency_job_id":null,"html_url":"https://github.com/mnussbaum/base16-builder-ansible","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mnussbaum/base16-builder-ansible","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnussbaum%2Fbase16-builder-ansible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnussbaum%2Fbase16-builder-ansible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnussbaum%2Fbase16-builder-ansible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnussbaum%2Fbase16-builder-ansible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnussbaum","download_url":"https://codeload.github.com/mnussbaum/base16-builder-ansible/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnussbaum%2Fbase16-builder-ansible/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28721146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T08:27:05.734Z","status":"ssl_error","status_checked_at":"2026-01-24T08:27:01.197Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-24T08:44:38.907Z","updated_at":"2026-01-24T08:44:38.976Z","avatar_url":"https://github.com/mnussbaum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# base16-builder-ansible [![Build Status](https://travis-ci.org/mnussbaum/base16-builder-ansible.svg?branch=master)](https://travis-ci.org/mnussbaum/base16-builder-ansible)\n\nThis role builds and returns [Base16](https://github.com/chriskempson/base16)\nthemes. Base16 is a framework for generating themes for a wide variety of\napplications like Vim, Bash or i3 with color schemes like Tomorrow Night or\nGruvbox.\n\nThis builder's goal is to make it easy to install and update Base16 colors\nacross a wide range of applications. Using Ansible as a Base16 builder gives us\na lot of flexibility. We can generate themes and either write them as\nstandalone files or embed the theme into larger config file templates. This is\nparticularly useful for applications that can only handle a single config file,\nlike i3.\n\nInstead of downloading pre-rendered color scheme templates, this role builds\nthem on the fly. This lets us use Base16 color schemes that older template\nrepos might not have picked up yet, as well as ensuring that we're always using\nthe latest version of existing color schemes.\n\nIt currently implements vesion 0.9.1 of the Base16 spec.\n\n## Example usages\n\n```yaml\n---\nroles:\n  - mnussbaum.base16-builder-ansible\n\ntasks:\n  # Build a single color scheme and template and assign it to a variable\n  - base16_builder:\n      scheme: tomorrow-night\n      template: shell\n    register: base16_schemes\n\n  # It helps to print out the registered result once with debug to figure out how\n  # to access any particular scheme and template. Each Base16 template repo (e.g.\n  # \"shell\", \"i3\") can include multiple template files to render out, so every\n  # template repo will register their output at a slightly different index path in\n  # the result object.\n\n  - debug:\n      var: base16_schemes\n\n  # I'll elide the rendered contents for readability, but result will look like this:\n  #\n  # \"base16_schemes\": {\n  #   \"changed\": true,\n  #   \"failed\": false,\n  #   \"schemes\": {\n  #     \"tomorrow-night\": {\n  #       \"shell\": {\n  #         \"scripts\": {\n  #           \"base16-tomorrow-night.sh\": \"#!/bin/sh\\n# base16-shell ...\"\n  #         }\n  #       },\n  #       \"scheme-variables\": {\n  #         \"base00-dec-b\": \"0.12941176470588237\",\n  #         \"base00-dec-g\": \"0.12156862745098039\",\n  #         \"base00-dec-r\": \"0.11372549019607843\",\n  #         \"base00-hex\": \"1d1f21\",\n  #         \"base00-hex-b\": \"21\",\n  #         \"base00-hex-g\": \"1f\",\n  #         \"base00-hex-r\": \"1d\",\n  #         \"base00-rgb-b\": \"33\",\n  #         \"base00-rgb-g\": \"31\",\n  #         \"base00-rgb-r\": \"29\",\n  #         ...Many more color variables...\n  #         \"scheme-author\": \"Chris Kempson (http://chriskempson.com)\",\n  #         \"scheme-name\": \"Tomorrow Night\",\n  #         \"scheme-slug\": \"tomorrow-night\",\n  #         \"scheme-slug-underscored\": \"tomorrow_night\"\n  #     }\n  #     }\n  #   }\n  # }\n\n  # You can write the generated color schemes to a file or render them into your\n  # own templates\n  - copy:\n      content: \"{{ base16_schemes['schemes']['tomorrow-night']['shell']['scripts']['base16-tomorrow-night.sh'] }}\"\n      dest: /my/bash/profile/dir/tomorrow-night-shell.sh\n\n  # Build every template for a single color scheme\n  - base16_builder:\n      scheme: tomorrow-night\n    register: base16_schemes\n\n  # Build every color scheme for a single template\n  - base16_builder:\n      template: shell\n    register: base16_schemes\n\n  # Build every color scheme for every template\n  - base16_builder: {}\n    register: base16_schemes\n\n  # Build every color scheme for a few select templates\n  - base16_builder:\n      template:\n        - shell\n        - i3\n        - qutebrowser\n    register: base16_schemes\n\n  # Download latest color scheme and template source files, but don't build anything\n  - base16_builder:\n      update: yes\n      build: no\n\n  # Download updates for and rebuild a single template and scheme\n  - base16_builder:\n      update: yes\n      scheme: tomorrow-night\n      template: shell\n    register: base16_schemes\n\n  # If you make your own Base16 color scheme and want to reference it before it's\n  # pulled into the master list of schemes you can fork the master list, add a\n  # reference to your scheme, and then use your list fork as the schemes source\n  # arg here. The same applies to new template repos and the master template\n  # list. Those master lists are available at:\n  #\n  #   https://github.com/chriskempson/base16-schemes-source\n  #   https://github.com/chriskempson/base16-templates-source\n  #\n  - base16_builder:\n      scheme: my-brand-new-color-scheme\n      template: shell\n      schemes_source: http://github.com/my-user/my-schemes-source-fork\n      templates_source: http://github.com/my-user/my-templates-source-fork\n```\n\n## Options\n\n```yaml\nscheme:\n  description:\n    - Set this to the name of a color scheme to only build that one scheme, instead of building all, which is the default\n    - Only building a single scheme is much faster then building all\n  required: false\n  type: string\n  default: Build all schemes\nscheme_family:\n  description:\n    - Set this to the name of a group of schemes that live in a single repo (i.e. a family) to only build that group of schemes\n    - If this is unset, and a scheme argument is passed, it's expected the scheme name is present in the scheme family name. E.g. Scheme family \"tomorrow\" is present in scheme names \"tomorrow-night\" and \"tomorrow\"\n    - Only set this arg if the scheme family name isn't included in the scheme names. E.g. scheme family \"materialtheme\" isn't included in scheme name \"material-darker\"\n  required: false\n  type: string\n  default: Build all schemes\ntemplate:\n  description:\n    - Set this to the name of a template or a list of template names to only build them instead of building all, which is the default\n    - Only building a few templates is much faster then building all\n  required: false\n  type: list\n  default: Build all templates\ncache_dir:\n  description:\n    - Parent directory to store cloned scheme, template and source data\n    - Will be created if it doesn't exist already\n    - The default looks for the $XDG_CACHE_DIR env var, then a ~/.cache dir, and falls back to the platform's temp dir if the first two don't exist\n  required: false\n  type: string\n  default: First available of $XDG_CACHE_DIR, $HOME/.cache, or platform derived temp dir\nschemes_source:\n  description:\n    - Git repo URL or local directory path used to find schemes\n    - The source must include a list.yaml file that maps scheme names to scheme repo Git URLs or local directory paths\n  required: false\n  type: string\n  default: https://github.com/chriskempson/base16-schemes-source\ntemplates_source:\n  description:\n    - Git repo URL or local directory path used to find templates\n    - The source must include a list.yaml file that maps template names to template repo Git URLs or local directory paths\n  required: false\n  type: string\n  default: https://github.com/chriskempson/base16-templates-source\nupdate:\n  description:\n    - Clone or pull color scheme and template sources\n    - By default will update all schemes and templates, but will repect scheme and template args\n    - Build will donwload any missing data, so you never _need_ to call update\n  required: false\n  type: bool\n  default: no\nbuild:\n  description:\n    - Set to \"no\" to disable building of any color schemes or templates\n    - Useful to set to \"no\" when used with update to only download sources\n  required: false\n  type: bool\n  default: yes\n```\n\n## Dependencies\n\n- Python 3.5 or greater, 2.7 will likely work, but is untested\n- Ansible\n- [Pystache](https://github.com/defunkt/pystache), which you can install with:\n\n  ```bash\n  pip install pystache\n  ```\n\n## Installation\n\nYou can install this role with\n[`ansible-galaxy`](https://galaxy.ansible.com/intro). Check out the\n`ansible-galaxy` docs for all the different ways you can install roles, but the\nsimplest is just:\n\n    $ ansible-galaxy install mnussbaum.base16-builder-ansible\n\nAfter you've installed the role you need to reference it, and then you can use\nthe `base16_builder` module it provides. Here's a very short example of this:\n\n```yaml\n---\nroles:\n  - mnussbaum.base16-builder-ansible\n\ntasks:\n  - base16_builder:\n      scheme: tomorrow-night\n      template: shell\n    register: base16_schemes\n```\n\nIf you don't want to, or can't, use `ansible-galaxy`, then you can clone this\nrepo and drop it directly into your [Ansible roles\npath](https://docs.ansible.com/ansible/latest/playbooks_reuse_roles.html#role-search-path).\n\nEither way you install the role, don't forget to also install the Pystache\ndependency as mentioned above.\n\n## Developing\n\nThis project uses [Pipenv](https://github.com/pypa/pipenv) to install\ndependencies. To run the tests:\n\n```bash\npip install --user pipenv\npipenv install --dev\npipenv run nose2\n```\n\nYou can also run the tests in a Docker container against all supported Python\nversions with:\n\n```bash\n./ci\n```\n\n## License\n\n[MIT](LICENSE)\n\n## To do\n\n- Parallelize git pulls\n- Allow the Base16 unclaimed schemes to be used too\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnussbaum%2Fbase16-builder-ansible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnussbaum%2Fbase16-builder-ansible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnussbaum%2Fbase16-builder-ansible/lists"}