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

EC2 driver volumes parameter does not validate against Molecule schema. #140

Open
isuftin opened this issue Apr 26, 2023 · 2 comments
Open
Labels
ec2 Amazon EC2

Comments

@isuftin
Copy link
Contributor

isuftin commented Apr 26, 2023

In the platform definition of the EC2 driver, the expected type for the volumes parameter is a list of dict - https://github.com/ansible/ansible-lint/blob/main/src/ansiblelint/schemas/molecule.json

The Molecule schema definition for volumes expects a list of string - https://github.com/ansible-community/molecule/blob/main/src/molecule/data/molecule.json#L263-L268

As such, molecule errors out when attempting to create instances when volumes is defined in the platform param

An example of what a config for this might look like:

volumes:
      - device_name: /dev/sda1
        ebs:
          volume_size: 16
          delete_on_termination: true
@isuftin
Copy link
Contributor Author

isuftin commented Apr 26, 2023

Ref - #167

@apatard
Copy link
Member

apatard commented Apr 28, 2023

With recent PR merged in molecule (ansible/molecule#3765 and ansible/molecule#3898), now we can provide a schema for docker, podman, ec2 and I hope this will solve the issue (there may still be bugs or missing support).

For the record:

  • docker, podman plugins are expecting volumes to be a list of string
  • ec2 plugin is expecting volumes to be a list of dict.

That's why having a common schema is problematic.

Adding a schema is a matter of:

(... and I won't have time to do it next week.)

@apatard apatard added the ec2 Amazon EC2 label Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ec2 Amazon EC2
Projects
None yet
Development

No branches or pull requests

2 participants