86 lines
3.4 KiB
Markdown
86 lines
3.4 KiB
Markdown
<p align="center"><img src="assets/logo.png" alt="Interweb" width="280"></p>
|
|
|
|
# Ansible Collection for Interweb Angola
|
|
|
|
<!-- badges:start -->
|
|
[](https://git.interweb.ao/interweb-ao/ansible-collection-interweb-ao/releases) [](LICENSE)
|
|
<!-- badges:end -->
|
|
|
|
Manage your Interweb Angola VPS servers, domains and DNS records with Ansible. The collection uses only the public Interweb Angola API (https://docs.interweb.ao) and the Python standard library: nothing else to install.
|
|
|
|
## Modules
|
|
|
|
| Module | What for |
|
|
|---|---|
|
|
| `interweb_ao.cloud.vps` | Buy a VPS with credit, or manage one you have: start, stop, restart, time zone, reverse DNS |
|
|
| `interweb_ao.cloud.vps_info` | List your servers or see one |
|
|
| `interweb_ao.cloud.domain` | Register a domain, or manage one you have: nameservers, transfer lock, renewal |
|
|
| `interweb_ao.cloud.domain_info` | List your domains, see one, or check if a name is free and its price |
|
|
| `interweb_ao.cloud.dns_record` | Add, change or remove a DNS record |
|
|
| `interweb_ao.cloud.dns_info` | Read the DNS zone of a domain |
|
|
| `interweb_ao.cloud.catalog_info` | Products for sale, the options of one product, domain extensions and prices |
|
|
|
|
Every module supports check mode (`--check`) and is idempotent: running a playbook again changes only what is different.
|
|
|
|
## Install
|
|
|
|
```shell
|
|
ansible-galaxy collection install interweb_ao.cloud
|
|
```
|
|
|
|
Or from this repository:
|
|
|
|
```shell
|
|
ansible-galaxy collection build
|
|
ansible-galaxy collection install interweb_ao-cloud-1.0.0.tar.gz
|
|
```
|
|
|
|
Needs ansible-core 2.14 or later and Python 3.6 or later.
|
|
|
|
## Quick start
|
|
|
|
```shell
|
|
export INTERWEB_API_KEY="sandbox_..." # create the key in Meu Interweb
|
|
```
|
|
|
|
```yaml
|
|
- hosts: localhost
|
|
gather_facts: false
|
|
tasks:
|
|
- name: Point www to the server
|
|
interweb_ao.cloud.dns_record:
|
|
domain: example.co.ao
|
|
name: www
|
|
type: A
|
|
value: 203.0.113.10
|
|
ttl: 3600
|
|
solo: true
|
|
```
|
|
|
|
Start with a `sandbox_` key: it reads your real data, but every write is simulated and nothing is charged (the result has `simulated: true`). More playbooks in [examples/](examples/).
|
|
|
|
To set the key once for every task, use the action group:
|
|
|
|
```yaml
|
|
module_defaults:
|
|
group/interweb_ao.cloud.all:
|
|
api_key: "{{ vault_api_key }}"
|
|
```
|
|
|
|
## Good to know
|
|
|
|
- Buying a VPS or registering a domain is paid with the account credit, within the spending limit of the key. A VPS purchase needs `idempotency_key`: the same task with the same key within 24 hours gets the same answer and is not charged again. Save the returned server id and use `server_id` from then on.
|
|
- `domain` registers only when the domain is not in the account yet. With `register: false` it never buys.
|
|
- The API cannot cancel services or delete domains. Cancel in Meu Interweb (https://www.meu.interweb.ao).
|
|
- The key needs these permissions: `catalog:read`; `vps:read` and `vps:write`; `domains:read` and `domains:write`; `dns:read` and `dns:write`; `billing:purchase` to buy.
|
|
- Errors show the API code and the `correlation_id`, to give to support. `429` and `5xx` answers are retried.
|
|
|
|
## License
|
|
|
|
MIT. See [LICENSE](LICENSE).
|
|
|
|
---
|
|
|
|
Create your API key in the [API Center](https://www.meu.interweb.ao/api-center.php) of Meu Interweb. Documentation: https://docs.interweb.ao
|
|
|
|
Maintained by RLX Holdings.
|