Skip to content

Commit

Permalink
Use trellis-cli for Vagrant galaxy install
Browse files Browse the repository at this point in the history
This replaces the default galaxy command (`ansible-galaxy install`) with
the much better `trellis galaxy install` if trellis-cli is available on
the host machine.

With trellis-cli's command, there should be no reason to use the
annoying `SKIP_GALAXY` env var which was added to prevent Vagrant from
always installing the roles each time. `trellis galaxy install` is
efficient and quickly skips already installed roles.
  • Loading branch information
swalkinshaw committed Jan 4, 2022
1 parent 8f1c460 commit f51ef37
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ Vagrant.configure('2') do |config|
ansible.galaxy_role_file = File.join(provisioning_path, 'galaxy.yml') unless vconfig.fetch('vagrant_skip_galaxy') || ENV['SKIP_GALAXY']
ansible.galaxy_roles_path = File.join(provisioning_path, 'vendor/roles')

if which('trellis')
ansible.galaxy_command = 'trellis galaxy install'
end

ansible.groups = {
'web' => ['default'],
'development' => ['default']
Expand Down

0 comments on commit f51ef37

Please sign in to comment.