By skierat
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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.