@@ -102,6 +102,8 @@ | |||||
destinations: | destinations: | ||||
addresses: ["0.0.0.0/0", "::/0"] | addresses: ["0.0.0.0/0", "::/0"] | ||||
tags: ["mpdb"] | tags: ["mpdb"] | ||||
- name: update inventory | |||||
ansible.builtin.command: "do-ansible-inventory --access-token {{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }} > /etc/ansible/hosts" | |||||
- name: mpdb | - name: mpdb | ||||
ansible.builtin.import_playbook: mpdb.yaml | ansible.builtin.import_playbook: mpdb.yaml | ||||
- name: mpdf | - name: mpdf | ||||
@@ -42,4 +42,6 @@ | |||||
- 'mpdb' | - 'mpdb' | ||||
register: deleted_droplets | register: deleted_droplets | ||||
loop: "{{ range(1,count|int + 1) }}" | loop: "{{ range(1,count|int + 1) }}" | ||||
- name: update inventory | |||||
ansible.builtin.command: "do-ansible-inventory --access-token {{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }} > /etc/ansible/hosts" | |||||
@@ -1,26 +0,0 @@ | |||||
# Using keyed groups and compose for hostvars | |||||
plugin: community.digitalocean.digitalocean | |||||
api_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}" | |||||
attributes: | |||||
- id | |||||
- name | |||||
- memory | |||||
- vcpus | |||||
- disk | |||||
- size | |||||
- image | |||||
- networks | |||||
- volume_ids | |||||
- tags | |||||
- region | |||||
keyed_groups: | |||||
- key: do_tags | lower | |||||
prefix: '' | |||||
separator: '' | |||||
compose: | |||||
ansible_host: do_networks.v4 | selectattr('type','eq','public') | |||||
| map(attribute='ip_address') | first | |||||
class: do_size.description | lower | |||||
distro: do_image.distribution | lower | |||||
filters: | |||||
- '"ansible" in do_tags' |
@@ -1,26 +0,0 @@ | |||||
# Using keyed groups and compose for hostvars | |||||
plugin: community.digitalocean.digitalocean | |||||
api_token: "{{ lookup('ansible.builtin.env', 'DO_API_TOKEN') }}" | |||||
attributes: | |||||
- id | |||||
- name | |||||
- memory | |||||
- vcpus | |||||
- disk | |||||
- size | |||||
- image | |||||
- networks | |||||
- volume_ids | |||||
- tags | |||||
- region | |||||
keyed_groups: | |||||
- key: do_tags | lower | |||||
prefix: '' | |||||
separator: '' | |||||
compose: | |||||
ansible_host: do_networks.v4 | selectattr('type','eq','public') | |||||
| map(attribute='ip_address') | first | |||||
class: do_size.description | lower | |||||
distro: do_image.distribution | lower | |||||
filters: | |||||
- '"ansible" in do_tags' |