Ansible repo for digital ocean projects
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

49 satır
1.4 KiB

  1. ---
  2. - hosts: localhost
  3. connection: local
  4. gather_facts: true
  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_frontend
  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_backend
  43. loop: "{{ range(1,count| int + 1) }}"
  44. #- name: mpdb
  45. # ansible.builtin.import_playbook: mpdb.yaml
  46. #- name: mpdf
  47. # ansible.builtin.import_playbook: mpdf.yaml