Vagrant-trellis-cert doesn't play nice with Trellis CLI?

What version of ansible-base do you have when you install ansible 2.8.0?

My ansible is 2.8.0, but it installs ansible-base 2.10.11 (there is not an ansible-base available prior to 2.10.0 when trying to install ansible-base separately.)

I installed trellis with git command (not trellis cli) and downgrade ansible from 2.11.2, after this output message:

[WARNING]: Your Ansible version is 2.11.2 but this version of Trellis has only
been tested for compatability with Ansible 2.8.0 -> 2.9.10. It is advisable to
check for Trellis updates or downgrade your Ansible version.

The main step for me was to get a fresh Trellis copy from repo. I really don’t know what exactly was wrong. In these cases I install a new empty project and see if it works. I’ve spent all morning fiddling with versions of ansible, python, and trellis. Finally, a new version of trellis worked, moving the old configuration (group_vars, etc) to the new trellis.

Hm, some further debugging questions:

  1. When you use upped a vagrant box without involvement of the vagrant-trellis-cert tool,
    does it work then (you wrote it does, but are you sure?)
  2. When down and then up the vagrant box, does it still work?
  3. When you use vagrant-trellis-cert on a vagrant box that is already upped successfully, does it break it? Does it break ti when you down the box and then up again (on box spin up)?

Now it seems to work fine:

% vagrant trellis-cert trust
Importing certificates...
SUCCESS:    arte-conocimiento.test

Also, I can open the local projects with https with no problems.
Vagrant halt and up also work.

I gave up trying to get it to work for now bc of lack of time, and just disabled using certs altogether for local dev. I tried various versions of ansible and trellis to no avail.

vagrant-trellis-cert’s author here.

If @aitor or anyone finds our what’s happening, send a PR or create an issue on GitHub - TypistTech/vagrant-trellis-cert: Trust all Trellis self-signed certificates with a single command Thanks in advance.

Even better if you can port the functionality to trellis-cli. Vagrant’s plugin system is changing. When it comes, vagrant-trellis-cert would be rendered useless.

3 Likes

I had another go using a new trellis install with a fresh trellis with hand migrated configs, and various ansible versions to no avail.

❯ vagrant --version
Vagrant 2.2.16

❯trellis new --trellis-version dev

Vagrant wouldn’t up with ansible 2.8 (I tried 2.8.0 and 2.8.20.)
I got the vagrant trellis-cert trust error about the Vagrant managed machine not being ready for ssh with ansible 2.9.3

Some thoughts that crossed my mind:
-I wonder if it has something to do with the ssh format automatic upgrade
-I wonder if it has something to do with the use of sshd_permit_root_login: false

Still getting the ssh auth errors on vagrant reload as well:

❯ vagrant reload
==> default: Attempting graceful shutdown of VM…
default: Guest communication could not be established! This is usually because
default: SSH is not running, the authentication information was changed,
default: or some other networking issue. Vagrant will force halt, if
default: capable.
==> default: Forcing shutdown of VM…
==> default: Checking if box ‘bento/ubuntu-20.04’ version ‘202105.25.0’ is up to date…
==> default: Clearing any previously set forwarded ports…
==> default: Clearing any previously set network interfaces…
==> default: Preparing network interfaces based on configuration…
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports…
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running ‘pre-boot’ VM customizations…
==> default: Booting VM…
==> default: Waiting for machine to boot. This may take a few minutes…
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Authentication failure. Retrying…
default: Warning: Authentication failure. Retrying…
default: Warning: Authentication failure. Retrying…
default: Warning: Authentication failure. Retrying…
default: Warning: Authentication failure. Retrying…

Having the same issues although I have been able to vagrant up with ansible 2.8

Edit: I installed a fresh copy of trellis from repo as @aitor recommends and I am able to remove the faulty cert I tried to add previously using vagrant trellis-cert distrust and running vagrant trellis-cert trust in the new repo successfully. While this does allow me to get the trellis cert working I am still getting ssh auth errors on vagrant reload.

2 Likes

Jack, That’s good to know. What version of ansible are you using?

I’m running in this issue again. No cert trust and no SSH auth. What a nightmare…

1 Like

2.9.10, but I get the same problems as @aitor again

have everything working again able to up-down multiple times with trellis CLI and vagrant and trust certs by downgrading vagrant from the latest (2.2.16) to 2.2.10

2 Likes

Good work! thank you.

Uninstall Vagrant: https://www.vagrantup.com/docs/installation/uninstallation

2.2.10 installer:
https://releases.hashicorp.com/vagrant/2.2.10/

Github issue:

1 Like

Excellent, thank you

Posted some more info here: https://github.com/roots/trellis/issues/1303#issuecomment-876698425

1 Like

Hi there, I just bumped into this error with a fresh clone of trellis, but without using trellis new:

➜ trellis git:(dev) ✗ vagrant trellis-cert trust
Importing certificates...
The provider for this Vagrant-managed machine is reporting that it
is not yet ready for SSH. Depending on your provider this can carry
different meanings. Make sure your machine is created and running and
try again. Additionally, check the output of `vagrant status` to verify
that the machine is in the state that you expect. If you continue to
get this error message, please view the documentation for the provider
you're using.

It’s the first time using the new ‘bento/ubuntu-22.04’ box, could it be related somehow?
I’m on Vagrant 2.2.18

Thanks

That error message suggests a few things to try, have you done those? What were the results?

Additionally, does vagrant ssh work?

Yes I did, vagrant status results in:

Current machine states:

default                   running (parallels)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

And vagrant ssh is also working fine.
I tried destroying the VM and rebuilding it with the same result.

Since there’s been a lot of replies and issues about this, I’ll try and summarize things:

  1. this is almost certainly not related to Trellis or trellis-cli
  2. my assumption is it’s related to the Vagrant plugin (and/or in combination with Vagrant itself)
  3. @TangRufus is the author of that plugin and his reply still stands: Vagrant-trellis-cert doesn't play nice with Trellis CLI? - #16 by TangRufus

Yeah could be, but I thought it was strange since I enable SSL on all of my local projects and this is the first one that failed to import the certificates with the vagrant trellis-cert trust .
So I know the plugin normally works for me, also with trellis-cli.