Molecule: OSError: [Errno 21] Is a directory: '.molecule/group_vars' when setting group_vars in molecule.yml

Created on 17 Jul 2016  路  6Comments  路  Source: ansible-community/molecule

Hi,

I'm using Molecule (1.7.0) with a Docker backend
I've set the following in my molecule.yml file:

ansible:
  playbook: playbook.yml
  group_vars:
    mysql:
      - database_type: mysql
        database_type_long: mysql
    postgresql:
      - database_type: pgsql
        database_type_long: postgresql

docker:
  containers:
  - name: zabbix-server-centos-mysql
    ansible_groups:
      - mysql
    image: milcom/centos7-systemd
    image_version: latest
    privileged: True

When I execute a molecule command, I get the following error message:

[vagrant@localhost ansible-zabbix-server]$ molecule create
No handlers could be found for logger "vagrant"
Traceback (most recent call last):
  File "/usr/bin/molecule", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/site-packages/molecule/cli.py", line 69, in main
    CLI().main()
  File "/usr/lib/python2.7/site-packages/molecule/cli.py", line 64, in main
    c = command_class(command_args, args)
  File "/usr/lib/python2.7/site-packages/molecule/commands.py", line 89, in __init__
    self.molecule._symlink_vars()
  File "/usr/lib/python2.7/site-packages/molecule/core.py", line 303, in _symlink_vars
    os.unlink(group_vars_link_path)
OSError: [Errno 21] Is a directory: '.molecule/group_vars'
[vagrant@localhost ansible-zabbix-server]$

It has created the group_vars directory and the files in it.
I don't understand why it is complaining? Any ideas?

Thanks in advance

Most helpful comment

I have encountered this before - currently working on a patch to fix it. Molecule updates group_vars and checks for a symlink, but it proves to be problematic at times for doing both.

All 6 comments

I have encountered this before - currently working on a patch to fix it. Molecule updates group_vars and checks for a symlink, but it proves to be problematic at times for doing both.

Actually - looks like my patch was merged in with #226 . I just tested your yaml and got no errors.

Will close once we cut a 1.8.0 to pypi.

I try to test this tonight. Thanks!

Its working with the 1.7.1.dev21. Thanks!

Closing o/

Was this page helpful?
0 / 5 - 0 ratings