25 lines
839 B
YAML
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.mz
|
|
tasks:
|
|
- name: Is it in the account, or free?
|
|
interweb_mz.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_mz.cloud.domain:
|
|
domain: "{{ domain }}"
|
|
years: 1
|
|
locked: true
|
|
auto_renew: true
|