|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- ---
- - hosts: localhost
- connection: local
- gather_facts: true
- vars:
- mpdf:
- - 'nyc3-mpdf'
- count: 2
- mpdb:
- - 'nyc3-mpdb'
- tasks:
- - name: create frontend droplets
- digital_ocean_droplet:
- unique_name: yes
- region: nyc3
- image: debian-11-x64
- wait_timeout: 100
- name: "mpdf{{ item }}"
- size_id: s-1vcpu-1gb
- state: present
- oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
- 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
- tags:
- - 'ansible'
- - 'mpdf'
- register: created_droplets_frontend
- loop: "{{ range(1,count| int + 1) }}"
-
- - name: create backend droplets
- digital_ocean_droplet:
- unique_name: yes
- region: nyc3
- image: debian-11-x64
- wait_timeout: 100
- name: "mpdb{{ item }}"
- size_id: s-1vcpu-1gb
- state: present
- oauth_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}"
- 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
- tags:
- - 'ansible'
- - 'mpdb'
- register: created_droplets_backend
- loop: "{{ range(1,count| int + 1) }}"
- #- name: mpdb
- # ansible.builtin.import_playbook: mpdb.yaml
- #- name: mpdf
- # ansible.builtin.import_playbook: mpdf.yaml
|