I couldn't run the molecule test
command as it throws below error, while I can run individual commands without any errors ( Also provided --debug o/p below)
[701] Role info should contain platforms
/root/.config/pip/molecule-testing/meta/main.yml:1
{'meta/main.yml': {'__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'dependencies': [], u'galaxy_info': {u'description': u'your description', u'license': u'license (GPLv2, CC-BY, etc)', u'author': u'your name', u'company': u'your company (optional)', u'galaxy_tags': [], '__line__': 2, '__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'min_ansible_version': 1.2}, '__line__': 1}}
[703] Should change default metadata: author
/root/.config/pip/molecule-testing/meta/main.yml:1
{'meta/main.yml': {'__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'dependencies': [], u'galaxy_info': {u'description': u'your description', u'license': u'license (GPLv2, CC-BY, etc)', u'author': u'your name', u'company': u'your company (optional)', u'galaxy_tags': [], '__line__': 2, '__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'min_ansible_version': 1.2}, '__line__': 1}}
[703] Should change default metadata: description
/root/.config/pip/molecule-testing/meta/main.yml:1
{'meta/main.yml': {'__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'dependencies': [], u'galaxy_info': {u'description': u'your description', u'license': u'license (GPLv2, CC-BY, etc)', u'author': u'your name', u'company': u'your company (optional)', u'galaxy_tags': [], '__line__': 2, '__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'min_ansible_version': 1.2}, '__line__': 1}}
[703] Should change default metadata: company
/root/.config/pip/molecule-testing/meta/main.yml:1...
however if I run below commands it works perfectly. So, can anyone points out why whole test is failing, what should I do?
- molecule create
- molecule list
Validation completed successfully.
Instance Name Driver Name Provisioner Name Scenario Name Created Converged
--------------- ------------- ------------------ --------------- --------- -----------
instance docker ansible default true false
- molecule converge
Validation completed successfully.
--> Test matrix
└── default
├── dependency
├── create
├── prepare
└── converge
--> Scenario: 'default'
--> Action: 'dependency'
Skipping, missing the requirements file.
--> Scenario: 'default'
--> Action: 'create'
Skipping, instances already created.
--> Scenario: 'default'
--> Action: 'prepare'
Skipping, prepare playbook not configured.
--> Scenario: 'default'
--> Action: 'converge'
PLAY [Converge] ****************************************************************
TASK [Gathering Facts] *********************************************************
ok: [instance]
TASK [molecule-testing : Molecule Hello World!] ********************************
ok: [instance] => {
"msg": "Hello, World!"
}
PLAY RECAP *********************************************************************
instance : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
- molecule list
molecule list
--> Validating schema /root/.config/pip/molecule-testing/molecule/default/molecule.yml.
Validation completed successfully.
Instance Name Driver Name Provisioner Name Scenario Name Created Converged
--------------- ------------- ------------------ --------------- --------- -----------
instance docker ansible default true true
- molecule destroy
- molecule list
--> Validating schema /root/.config/pip/molecule-testing/molecule/default/molecule.yml.
Validation completed successfully.
Instance Name Driver Name Provisioner Name Scenario Name Created Converged
--------------- ------------- ------------------ --------------- --------- -----------
instance docker ansible default true false
folder structure looks like this
.
├── defaults
│ └── main.yml
├── handlers
│ └── main.yml
├── meta
│ └── main.yml
├── molecule
│ └── default
│ ├── Dockerfile.j2
│ ├── INSTALL.rst
│ ├── molecule.yml
│ ├── playbook.yml
│ └── tests
│ ├── test_default.py
│ └── test_default.pyc
├── README.md
├── tasks
│ └── main.yml
└── vars
└── main.yml
molecule.yml file is
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
platforms:
- name: instance
image: centos:7
privileged: true
command: /sbin/init
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
provisioner:
name: ansible
lint:
name: ansible-lint
scenario:
name: default
tasks\main.yml -->
---
# tasks file for molecule-testing
- name: Molecule Hello World!
debug:
msg: Hello, World!
version of molecule and ansible are as follow
molecule --version
molecule, version 2.22
ansible --version
ansible 2.8.4
config file = None
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /root/molecule_ansible2.7/lib/python2.7/site-packages/ansible
executable location = /root/molecule_ansible2.7/bin/ansible
python version = 2.7.5 (default, Jun 11 2019, 14:33:56) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
docker images
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/centos 7 67fa590cfc1c 4 weeks ago 202 MB
sample output of molecule --debug test
is
DEBUG: COMMAND
/root/molecule_ansible2.7/bin/ansible-lint -v --exclude=/root/.cache/molecule/molecule-testing/default /root/.config/pip/molecule-testing/molecule/default/playbook.yml
Examining /root/.config/pip/molecule-testing/molecule/default/playbook.yml of type playbook
Examining /root/.config/pip/molecule-testing/tasks/main.yml of type tasks
Examining /root/.config/pip/molecule-testing/handlers/main.yml of type handlers
Examining /root/.config/pip/molecule-testing/meta/main.yml of type meta
[701] Role info should contain platforms
/root/.config/pip/molecule-testing/meta/main.yml:1
{'meta/main.yml': {'__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'dependencies': [], u'galaxy_info': {u'description': u'your description', u'license': u'license (GPLv2, CC-BY, etc)', u'author': u'your name', u'company': u'your company (optional)', u'galaxy_tags': [], '__line__': 2, '__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'min_ansible_version': 1.2}, '__line__': 1}}
[703] Should change default metadata: author
/root/.config/pip/molecule-testing/meta/main.yml:1
{'meta/main.yml': {'__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'dependencies': [], u'galaxy_info': {u'description': u'your description', u'license': u'license (GPLv2, CC-BY, etc)', u'author': u'your name', u'company': u'your company (optional)', u'galaxy_tags': [], '__line__': 2, '__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'min_ansible_version': 1.2}, '__line__': 1}}
[703] Should change default metadata: description
/root/.config/pip/molecule-testing/meta/main.yml:1
{'meta/main.yml': {'__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'dependencies': [], u'galaxy_info': {u'description': u'your description', u'license': u'license (GPLv2, CC-BY, etc)', u'author': u'your name', u'company': u'your company (optional)', u'galaxy_tags': [], '__line__': 2, '__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'min_ansible_version': 1.2}, '__line__': 1}}
[703] Should change default metadata: company
/root/.config/pip/molecule-testing/meta/main.yml:1
{'meta/main.yml': {'__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'dependencies': [], u'galaxy_info': {u'description': u'your description', u'license': u'license (GPLv2, CC-BY, etc)', u'author': u'your name', u'company': u'your company (optional)', u'galaxy_tags': [], '__line__': 2, '__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'min_ansible_version': 1.2}, '__line__': 1}}
[703] Should change default metadata: license
/root/.config/pip/molecule-testing/meta/main.yml:1
{'meta/main.yml': {'__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'dependencies': [], u'galaxy_info': {u'description': u'your description', u'license': u'license (GPLv2, CC-BY, etc)', u'author': u'your name', u'company': u'your company (optional)', u'galaxy_tags': [], '__line__': 2, '__file__': u'/root/.config/pip/molecule-testing/meta/main.yml', u'min_ansible_version': 1.2}, '__line__': 1}}
An error occurred during the test sequence action: 'lint'. Cleaning up.