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

Missing dependencies for GCE driver #246

Open
loozhengyuan opened this issue Mar 9, 2024 · 1 comment · May be fixed by #247
Open

Missing dependencies for GCE driver #246

loozhengyuan opened this issue Mar 9, 2024 · 1 comment · May be fixed by #247

Comments

@loozhengyuan
Copy link

I tried to set up the gce driver in a new repo. After installing ansible, molecule, and molecule-plugins[gce], the molecule test command fails with the message Please install the requests library:

  TASK [Wait for instance(s) deletion to complete] *******************************
  failed: [localhost] (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': 'j236613821150.1769', 'results_file': '/home/runner/.ansible_async/j236613821150.1769', 'changed': True, 'item': {'image': 'projects/debian-cloud/global/images/family/debian-12', 'machine_type': 'e2-medium', 'name': 'molecule-debian-12-uisp', 'preemptible': True}, 'ansible_loop_var': 'item'}) => {"ansible_job_id": "j236613821150.1769", "ansible_loop_var": "item", "attempts": 1, "changed": false, "finished": 1, "item": {"ansible_job_id": "j236613821150.1769", "ansible_loop_var": "item", "changed": true, "failed": 0, "finished": 0, "item": {"image": "projects/debian-cloud/global/images/family/debian-12", "machine_type": "e2-medium", "name": "molecule-debian-12-uisp", "preemptible": true}, "results_file": "/home/runner/.ansible_async/j236613821150.1769", "started": 1}, "msg": "Please install the requests library", "results_file": "/home/runner/.ansible_async/j236613821150.1769", "started": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
  
  PLAY RECAP *********************************************************************
  localhost                  : ok=1    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

After installing the requests library, it fails with another message Please install the google-auth library:

  TASK [Wait for instance(s) deletion to complete] *******************************
  failed: [localhost] (item={'failed': 0, 'started': 1, 'finished': 0, 'ansible_job_id': 'j899723533337.1829', 'results_file': '/home/runner/.ansible_async/j899723533337.1829', 'changed': True, 'item': {'image': 'projects/debian-cloud/global/images/family/debian-11', 'machine_type': 'e2-medium', 'name': 'molecule-debian-11-unifi', 'preemptible': True}, 'ansible_loop_var': 'item'}) => {"ansible_job_id": "j899723533337.1829", "ansible_loop_var": "item", "attempts": 1, "changed": false, "finished": 1, "item": {"ansible_job_id": "j899723533337.1829", "ansible_loop_var": "item", "changed": true, "failed": 0, "finished": 0, "item": {"image": "projects/debian-cloud/global/images/family/debian-11", "machine_type": "e2-medium", "name": "molecule-debian-11-unifi", "preemptible": true}, "results_file": "/home/runner/.ansible_async/j899723533337.1829", "started": 1}, "msg": "Please install the google-auth library", "results_file": "/home/runner/.ansible_async/j899723533337.1829", "started": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
  
  PLAY RECAP *********************************************************************
  localhost                  : ok=1    changed=1    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

The issue is finally resolved when both requests and google-auth packages are installed. Looking at pyproject.toml file, it appears that no additional dependencies were declared for gce even though it was required.

@loozhengyuan
Copy link
Author

Just to add, these were the changes to my pyproject.toml in order to get molecule test to pass:

[tool.poetry.dependencies]
python = "^3.12.2"
ansible = "^9.2.0"
molecule = "^24.2.0"
molecule-plugins = { extras = ["gce"], version = "^23.5.3" }
+ requests = "^2.31.0"
+ google-auth = "^2.28.2"

I noted that molecule-gce that the dependencies required may be much lower but the latest versions are tested working for me.

@loozhengyuan loozhengyuan linked a pull request Mar 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant