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

Droplet project_name not working #255

Closed
mamercad opened this issue May 11, 2022 · 2 comments · Fixed by #332
Closed

Droplet project_name not working #255

mamercad opened this issue May 11, 2022 · 2 comments · Fixed by #332
Assignees
Labels
bug Something isn't working

Comments

@mamercad
Copy link
Collaborator

@mamercad Thank you for your quick response! When using project_name as documented in https://docs.ansible.com/ansible/latest/collections/community/digitalocean/digital_ocean_droplet_module.html#parameter-project_name - my droplets wind up in my default project, not the specified project. But if I use the project alias like in your example, then it works! The droplets wind up in the specified project.

(sorry for deleting and reposting this comment - I thought I had gotten things mixed up, misinterpreting the results. But looks like it really is working)

@dschilling No problem; though, I'm perplexed on why this doesn't work. I'll have to dig into that a bit at some point.

Originally posted by @mamercad in #201 (comment)

@mamercad
Copy link
Collaborator Author

I've reproduced this; using project works, using project_name does not (Droplet ended up in the default project).

@mamercad mamercad added the bug Something isn't working label May 11, 2022
@mamercad mamercad self-assigned this May 12, 2022
@bebosudo
Copy link

I bumped into this issue, but I noticed that the problem for me was with project names containing underscores: in that case the droplet would be created in the default project.

Here's a small reproducible code, that also creates the project defined in the variable.

---
- hosts: localhost
  connection: local
  gather_facts: false

  vars:
#    project_name: test-project
    project_name: test_project

  tasks:
    - name: Create a new separate project from the default
      community.digitalocean.digital_ocean_project:
        name: "{{ project_name }}"
        state: present
        oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
        description: "This project is a test"
        purpose: "Operational/Developer tooling"
        environment: "Production"

    - name: 'Create a DigitalOcean Droplet'
      community.digitalocean.digital_ocean_droplet:
        oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
        name: nodename
        project_name: "{{ project_name }}"
        state: present
        size: s-1vcpu-1gb
        image: ubuntu-22-04-x64
        region: sfo3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants