Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move https://github.com/retr0h/cookiecutter-molecule #1747

Closed
gundalow opened this issue Feb 13, 2019 · 7 comments
Closed

Move https://github.com/retr0h/cookiecutter-molecule #1747

gundalow opened this issue Feb 13, 2019 · 7 comments
Labels

Comments

@gundalow
Copy link
Contributor

Issue Type

  • Bug report

Desired Behavior

https://github.com/retr0h/cookiecutter-molecule.git should be copied inside of github.com/ansible so that we don't depend on external resources

@gundalow gundalow added the bug label Feb 13, 2019
@gundalow gundalow added this to the v.2.21 milestone Feb 13, 2019
@themr0c
Copy link
Contributor

themr0c commented Feb 14, 2019

This cookiecutter template, as used by the tests, is the causing all current build fail, because ansible-lint 4.1.0 introduced new rules.

The failing tests are all using the cookiecutter template:

$ cookiecutter gh:retr0h/cookiecutter-molecule
role_name [role_name]: test-init
scenario_name [default]: 
author [your name]: 
description [your description]: 
company [your company (optional)]: 
Select license:
1 - BSD
2 - MIT
3 - GPLv2
4 - GPLv3
5 - Apache
6 - CC-BY
Choose from 1, 2, 3, 4, 5, 6 [1]: 
min_ansible_version [1.2]: 
cd test-init/
ansible-lint .
[701] Role info should contain platforms
/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml:2
{'meta/main.yml': {'galaxy_info': {'author': 'your name', 'description': 'your description', 'company': 'your company (optional)', 'license': 'BSD', 'min_ansible_version': 1.2, 'galaxy_tags': [], '__line__': 3, '__file__': '/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml'}, 'dependencies': [], '__line__': 2, '__file__': '/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml'}}

[703] Should change default metadata: author
/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml:2
{'meta/main.yml': {'galaxy_info': {'author': 'your name', 'description': 'your description', 'company': 'your company (optional)', 'license': 'BSD', 'min_ansible_version': 1.2, 'galaxy_tags': [], '__line__': 3, '__file__': '/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml'}, 'dependencies': [], '__line__': 2, '__file__': '/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml'}}

[703] Should change default metadata: description
/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml:2
{'meta/main.yml': {'galaxy_info': {'author': 'your name', 'description': 'your description', 'company': 'your company (optional)', 'license': 'BSD', 'min_ansible_version': 1.2, 'galaxy_tags': [], '__line__': 3, '__file__': '/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml'}, 'dependencies': [], '__line__': 2, '__file__': '/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml'}}

[703] Should change default metadata: company
/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml:2
{'meta/main.yml': {'galaxy_info': {'author': 'your name', 'description': 'your description', 'company': 'your company (optional)', 'license': 'BSD', 'min_ansible_version': 1.2, 'galaxy_tags': [], '__line__': 3, '__file__': '/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml'}, 'dependencies': [], '__line__': 2, '__file__': '/home/.ecryptfs/src/externals/themr0c/test-init/meta/main.yml'}}

=> same issue with ansible-lint 4.0.1 and 4.1.0
=> no issue with ansible-lint 3.5.1

As we want to move forward to ansible-lint 4.1.0, while moving the cookiecutter template, we should ensure that it is used in the tests with non-default values for author, description, company, and that the platforms are defined:

  • [701] Role info should contain platforms
  • [703] Should change default metadata: author
  • [703] Should change default metadata: description
  • [703] Should change default metadata: company

@gundalow gundalow changed the title Move https://github.com/retr0h/cookiecutter-molecule.git Move https://github.com/retr0h/cookiecutter-molecule Feb 14, 2019
@themr0c
Copy link
Contributor

themr0c commented Feb 14, 2019

[701] Role info should contain platforms => we need to work on that file which does not template platform: https://github.com/retr0h/cookiecutter-molecule/blob/master/%7B%7Bcookiecutter.role_name%7D%7D/meta/main.yml

So this ticket becomes a blocker for 2.20.

@gundalow can we have some gh/ansible/molecule-cookiecutter ?

@themr0c themr0c modified the milestones: v.2.21, v2.20 Feb 14, 2019
@gundalow
Copy link
Contributor Author

@ssbarnea
Copy link
Member

Why creating a new repository when we could host the cookiecutter inside molecule itself? This could save a serious amount of time especially as we test it durin build.

Why to risk someone pushing a change to cookiecutter project and break molecule when we can prevent it from start?

@themr0c
Copy link
Contributor

themr0c commented Feb 14, 2019

I don't know how the cookiecutter files would be distributed at regular install time of molecule. I guess the current state was adressing this issue: the same command cookiecutter gh:retr0h/cookiecutter-molecule is used in the documentation and in the tests? I am not religious about one or another solution.

@decentral1se
Copy link
Contributor

decentral1se commented Feb 15, 2019

Thanks for taking care of this!

Local template would be nice but it's a fairly big change (need to write MANIFEST.in, include the template sources and then implement some inspect logic to find them on the users system) and I am not sure we want to handle that logic at all in Molecule? Let's rely on the network for now? We certainly need to be careful about updating the template, good point!

@decentral1se
Copy link
Contributor

Handled in #1749!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants