{"id":13753221,"url":"https://github.com/geerlingguy/JJG-Ansible-Windows","last_synced_at":"2025-05-09T20:35:07.178Z","repository":{"id":13207659,"uuid":"15891621","full_name":"geerlingguy/JJG-Ansible-Windows","owner":"geerlingguy","description":"[DEPRECATED] Windows shell provisioning script to bootstrap Ansible from within a Vagrant VM.","archived":true,"fork":false,"pushed_at":"2016-08-05T19:16:15.000Z","size":26,"stargazers_count":86,"open_issues_count":0,"forks_count":27,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-16T05:32:39.928Z","etag":null,"topics":["ansible","devops","provision","provisioner","ssh","vagrant","windows"],"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/geerlingguy.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":"2014-01-14T04:12:44.000Z","updated_at":"2024-11-09T08:29:57.000Z","dependencies_parsed_at":"2022-09-01T08:41:02.556Z","dependency_job_id":null,"html_url":"https://github.com/geerlingguy/JJG-Ansible-Windows","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2FJJG-Ansible-Windows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2FJJG-Ansible-Windows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2FJJG-Ansible-Windows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2FJJG-Ansible-Windows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geerlingguy","download_url":"https://codeload.github.com/geerlingguy/JJG-Ansible-Windows/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253321841,"owners_count":21890476,"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","devops","provision","provisioner","ssh","vagrant","windows"],"created_at":"2024-08-03T09:01:18.557Z","updated_at":"2025-05-09T20:35:02.156Z","avatar_url":"https://github.com/geerlingguy.png","language":"Shell","funding_links":[],"categories":["windows"],"sub_categories":[],"readme":"# JJG-Ansible-Windows\n\n\u003e **Important Note**: Vagrant now includes an [`ansible_local` provisioner](https://docs.vagrantup.com/v2/provisioning/ansible_local.html), which provides a much more reliable Ansible provisioning experience within a Vagrant VM. This project will no longer be updated for use beyond Vagrant 1.8.1.\n\nWindows shell provisioning script to bootstrap Ansible from within a Vagrant VM running on Windows.\n\nThis script is configured to use configure any Linux-based VM (Debian, Ubuntu, Fedora, RedHat, CentOS, etc.) so it can run Ansible playbooks from within the VM through Vagrant.\n\nRead more about this script, and other techniques for using Ansible within a Windows environment, on Server Check.in: [Running Ansible within Windows](https://servercheck.in/blog/running-ansible-within-windows).\n\n## Usage\n\nIn your Vagrantfile, use a conditional provisioning statement if you want to use this script (which runs Ansible from within the VM instead of on your host—this example assumes your playbook is inside within a 'provisioning' folder, and this script is within provisioning/JJG-Ansible-Windows):\n\n```ruby\n# Use rbconfig to determine if we're on a windows host or not.\nrequire 'rbconfig'\nis_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)\nif is_windows\n  # Provisioning configuration for shell script.\n  config.vm.provision \"shell\" do |sh|\n    sh.path = \"provisioning/JJG-Ansible-Windows/windows.sh\"\n    sh.args = \"/vagrant/provisioning/playbook.yml\"\n  end\nelse\n  # Provisioning configuration for Ansible (for macOS/Linux hosts).\n  config.vm.provision \"ansible\" do |ansible|\n    ansible.playbook = \"provisioning/playbook.yml\"\n    ansible.sudo = true\n  end\nend\n```\n\nNote that the `windows.sh` script will run within the VM and will run the given playbook against localhost with `--connection=local` inside the VM. You shouldn't/can't pass a custom inventory file to the script, as you can using Vagrant's Ansible provisioner.\n\n### Role Requirements File\n\nIf your playbook requires roles to be installed which are not present in a `roles` directory within the playbook's directory, then you should add the roles to a [role requirements](http://docs.ansible.com/galaxy.html#advanced-control-over-role-requirements-files) file. Place the resulting `requirements.txt` or `requirements.yml` file in the same directory as your playbook, and the roles will be installed automatically.\n\n## Licensing and More Info\n\nCreated by [Jeff Geerling](http://jeffgeerling.com/) in 2014. Licensed under the MIT license; see the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2FJJG-Ansible-Windows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeerlingguy%2FJJG-Ansible-Windows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2FJJG-Ansible-Windows/lists"}