Skip to content

vagrant driver writes vagrant-console-log to installation dir instead of $TMPDIR #1556

@pescobar

Description

@pescobar

Issue Type

  • Bug report

Molecule and Ansible details

ansible 2.7.1
molecule, version 2.19.0
python-vagrant==0.5.15

Molecule installation method (one of):

  • pip

Ansible installation method (one of):

  • pip

Desired Behavior

molecule should write all the logs to $TMPDIR. If molecule is installed in a folder where you don't have write permissons it crashes when booting a vagrant instance.

how to reproduce the problem

$> echo $TMPDIR
/tmp/escobar

$> molecule init role --driver-name vagrant --role-name testing-molecule-vagrant

$> rm  testing-molecule-vagrant/tasks/main.yml

$> cat <<EOF >> testing-molecule-vagrant/tasks/main.yml
---
# tasks file for testing-molecule-vagrant

- name: just a test
  command: uname -r
  changed_when: false
EOF

$> cd testing-molecule-vagrant

$> molecule --debug test

During TASK [Create molecule instance(s)] you get error: "msg": "ERROR: See log file '/tmp/escobar/molecule/testing-molecule-vagrant/default/vagrant-instance.err'"

and in the log file:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["startvm", "384da504-e582-41a5-8f4f-08f478b62768", "--type", "headless"]

Stderr: VBoxManage: error: RawFile#0 failed to create the raw output file /data/virtualenvs/ansible-2.7.1-molecule-2.19.0/lib/python2.7/site-packages/molecule/provisioner/ansible/playbooks/vagrant/ubuntu-xenial-16.04-cloudimg-console.log (VERR_ACCESS_DENIED)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
### 2018-11-05 22:06:45 ###

in this machine ansible and molecule are installed in a virtualenv located in /data/virtualenvs/ansible-2.7.1-molecule-2.19.0/ that is not owned by my user

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions