{"id":15676969,"url":"https://github.com/jtyr/vagrantfile_config","last_synced_at":"2025-05-07T00:41:02.484Z","repository":{"id":69604397,"uuid":"78006623","full_name":"jtyr/vagrantfile_config","owner":"jtyr","description":"Generic Vagrantfile configurable via YAML config file.","archived":false,"fork":false,"pushed_at":"2021-01-03T12:11:10.000Z","size":23,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T04:37:02.519Z","etag":null,"topics":["ansible","vagrant","vagrantfile","yaml"],"latest_commit_sha":null,"homepage":"","language":null,"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/jtyr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-04T10:39:06.000Z","updated_at":"2023-10-20T10:00:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a02bda6-94d9-4759-8dc6-6da5aa7483d8","html_url":"https://github.com/jtyr/vagrantfile_config","commit_stats":{"total_commits":26,"total_committers":3,"mean_commits":8.666666666666666,"dds":0.07692307692307687,"last_synced_commit":"147a3825e0246f800c59b7855fa2ff103f5dd02e"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fvagrantfile_config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fvagrantfile_config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fvagrantfile_config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtyr%2Fvagrantfile_config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtyr","download_url":"https://codeload.github.com/jtyr/vagrantfile_config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252793545,"owners_count":21805053,"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","vagrant","vagrantfile","yaml"],"created_at":"2024-10-03T16:07:48.381Z","updated_at":"2025-05-07T00:41:02.479Z","avatar_url":"https://github.com/jtyr.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Vagrantfile Config\n==================\n\nThis is a generic\n[Vagrantfile](https://www.vagrantup.com/docs/vagrantfile/) configurable\nvia config file. Current implementation supports [VirtualBox\nprovider](https://www.vagrantup.com/docs/virtualbox/) and [Ansible\nprovisioner](https://www.vagrantup.com/docs/provisioning/ansible.html).\n\nPlease report any issues or send PR.\n\n\nInstallation\n------------\n\nIt's recomended to make a clone of this Git repository and symlink the\n`Vagrantfile` into to the workdir:\n\n```\n# Clone the Git repo\ngit clone https://github.com/jtyr/vagrantfile_config.git\n# Symlink the Vagrant file into the workdir\nln -s $PWD/vagrantfile_config/Vagrantfile /path/to/the/workdir/\n# Change directory into the workdir\ncd /path/to/the/workdir/\n# Create minimal configuration for the Vagrantfile\ncat \u003e vagrant.yaml \u003c\u003cEND\n---\n\nvms:\n  test:\nEND\n# Run Vagrant to spin up the VM\nvagrant up\n```\n\nLike that, when the Git directory is updated, all symlinked Vagrantfiles\nwill be updated automatically as well.\n\n\nConfiguration\n-------------\n\nConfiguration can be done on two levels - for all VMs in the `default`\nsection and for individual VMs in the `vms` section.\n\n```\n---\n\ndefault:\n  # Default box for all VMs is centos/7\n  box: centos/7\n\nvms:\n  # VM test1 has no configuration. The default configuration will be used.\n  test1:\n  # VM test2 has custom configuration for the box name\n  test2:\n    box: centos/6\n```\n\nExample of more complex configuration:\n\n```\n---\n\ndefault:\n  # Box definition can be either string as shown above or hash allowing to\n  # define additional parameters\n  box:\n    name: centos/7\n    # Box version\n    version: v1611.01\n    # Custom URL where to download the box\n    url: https://www.server.com/box/centos7.box\n    # Disable SSL certificate checking if the cert is self-signed\n    download_insecure: yes\n  # Group all VMs into the following VirtualBox group\n  group: TestGroup\n  # Create secondary network interface with the following IP range\n  ip_range: 192.168.10.%d\n  # The IPs will start with 192.168.10.50\n  ip_start: 50\n  # Assign unique SSH port to each of the VMs starting at this number\n  ssh_port_start: 10000\n  # Optional SSH params\n  ssh:\n    # User used to connect via SSH\n    user: vagrant\n    # User password\n    password: vagrant\n    # Path to the private key\n    private_key: ~/.vagrant.d/insecure_private_key\n  # Enable to show the VM gui\n  gui: yes\n  # Use 2 CPU cores\n  cpus: 2\n  # All VMs will have 1GB of memory\n  memory: 1024\n  # Extra disks will use SATA controller\n  storage_controller_type: sata\n  # Name of the controller\n  #storage_controller_type: SATA\n  # Whether to create disk controller\n  #storage_controller_create: yes\n  # Disk device\n  #storage_controller_device: 0\n  # Disk port offset\n  #storage_controller_offset: 0\n  # All VMs will have two disks (system disk 20GB, data disk 10GB)\n  extra_disks:\n    - 20\n    - 10\n  # Enable shared folder for Linux guest\n  synced_folder:\n    enabled: yes\n    host: /tmp\n    guest: /vagrant\n    #create: no\n    #type: virtualbox\n  # Enable shared folder for Windows guest\n  #synced_folder:\n  #  enabled: yes\n  #  host: .\n  #  guest: /vagrant\n  #  # Options for the 'virtualbox' type\n  #  type_opts:\n  #    automount: yes\n  # Expose some VM ports\n  ports:\n    # Expose port 80\n    HTTP:\n      host: 10080\n      guest: 80\n      # Optionally, also protocol can be specified [tcp|udp] - default is tcp\n      proto: tcp\n    # Expose port 443\n    HTTPS:\n      host: 10443\n      guest: 443\n  # Set MAC address of the second NIC\n  #mac: 080027ad3020\n  # Set Boot priority of the second NIC\n  #bootprio: 1\n  # Set environment variables\n  #env_vars:\n  #  ANSIBLE_PYTHON_INTERPRETER: /usr/local/bin/python\n  # Enable or disable USB\n  #usb: no\n  # Specify USB version [1|2|3]\n  #usb_version: 1\n  # Audio setting\n  #audio: none\n  # Allow setting hostnames\n  #set_hostname: no\n\nvms:\n  test1:\n  # All default options from above can also be used on the VM level\n  test2:\n    # For example this VM will have 3 CPU cores\n    cpus: 3\n    # It's also possible to define explicit IP\n    ip: 192.168.10.3\n    # Explicit SSH port can be set per VM\n    ssh:\n      port: 1234\n    # Set custom hostname\n    #hostname: test2.local\n```\n\nExample of Ansible provisioning for all VMs:\n\n```\n---\n\ndefault:\n  # Provision all VMs with Ansible after all VMs are built\n  provision_all: yes\n\nvms:\n  test1:\n  test2:\n```\n\nExample of Ansible provisioning for individual VMs:\n\n```\n---\n\ndefault:\n  # Provision all VMs with Ansible after each VMs is built\n  provision_individual: yes\n\nvms:\n  test1:\n  test2:\n```\n\nMore complex example of Ansible provisioning:\n\n```\n---\n\n# Re-usable variable for default Ansible groups definition\ndefault_groups: \u0026default_groups\n\ndefault:\n  # Provision all VMs with Ansible after each VMs is built\n  provision_individual: yes\n  # Customize the Ansible provisioner\n  privisioning:\n    # All VMs will use test.yaml playbook\n    playbook: test.yaml\n    # Define some custom groups\n    groups: *default_groups\n      # Adding all hosts into the \"local\" group\n      local:\n        - test1\n        - test2\n      # Define default Python interpreter for all hosts\n      local:vars:\n        ansible_python_interpreter: /usr/bin/python2\n    # Define default extra variables\n    extra_vars:\n      cloud_provider: local\n      sudo_users__custom:\n        - ansible:\n            host: ALL\n            runas: ALL\n            tag: NOPASSWD\n            cmd: ALL\n    # Define some extra command line parameters for Ansible\n    raw_arguments:\n      - --diff\n      - --forks=10\n\nvms:\n  test1:\n    # This section can contain any option provided by the Ansible provisioner\n    provisioning:\n      # Put this host also into the \"test\" group\n      groups:\n        # First add the default groups defined above\n        \u003c\u003c: *default_groups\n        # Then add the \"test\" group and define the host list for it\n        test:\n          - test1\n  test2:\n```\n\n\nLicense\n-------\n\nMIT\n\n\nAuthor\n------\n\nJiri Tyr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtyr%2Fvagrantfile_config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtyr%2Fvagrantfile_config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtyr%2Fvagrantfile_config/lists"}