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.

46 lignes
1.3 KiB

  1. ---
  2. - hosts: all
  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. register: created_droplets
  26. loop: "{{ mpdf | product(number) }}"
  27. - name: create 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: present
  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: created_droplets
  39. loop: "{{ mpdb | product(number) }}"
  40. - name: Install mpd on hosts
  41. apt:
  42. name: mpd
  43. state: present