Ansible repo for digital ocean projects
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

create_droplet.yml 1.3 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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) }}"