If the vagrant-triggers plugin is installed, we can run the command on Vagrant state changes like vagrant provision. Add these lines into Trellis’ Vagrantfile:
# Vagrantfile
# Some lines of code...
Vagrant.configure('2') do |config|
# Some more lines of code later...
config.trigger.after :provision, :stdout => true do
run "vagrant trellis-cert trust"
end
end
Help Wanted!
So far, this plugin only works on macOS. Pull requests are welcome.
FYI vagrant-triggers is incompatible with Vagrant as of version 1.9.6 or 1.9.7. Appears to be abandoned, too, so I wouldn’t count on it getting updated anytime soon
Running into an issue with a similar mentality, but can you please confirm that you don’t install this into the trellis directory of your project folder? I get the success message within the trellis folder that the site was added, but chrome still shows “Not Secure” in the address bar.
I installed in ~/, and tried vagrant trellis-cert trust and it mentioned “failed at an early stage”.
To clarify, install and use it like so (note the $ cd xxx):
$ cd ~
$ vagrant plugin install vagrant-trellis-cert
$ cd /path/to/my/trellis
$ vagrant trellis-cert trust
Open an issue if chrome still shows “Not Secure”.
Note: It is known that this plugin won’t work on FireFox because FireFox has its own “trust system” instead of using macOS keychain.
To be honest, I don’t use vagrant for new projects anymore because vagrant gives me more trouble than benefits.
Try: