GetValkyrie / valkyrie

Valkyrie is an opinionated local dev stack that makes features/git based Drupal development easy.
http://www.getvalkyrie.com
GNU General Public License v3.0
45 stars 11 forks source link

Missing ansible roles in VM after vnew #67

Closed ghost closed 9 years ago

ghost commented 9 years ago

I'm currently facing a 100% reproducible problem during the drush vnew process:

[peuc@sz6 vm]$ drush vnew vm10
Valkyrie project initialized at: vm10                                                                                 [ok]
Bringing machine 'valkyrie' up with 'virtualbox' provider...
==> valkyrie: Importing base box 'ubuntu/trusty64'...
==> valkyrie: Matching MAC address for NAT networking...
==> valkyrie: Checking if box 'ubuntu/trusty64' is up to date...
==> valkyrie: Setting the name of the VM: vm10_valkyrie_1435611468491_737
==> valkyrie: Clearing any previously set forwarded ports...
==> valkyrie: Clearing any previously set network interfaces...
==> valkyrie: Preparing network interfaces based on configuration...
        valkyrie: Adapter 1: nat
        valkyrie: Adapter 2: hostonly
        valkyrie: Adapter 3: bridged
==> valkyrie: Forwarding ports...
        valkyrie: 22 => 2222 (adapter 1)
==> valkyrie: Running 'pre-boot' VM customizations...
==> valkyrie: Booting VM...
==> valkyrie: Waiting for machine to boot. This may take a few minutes...
        valkyrie: SSH address: 127.0.0.1:2222
        valkyrie: SSH username: vagrant
        valkyrie: SSH auth method: private key
        valkyrie: Warning: Connection timeout. Retrying...
        valkyrie: Warning: Connection timeout. Retrying...
        valkyrie: Warning: Remote connection disconnect. Retrying...
        valkyrie: Warning: Remote connection disconnect. Retrying...
        valkyrie: 
        valkyrie: Vagrant insecure key detected. Vagrant will automatically replace
        valkyrie: this with a newly generated keypair for better security.
        valkyrie: 
        valkyrie: Inserting generated public key within guest...
        valkyrie: Removing insecure key from the guest if its present...
        valkyrie: Key inserted! Disconnecting and reconnecting using new SSH key...
==> valkyrie: Machine booted and ready!
==> valkyrie: Checking for guest additions in VM...
==> valkyrie: Checking NFS user/group mapping.
==> valkyrie: Fixing NFS user/group mapping.
        valkyrie: Setting up SSH access for the 'ubuntu' user.
        valkyrie: Refreshing SSH connection, to login as 'ubuntu'.
        valkyrie: Installing Ansible from sources.
==> valkyrie: Installing Ansible build dependencies.
==> valkyrie: Using default stable branch: stable-1.9.
==> valkyrie: Cloning Ansible.
==> valkyrie: Running setups tasks for Ansible.
        valkyrie: Running Ansible playbook to re-map users and groups.
==> valkyrie: 
==> valkyrie: PLAY [localhost] ************************************************************** 
==> valkyrie: 
==> valkyrie: GATHERING FACTS *************************************************************** 
==> valkyrie: ok: [localhost]
==> valkyrie: 
==> valkyrie: TASK: [Find user matching host UID] ******************************************* 
==> valkyrie: changed: [localhost]
==> valkyrie: 
==> valkyrie: TASK: [Move matching user out of the way] ************************************* 
==> valkyrie: changed: [localhost]
==> valkyrie: 
==> valkyrie: TASK: [Find group matching host GID] ****************************************** 
==> valkyrie: changed: [localhost]
==> valkyrie: 
==> valkyrie: TASK: [Move the matching group out of the way] ******************************** 
==> valkyrie: changed: [localhost]
==> valkyrie: 
==> valkyrie: TASK: [Re-map group ownership of any files owned by matching group] *********** 
==> valkyrie: changed: [localhost]
==> valkyrie: 
==> valkyrie: TASK: [Find web-group GID] **************************************************** 
==> valkyrie: changed: [localhost]
==> valkyrie: 
==> valkyrie: TASK: [Map web group to host GID] ********************************************* 
==> valkyrie: changed: [localhost]
==> valkyrie: 
==> valkyrie: TASK: [Re-map group ownership of any files owned by web group] **************** 
==> valkyrie: changed: [localhost]
==> valkyrie: 
==> valkyrie: PLAY RECAP ******************************************************************** 
==> valkyrie: localhost                  : ok=9    changed=8    unreachable=0    failed=0   
        valkyrie: Refreshing SSH connection, to login normally.
        valkyrie: Writing semaphore file.
==> valkyrie: Checking Drush alias integration.
        valkyrie: Found drushrc file (/home/peuc/.drushrc.php).
        valkyrie: Found Valkyrie drushrc include file (/home/peuc/.valkyrie.drushrc.php).
        valkyrie: Found Valkyrie drushrc include statement in drushrc file (/home/peuc/.drushrc.php).
        valkyrie: Adding project alias path to Valkyrie drushrc include file (/home/peuc/.drushrc.php).
==> valkyrie: Setting hostname...
==> valkyrie: Configuring and enabling network interfaces...
==> valkyrie: Exporting NFS shared folders...
==> valkyrie: Preparing to edit /etc/exports. Administrator privileges will be required...
[sudo] password for peuc: 
● nfs-server.service - NFS server and services
    Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
    Active: active (exited) since lun. 2015-06-29 16:37:25 EDT; 29min ago
    Process: 977 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
    Process: 974 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
Main PID: 977 (code=exited, status=0/SUCCESS)
    CGroup: /system.slice/nfs-server.service
==> valkyrie: Mounting NFS shared folders...
==> valkyrie: Mounting shared folders...
        valkyrie: /vagrant => /home/peuc/Praxis/vm/vm10
==> valkyrie: Running provisioner: file...
==> valkyrie: Running provisioner: shell...
        valkyrie: Running: inline script
==> valkyrie: ERROR: found role at /vagrant/.valkyrie/valkyrie/vagrant/ansible/roles/getvalkyrie.mysql, but cannot find /vagrant/.valkyrie/valkyrie/vagrant/ansible/roles/getvalkyrie.mysql/tasks/main or /vagrant/.valkyrie/valkyrie/vagrant/ansible/roles/getvalkyrie.mysql/handlers/main or /vagrant/.valkyrie/valkyrie/vagrant/ansible/roles/getvalkyrie.mysql/vars/main or /vagrant/.valkyrie/valkyrie/vagrant/ansible/roles/getvalkyrie.mysql/defaults/main or /vagrant/.valkyrie/valkyrie/vagrant/ansible/roles/getvalkyrie.mysql/meta/main or /vagrant/.valkyrie/valkyrie/vagrant/ansible/roles/getvalkyrie.mysql/library
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
aegir@valkyrie.local's password: 
[peuc@sz6 vm]$ 

In the VM, the /vagrant/.valkyrie/valkyrie/vagrant/ansible/roles/getvalkyrie.mysql/ directory is empty (as is getvalkyrie.drush/):

