Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes: digital ocean provisioning #10

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions tasks/do-zone.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
---
- name: DO | Set defaults
ansible.builtin.set_fact:
zone_spec: "{{ zone.spec | d({}) }}"

- name: DO | Create zone
community.digitalocean.digital_ocean_domain:
state: present
name: "{{ zone.zone }}"
args: "{{ zone_spec }}"
register: z_out

- name: DO | Update Cluster State
- debug: var=z_out

# Domain API is not consistent when creating and
# already exists.
- name: DO | Update Global states
ansible.builtin.set_fact:
cluster_state: "{% set x = cluster_state.zones.__setitem__(zone.openshift_type + '_id', z_out.domain.name) %}{{ cluster_state }}"
when: zone.openshift_type is defined
cloud_dns_state: "{{ cloud_dns_state | d({}) | combine({
zone_spec.name + '_id': z_out.domain.name | d(z_out.domain.domain.name)
}) }}"

- name: DO | Show Global states
ansible.builtin.debug:
var: cloud_dns_state
when: debug | d(false)