Report this

What is the reason for this report?

How do I create a smallest droplet which costs $5/mo through ansible?

Posted on April 29, 2020

I use digital ocean droplet module within my playbook

e.g.

- name: Create droplet
  digital_ocean_droplet:
    state: present
    name: "test-droplet"
    region: "fra1"
    size: "1gb"
#    disk: "25"
    image: "ubuntu-20-04-x64"
    unique_name: yes
    oauth_token: "{{ do_api_token }}"

After running it, I have got a droplet with 1 GB / 1 CPU and 30 GB SSD disk which costs $10/mo. Actually, I don’t see an option to specify disk size in https://developers.digitalocean.com/documentation/v2/#create-a-new-droplet

Is it possible to have the cheapest one created by ansible’s playbook?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
0

Accepted Answer

Hello, @skierat

Could you please try with using the following as size:

size: "s-1vcpu-1gb"

This should create the droplet with 1 CPU / 1 GB Memory / 25 GB Disk

If you’re using the API this will be the same as in the example listed in:

https://developers.digitalocean.com/documentation/v2/#create-a-new-droplet

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582" -d '{"name":"example.com","region":"nyc3","size":"s-1vcpu-1gb","image":"ubuntu-16-04-x64","ssh_keys":[107149],"backups":false,"ipv6":true,"user_data":null,"private_networking":null,"volumes": null,"tags":["web"]}' "https://api.digitalocean.com/v2/droplets"

If you’re using doctl :

doctl compute droplet create sammy-test --size s-1vcpu-1gb --image ubuntu-18-04-x64 --region fra1 --ssh-keys 11:11:11:11:1:1:11:11:11:11:11:11:11:11:11:1

Where you need to replace the the key with your actual key.

Hope this helps!

Let me know how it goes

Regards, Alex

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.