Ansible repo for digital ocean projects
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

46 righe
1.3 KiB

  1. ---
  2. - hosts: localhost
  3. connection: local
  4. gather_facts: false
  5. vars:
  6. mpdf:
  7. - 'nyc3-mpdf'
  8. count: 2
  9. mpdb:
  10. - 'nyc3-mpdb'
  11. tasks:
  12. - name: create frontend droplets
  13. digital_ocean_droplet:
  14. unique_name: yes
  15. region: nyc3
  16. image: debian-11-x64
  17. wait_timeout: 100
  18. name: "mpdf{{ item }}"
  19. size_id: s-1vcpu-1gb
  20. state: present
  21. oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
  22. 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
  23. tags:
  24. - 'ansible'
  25. - 'mpdf'
  26. register: created_droplets
  27. loop: "{{ range(1,count| int + 1) }}"
  28. - name: create backend droplets
  29. digital_ocean_droplet:
  30. unique_name: yes
  31. region: nyc3
  32. image: debian-11-x64
  33. wait_timeout: 100
  34. name: "mpdb{{ item }}"
  35. size_id: s-1vcpu-1gb
  36. state: present
  37. oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
  38. 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
  39. tags:
  40. - 'ansible'
  41. - 'mpdb'
  42. register: created_droplets
  43. loop: "{{ range(1,count|int + 1) }}"