allow to use a pre-defined token

This commit is contained in:
Robert Kaussow 2020-06-23 21:53:05 +02:00
parent f34bbddf3f
commit af81eb4d20
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61

View File

@ -13,11 +13,12 @@
api_user: "{{ corenetworks_dns_api_user | default(omit) }}" api_user: "{{ corenetworks_dns_api_user | default(omit) }}"
api_password: "{{ corenetworks_dns_api_password | default(omit) }}" api_password: "{{ corenetworks_dns_api_password | default(omit) }}"
register: __corenetworks register: __corenetworks
when: corenetworks_dns_token is not defined
delegate_to: "{{ corenetworks_dns_delegate_to }}" delegate_to: "{{ corenetworks_dns_delegate_to }}"
- name: Create DNS records - name: Create DNS records
corenetworks_dns: corenetworks_dns:
api_token: "{{ __corenetworks.session.token }}" api_token: "{{ corenetworks_dns_token if corenetworks_dns_token is defined else __corenetworks.session.token }}"
zone: "{{ item.zone | default(corenetworks_dns_default_zone) }}" zone: "{{ item.zone | default(corenetworks_dns_default_zone) }}"
record: "{{ item.record | default(omit) }}" record: "{{ item.record | default(omit) }}"
type: "{{ item.type | default(omit) }}" type: "{{ item.type | default(omit) }}"