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.

48 lignes
1.3 KiB

  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: create 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: present
  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. tags:
  26. - 'ansible'
  27. - 'mpdf'
  28. register: created_droplets
  29. loop: "{{ mpdf | product(number) }}"
  30. - name: create backend droplets
  31. digital_ocean_droplet:
  32. unique_name: yes
  33. region: nyc3
  34. image: debian-11-x64
  35. wait_timeout: 100
  36. name: "{{ item.0 }}{{item.1 }}"
  37. size_id: s-1vcpu-1gb
  38. state: present
  39. oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
  40. 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
  41. tags:
  42. - 'ansible'
  43. - 'mpdb'
  44. register: created_droplets
  45. loop: "{{ mpdb | product(number) }}"