mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
a9a2a96218
As it stands now, it is difficult to write idempotent tasks for digital ocean droplets. Digital ocean assigns new nodes a random id when they are provisioned and that id is the only key that can be used to identify it in subsequent runs of that play. The workflow previously involved manual intervention: - write a play defining a new node with no specified id - run it, collect the randomly assigned id by hand - modify the play to add the id by hand so future runs don't create duplicate nodes - perform future re-runs that check if the node exists (by its id) - if it does exist then do nothing. - if it does not exist, then create it and return a *new random id* - collect the new random id by hand, modify the playbook file, and start all over. Its a huge pain. The modifications in this commit allow you to use the 'hostname' as a primary key for idempotence with digital ocean. By default, digital ocean will let you create as many hosts with the same hostname as you like. Here, we provide an option to constrain the user to using only unique hostnames. The workflow will now look like: - write a play defining a new node with a specified hostname and "unique_name: true"" - run it, create the new node and move on. - re-run it, notice that a node with that hostname is already created and move on. |
||
---|---|---|
.. | ||
cloudformation | ||
digital_ocean | ||
ec2 | ||
ec2_ami | ||
ec2_elb | ||
ec2_facts | ||
ec2_group | ||
ec2_tag | ||
ec2_vol | ||
glance_image | ||
keystone_user | ||
linode | ||
nova_compute | ||
nova_keypair | ||
quantum_floating_ip | ||
quantum_floating_ip_associate | ||
quantum_network | ||
quantum_router | ||
quantum_router_gateway | ||
quantum_router_interface | ||
quantum_subnet | ||
rax | ||
rds | ||
route53 | ||
s3 | ||
virt |