root@valkyrie:/vagrant/.valkyrie/valkyrie/vagrant/ansible/roles# tree
.
├── geerlingguy.composer
│   ├── defaults
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── README.md
│   ├── tasks
│   │   └── main.yml
│   └── tests
│       ├── inventory
│       └── test.yml
├── geerlingguy.drush
│   ├── defaults
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── README.md
│   ├── tasks
│   │   └── main.yml
│   └── tests
│       ├── inventory
│       └── test.yml
├── geerlingguy.git
│   ├── defaults
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── README.md
│   ├── tasks
│   │   ├── install-from-source.yml
│   │   └── main.yml
│   ├── tests
│   │   ├── inventory
│   │   ├── test-install-from-source.yml
│   │   └── test-install-package.yml
│   └── vars
│       └── main.yml
├── geerlingguy.mysql
│   ├── defaults
│   │   └── main.yml
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── README.md
│   ├── tasks
│   │   ├── configure.yml
│   │   ├── databases.yml
│   │   ├── main.yml
│   │   ├── replication.yml
│   │   ├── secure-installation.yml
│   │   ├── setup-Debian.yml
│   │   ├── setup-RedHat.yml
│   │   └── users.yml
│   ├── templates
│   │   ├── my.cnf.j2
│   │   └── user-my.cnf.j2
│   ├── tests
│   │   ├── inventory
│   │   └── test.yml
│   └── vars
│       ├── Debian.yml
│       └── RedHat.yml
├── geerlingguy.php
│   ├── defaults
│   │   └── main.yml
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── README.md
│   ├── tasks
│   │   ├── configure.yml
│   │   ├── main.yml
│   │   ├── setup-Debian.yml
│   │   └── setup-RedHat.yml
│   ├── templates
│   │   ├── apc.ini.j2
│   │   └── php.ini.j2
│   ├── tests
│   │   ├── inventory
│   │   └── test.yml
│   └── vars
│       ├── Debian.yml
│       └── RedHat.yml
├── getvalkyrie.aegir
│   ├── defaults
│   │   └── main.yml
│   ├── files
│   │   └── aegir.make
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── README.md
│   ├── tasks
│   │   ├── main.yml
│   │   └── setup-apache.yml
│   ├── tests
│   │   ├── inventory
│   │   ├── setup.sh
│   │   └── test.yml
│   └── Vagrantfile
├── getvalkyrie.drush
├── getvalkyrie.mysql
├── getvalkyrie.skynet
│   ├── defaults
│   │   └── main.yml
│   ├── handlers
│   │   └── main.yml
│   ├── meta
│   │   └── main.yml
│   ├── README.md
│   ├── tasks
│   │   ├── main.yml
│   │   └── skynet.yml
│   ├── templates
│   │   └── skynet-queue.conf.j2
│   ├── tests
│   │   ├── inventory
│   │   ├── setup.sh
│   │   └── test.yml
│   └── Vagrantfile
└── getvalkyrie.valkyrie
        ├── defaults
        │   └── main.yml
        ├── files
        │   └── valkyrie.make
        ├── handlers
        │   └── main.yml
        ├── meta
        │   └── main.yml
        ├── README.md
        ├── tasks
        │   ├── avahi.yml
        │   ├── deploy_keys.yml
        │   ├── main.yml
        │   └── notifications.yml
        ├── templates
        │   ├── avahi-aliases.conf.j2
        │   └── ssh-config.j2
        ├── tests
        │   ├── inventory
        │   ├── setup.sh
        │   └── test.yml
        └── Vagrantfile

On the host however, the corresponding directory has expected content:

[peuc@sz6 getvalkyrie.mysql]$ pwd
/home/peuc/.drush/valkyrie/vagrant/ansible/roles/getvalkyrie.mysql
[peuc@sz6 getvalkyrie.mysql]$ ls
README.md  Vagrantfile  defaults  handlers  meta  tasks  templates  tests  vars
[peuc@sz6 getvalkyrie.mysql]$ 

User/group is good, so accessing these files should not be a problem.

Any clue how to debug this, since logs seems to be not very helpful?

RealLukeMartin commented 9 years ago

I had a similar issue with the mysql role, but it got a little further for me before it failed. I have my output in this issue https://github.com/GetValkyrie/valkyrie/issues/65

I don't know the cause either, but attempting to treat the symptoms, I switched the getvalkyrie.mysql role to geerlingguy.mysql role pinned to the 1.5.2 release and it ran successfully.

I have the fork here if you want to try it out https://github.com/RealLukeMartin/valkyrie

ghost commented 9 years ago

I finally fixed this one.

Long story short, the problem wasn't in Valkyrie source. For the record, if you encounter this error, just run a $ vagrant plugin update vagrant-triggers.

Closing.

niccolox commented 9 years ago

I am getting this now, after the PR is applied, and my tree looks the same...

goddamn Vagrant

RealLukeMartin commented 9 years ago

Yea I feel like somethings are getting cached strangely sometimes. You might have already tried this, but if not: Try removing ~/.drush/valkyrie and ~/.drush/cache/valkyrie Then run git clone https://github.com/GetValkyrie/valkyrie.git ~/.drush/valkyrie --recursive and drush cc drush

Then drush vnew after that and I believe it will work, let me know if this still doesn't work though.

niccolox commented 9 years ago

thanks for the support, that fixed it !