ansible-collection-interweb-ao/examples/domain.yml
2026-11-28 15:28:00 +02:00

25 lines
839 B
YAML

---
# Register the domain if it is not in the account yet, then set lock, renewal and nameservers.
# Run first with --check: it shows whether the name is free and its price, without buying.
- name: Domain
hosts: localhost
gather_facts: false
vars:
domain: example.co.ao
tasks:
- name: Is it in the account, or free?
interweb_ao.cloud.domain_info:
domain: "{{ domain }}"
register: info
- name: Show the price
ansible.builtin.debug:
msg: "{{ domain }} free: {{ info.availability.available }}, {{ info.availability.one_year_price.register }} {{ info.availability.currency }} a year"
when: not info.in_account
- name: Register if needed and manage it
interweb_ao.cloud.domain:
domain: "{{ domain }}"
years: 1
locked: true
auto_renew: true