1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/library
Ralph Bean a9a2a96218 Add a new unique_name param to the digital_ocean module for idempotence.
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.
2013-09-18 16:07:22 -04:00
..
cloud Add a new unique_name param to the digital_ocean module for idempotence. 2013-09-18 16:07:22 -04:00
commands Allow for relative paths by using abspath 2013-08-20 22:48:42 -07:00
database Merge branch 'devel' of https://github.com/abompard/ansible into abompard-devel 2013-09-06 13:51:45 -05:00
files Updated version_added string for the new validate_md5 option 2013-09-16 05:42:13 -05:00
internal * Updated all ansible.cc references in the documentation to point 2013-06-19 19:34:02 -06:00
inventory Trim legacy variable usage. 2013-07-19 09:44:25 -04:00
messaging Add missing version_added description in docs. 2013-07-20 12:08:47 -04:00
monitoring Fixed monit restarted error. 2013-09-16 19:14:17 -04:00
net_infrastructure Merge branch 'devel' of https://github.com/mhite/ansible into mhite-devel 2013-09-03 15:05:13 -05:00
network Fix bug in uri where redirect check fails. 2013-08-29 15:58:01 +02:00
notification Set default XMPP message type to 'chat'. 2013-07-26 21:30:10 +01:00
packaging Merge branch 'fix/apt_repository_update_cache' of https://github.com/resmo/ansible into resmo-fix/apt_repository_update_cache 2013-09-18 12:40:39 -05:00
source_control Merge branch 'gitfix' of https://github.com/johanwiren/ansible into johanwiren-gitfix 2013-08-22 15:30:58 -05:00
system Merge branch 'issue_3417_systemd_stuff' into devel 2013-09-16 09:30:39 -05:00
utilities Check for an empty executable passed into the accelerate plugin 2013-09-05 15:11:26 -05:00
web_infrastructure use home path expansion for virtualenv param in django_manage module 2013-08-11 14:02:13 -07:00