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

Posted April 29, 2020 1.5k views

I use digital ocean droplet module within my playbook


- name: Create 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

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

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.

Submit an Answer
1 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:

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582" -d '{"name":"","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"]}' ""

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