I don’t have a windows setup to test on, but here are some thoughts.
User: vagrant
vs root
The composer install is running as root
even though you see SSH username: vagrant
during boot because the dev.yml
playbook invokes sudo to perform its tasks and "the default value of become_user
is root
".
I haven’t tested or thought through all the implications, but you could try editing the composer install task to not run as the become_user
by adding become: false
to the task, e.g., above this line, like this:
- name: Install Dependencies with Composer
command: composer install
args:
chdir: "{{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }}/"
+ become: false
register: composer_results
with_dict: "{{ wordpress_sites }}"
changed_when: "'Nothing to install or update' not in composer_results.stderr"
Edit: Now I’ve tested become: false
. I’m running OS X as the host machine. With a private repo in my composer.json
, the composer install task hangs, not printing this message:
The authenticity of host 'bitbucket.org (104.192.143.2)' can't be established.
RSA key fingerprint is SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A.
Are you sure you want to continue connecting (yes/no)?
If I vagrant ssh
and add bitbucket.org to my known_hosts, the composer install works on the next vagrant provision
and the plugins appear to work. So, this approach of updating the known_hosts
on the vm and adding become: false
shows some promise. I’d love to hear if it works for you. (/edit)
Private repo
Your machine has one Trellis project that works and one that fails. The failing project’s composer attempts cloning a private repo. Does the successful project have to clone a private repo too and succeeds? Or perhaps the presence/absence of a private repo in the composer.json
is a relevant difference between the projects?
SSH forwarding
The following two ideas are probably not relevant if in fact your successful project does clone a private repo:
- Things work when you
vagrant ssh
and clone the repo, but not when you vagrant provision
. That made me wonder if this was relevant: "vagrant ssh
execs out to the actual OpenSSH ssh
client. vagrant provision
uses net-ssh".
- The thread linked in the bullet above mentions some issues Windows users probably need to be aware of with
ssh-pageant
, perhaps already dealt with in the Trellis Windows docs re: SSH Forwarding.
I suppose if it comes down to it, you could copy your private SSH key onto the VM. I get the sense that some Windows users may be doing that with their Trellis projects.
Vagrant version
I noticed you’re running Vagrant 1.8.1
whereas the current Trellis requirement is Vagrant 1.8.5. I realize you’re trying to keep the VM on Ubuntu 14.04 but you may end up having to backup the DB, update Vagrant, and destroy and rebuild the VM. I understand you may adjust the Vagrantfile to keep the VM on 14.04 to match your production server, but it may complicate the community’s ability to help debug (a forked version of) the project.