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

[IMPROVEMENT] Improve Asserts #87

Open
89luca89 opened this issue Jul 4, 2021 · 3 comments
Open

[IMPROVEMENT] Improve Asserts #87

89luca89 opened this issue Jul 4, 2021 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request experimental This issue needs a deep research and some improvement evaluation help wanted Extra attention is needed
Milestone

Comments

@89luca89
Copy link
Owner

89luca89 commented Jul 4, 2021

Some assertions should be improved, for example:

            host-vm-1:
              disk_source: "/mnt/iso/debian10-terraform.qcow2"
              os_family: Debian
              cpu: 1
              memory: 512
              hypervisor: hypervisor_1
              ansible_host: 192.168.122.9
              network_interfaces:
                iface_1:
                  name: default
                  type: nat
                  ip: 192.168.122.9
                  gw: 192.168.122.1
                  dns:
                    - 192.168.122.1
              default_route: True <<<--- note this is unindented

This snippets passes the assertions even if it's not valid
We should review and evaluate more corner cases to include in the assertions

Also we could think of an external tool/linter as @alegrey91 suggests to validate inventories

@89luca89 89luca89 added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed experimental This issue needs a deep research and some improvement evaluation labels Jul 4, 2021
@89luca89 89luca89 added this to the 1.3.0 milestone Jul 4, 2021
@89luca89 89luca89 self-assigned this Jul 4, 2021
@alegrey91
Copy link
Collaborator

Yes, the idea is to create a classic linter such as ansible-lint, yamlint and so on to facilitate the inventory implementation.
We actually cannot base our inventory validation on the ansible-lint because Terrible has actually a lot of built-in that cannot be recognized e/o understood by the linter.

@89luca89
Copy link
Owner Author

Current asserts works on ansible while using python3 version of it we should make it clearer

@89luca89
Copy link
Owner Author

Yes, the idea is to create a classic linter such as ansible-lint, yamlint and so on to facilitate the inventory implementation.
We actually cannot base our inventory validation on the ansible-lint because Terrible has actually a lot of built-in that cannot be recognized e/o understood by the linter.

This should be part of #94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request experimental This issue needs a deep research and some improvement evaluation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants