Ansible repo for digital ocean projects
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

delete_droplet.yml 1.2 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ---
  2. - hosts: localhost
  3. connection: local
  4. gather_facts: false
  5. vars:
  6. mpdf:
  7. - 'nyc3-mpdf'
  8. number:
  9. - '1'
  10. - '2'
  11. mpdb:
  12. - 'nyc3-mpdb'
  13. tasks:
  14. - name: delete frontend droplets
  15. digital_ocean_droplet:
  16. unique_name: yes
  17. region: nyc3
  18. image: debian-11-x64
  19. wait_timeout: 100
  20. name: "{{ item.0 }}{{item.1 }}"
  21. size_id: s-1vcpu-1gb
  22. state: absent
  23. oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
  24. ssh_keys: [ '94:5e:bc:d4:fe:5a:b0:74:7f:06:fc:4e:3d:f7:3e:ea' ] # <---- put your numeric ssh key in here
  25. register: deleted_droplets
  26. loop: "{{ mpdf | product(number) }}"
  27. - name: delete backend droplets
  28. digital_ocean_droplet:
  29. unique_name: yes
  30. region: nyc3
  31. image: debian-11-x64
  32. wait_timeout: 100
  33. name: "{{ item.0 }}{{item.1 }}"
  34. size_id: s-1vcpu-1gb
  35. state: absent
  36. oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
  37. ssh_keys: [ '94:5e:bc:d4:fe:5a:b0:74:7f:06:fc:4e:3d:f7:3e:ea' ] # <---- put your numeric ssh key in here
  38. register: deleted_droplets
  39. loop: "{{ mpdb | product(number) }}"