{"id":14965376,"url":"https://github.com/ryanwalder/saltstack-lxc-vagrant","last_synced_at":"2026-03-06T18:03:54.989Z","repository":{"id":27006006,"uuid":"30470080","full_name":"ryanwalder/saltstack-lxc-vagrant","owner":"ryanwalder","description":"Vagrantfile for setting up a SaltStack test/dev environment.","archived":false,"fork":false,"pushed_at":"2017-12-12T10:31:29.000Z","size":228,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-11-15T18:03:25.297Z","etag":null,"topics":["lxc","salt","saltstack","vagrant"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jinjiebang/wine","license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanwalder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-02-07T21:00:24.000Z","updated_at":"2018-07-25T06:56:44.000Z","dependencies_parsed_at":"2022-08-31T21:35:52.750Z","dependency_job_id":null,"html_url":"https://github.com/ryanwalder/saltstack-lxc-vagrant","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ryanwalder/saltstack-lxc-vagrant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwalder%2Fsaltstack-lxc-vagrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwalder%2Fsaltstack-lxc-vagrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwalder%2Fsaltstack-lxc-vagrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwalder%2Fsaltstack-lxc-vagrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanwalder","download_url":"https://codeload.github.com/ryanwalder/saltstack-lxc-vagrant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwalder%2Fsaltstack-lxc-vagrant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30189483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T17:33:53.563Z","status":"ssl_error","status_checked_at":"2026-03-06T17:33:51.678Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["lxc","salt","saltstack","vagrant"],"created_at":"2024-09-24T13:34:39.672Z","updated_at":"2026-03-06T18:03:54.948Z","avatar_url":"https://github.com/ryanwalder.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# saltstack-lxc-vagrant\n\nVagrantfile for spinning up a local Salt Master and minions, all defined in YAML because YAML is nice to read and anyone using salt should be familiar with it!\n\n## Requirements\n\nThis assumes Ubuntu a 16.04 host, but should work on any modern linux distro (package names are likely vary)\n\n### A Note on Boxes\n\nFor now the default box is the `fgrehm/trusty64-lxc` box which is reasonably out of date due to the maintainer of the Vagrant lxc base boxes stepping down so this box is no longer updated or uploaded to Atlas, you can however really easily make your own boxes from the forked and maintained [repo](https://github.com/obnoxxx/vagrant-lxc-base-boxes) which you can use either locally or upload to a server and use the url.\n\n### Packages\n\n\n0. Vagrant 1.5+ (tested with 1.7.2)\n0. lxc 0.7.5+\n0. tar 1.27 (the lxc-template script uses the --xattrs option)\n0. `redir` (if you are planning to use port forwarding)\n0. `brctl` (if you are planning to use private networks, on Ubuntu this means apt-get install bridge-utils)\n0. [kernel !=3.5.0-17.28](https://github.com/fgrehm/vagrant-lxc/wiki/Troubleshooting#im-unable-to-restart-containers)\n\n### Vagrant plugins\n\n1. [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc)\n2. [salty-vagrant-grains](https://github.com/ahmadsherif/salty-vagrant-grains) (optional)\n\nIf installed the vagrant-salty-grains plugin will be used for creating grains on the minions and devmaster.\n\n## Quickstart\n\n0. Clone the repo\n    * `git clone https://github.com/ryanwalder/saltstack-lxc-vagrant.git`\n0. Copy the `vagrant.example.yaml` to `vagrant.yaml`\n    * `cd saltstack-lxc-vagrant \u0026\u0026 cp vagrant.example.yaml vagrant.yaml`\n0. Check your available boxes\n    * `vagrant status`\n0. Spin up the devmaster\n    * `vagrant up devmaster`\n0. Spin up the minions as desired\n    * `vagrant up box-01`\n\nOnce you're up and running you'll need to create some `top.sls` files in `salt/salt` and `salt/pillar` (the master will automatically load these when you create them) from here you can get on with [developing some salt](https://docs.saltstack.com/en/getstarted/config/).\n\n\u003e Note: This Vagrantfile does not run a highstate by default (configurable below) as I find it can slow things down when developing states. Once you're all up and running you can ssh into it and run a highstate manually with `vagrant ssh minion-box` then `sudo salt-call state.highstate`\n\n## YAML file\n\nAll settings and minions are defined in the `vagrant.yaml` file with everything having sane defaults and being customizable as needed.\n\nBoth the Master and Minion configs are automatically generated if they don't exist or when you update the `vagrant.yaml`.\n\n\u003e NOTE: Updating either the master or minion config will require reprovisioning all machines as these files are injected during machine creation\n\n### Global Settings\n\nAll global settings are stored under the `settings` key, some can be overidden on a per machine basis (detailed below).\n\n| Key | Use | Default Value |\n| --- | --- | ------------- |\n| `salt_version` | Set version of salt to use/install | stable |\n| `install_args` | When performing a git install, you can specify a branch, tag, or any treeish. Not supported on Windows. | |\n| `domain` | Appended to the end of minion names | |\n| `default_box` | Default box to use for minions | fgrehm/trusty64-lxc |\n| `default_box_url` | Default box URL | |\n| `network` | Network to use for vagrant (/24), without last octect | 10.0.3 |\n| `bridge` | Network bridge device to use | 'lxcbr0' |\n\n#### Example\n\n```YAML\nsettings:\n  default_box: fgrehm/trusty64-lxc\n  network: 10.66.6\n  salt_version: git\n  install_args: 2016.11.7\n```\n\n### Master Settings\n\n| Key | Use | Default Value |\n| --- | --- | ------------- |\n| `box` | Master box to use | `default_box` |\n| `box_url` | Master box URL | |\n| `grains` | Grains to apply to the master | |\n| `folders` | Dict of folders and destinations to be mounted on the master | |\n\n#### Master Config\n\nThis is a block of YAML that will be translated to the [master config](https://docs.saltstack.com/en/latest/ref/configuration/master.html) on the `saltmaster` machine.\n\n#### Master Grains\n\nIf you're using the vagrant-salty-grains plugin you can set master grains via the YAML file (probably not needed as the `devmaster` doesn't really do much other than mount local files and run the master process)\n\n#### Example\n\nIn the below example I'm settings some custom grains, remapping the shared folders as I want everything under one directory (/srv/salt) so I need to salso update the master config to match the new locations. This could also be used for mapping folders which exist outside this repo.\n\n```YAML\nsettings:\n  salt:\n    master:\n      grains:\n        one: two\n        alist:\n          - foo\n          - bar\n      folders:\n        - from: salt/states\n          to: /srv/salt/states\n        - from: salt/formulas\n          to: /srv/salt/formulas\n        - from: salt/pillar\n          to: /srv/salt/pillar\n      config:\n        file_roots:\n          base:\n            - /srv/salt/states\n            - /srv/salt/formulas/*\n        pillar_roots:\n          base:\n            - /srv/salt/pillar\n\n```\n### Global Minion Config\n\nExactly the same as the master config just using the minion YAML key instead.\n\n```YAML\nsettings:\n  salt:\n    minion:\n      config:\n        foo: bar\n        some_options:\n          - one\n          - two\n          - three\n```\n\n### Default Minion Grains\n\nIf you're using the vagrant-salty-grains plugin you can set default grains which will be applied to all minions, these will be merged with any grains specified on a per minion basis (detailed below)\n\n```YAML\nsettings:\n  salt:\n    minions:\n      default_grains:\n        foo: bar\n        grains_list:\n          - baz\n          - qux\n```\n\n## Defining Minions\n\nMinions are defined under the `minions` key with a number of settings available per minion\n\n| Key | Use | Default Value |\n| --- | --- | ------------- |\n| `name` | Name of the minion | none (required) |\n| `cpu` | Number of CPUs assigned to the container | 1 |\n| `ram` | Amount of RAM assigned to the container | 512M |\n| `box` | Box to use for the minion | `default_box` |\n| `box_url` | Box URL for the above box | none |\n| `folders` | Folders to share with the minion | none |\n| `grains` | Grains to set on the minion | {} |\n| `highstate` | Run highstate on minion during provisioning | flase |\n\n### Minimum YAML Needed for a Minion\n\n```YAML\nminions:\n  - name: minion-box\n```\n\n### Shared Folders\nIf you need to share folders with the minion you can add them in like so:\n\n```yaml\nminions:\n  - name: minion-box\n    folders:\n      - from: ~/source/folder\n        to: /destination/folder\n```\n\nYou can repeat this as many times as needed:\n\n```yaml\nminions:\n  - name:\n    folders:\n      - from: ~/source/folder1\n        to: /destination/folder1\n      - from: ~/source/folder2\n        to: /destination/folder2\n      - from: ~/source/folder3\n        to: /destination/folder3\n```\n\n### Per Minion Grains\n\n```yaml\nminions:\n  - name: minion-box\n    grains:\n      foo: bar\n      baz:\n        one: 1\n      qux:\n        - blah\n```\n\n### Example minion.yaml\n\n```yaml\nminions:\n  - name: minion-01\n  - name: minion-02\n    box: fakebox\n    box_url: http://example.com/fakebox.box\n    grains:\n      i_like_turtles: true\n  - name: minion-03\n    ram: 1024M\n    cpu: 4\n    highstate: true\n    folders:\n      - from: ~/boom\n        to: /shanka\n\n```\n\n# Notes\n\nIt's always best to fire up the `devmaster` before the minions or you can get everything in a bit of a race condition where the minions come up before the master which leads to a broken setup where the minions are up before the master where you need to manually restart the salt-minion on each minion box to get them talking to the master properly, and that's no fun.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanwalder%2Fsaltstack-lxc-vagrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanwalder%2Fsaltstack-lxc-vagrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanwalder%2Fsaltstack-lxc-vagrant/lists"}