Can abra support VPS/DNS provider plugins for initial setup? #86

Closed
opened 2021-03-04 11:02:36 +00:00 by decentral1se · 3 comments
Owner

Cloudron makes initial setup real smooth. abra does a lot but leaves you in the cold for the first steps. Setting up a VPS and wiring up DNS. There is a lot of automation sitting around which we could plug in.

I am thinking it would be good to support Hetnzer for VPS setup and Gandi for DNS in a first step. But I don't want to lump this all into the abra source, so I am thinking of a (drum-roll) plugin architecture! Anyone can support their own providers and we don't have to deal with it ourselves.

We could write abra-hetzner and abra-gandi plugins which abra can pull in. They will also be just bash scripts and have their own installer script automation which will make it easy to install them via abra.

I could imagine the following commands (it prompts for an API token and other stuff):

abra server new [--provider=<provider>]

This runs basically (see these docs):

curl 
	-X POST 
	-H "Authorization: Bearer $API_TOKEN" 
	-H "Content-Type: application/json" 
	-d '{"name":"my-server","location":"nbg1","datacenter":"nbg1-dc3","server_type":"cx11","start_after_create":true,"image":"ubuntu-20.04","ssh_keys":["my-ssh-key"],"volumes":[],"networks":[],"user_data":"#cloud-config
runcmd:
- [touch, /root/cloud-init-worked]
","labels":{},"automount":false}' 
	'https://api.hetzner.cloud/v1/servers'

abra server new will error out if it cannot get abra-hetzner downloaded.

Then, after you have your server up, you can wire up DNS entries for that with:

abra server dns [--provider=<provider>]

Which will basically run (see these docs) and wire up two A records, the main one and wildcard one:

curl -X POST 
  https://api.gandi.net/v5/domain/domains 
  -H 'authorization: Apikey your-api-key' 
  -H 'content-type: application/json' 
  -d '{"fqdn":"example.com","duration":5,"owner":{"city":"Paris","given":"Alice","family":"Doe","zip":"75001","country":"FR","streetaddr":"5 rue neuve","phone":"+33.123456789","state":"FR-J","type":0,"email":"alice@example.org"}}'

Whatcha think?

Cloudron makes initial setup real smooth. `abra` does a lot but leaves you in the cold for the first steps. Setting up a VPS and wiring up DNS. There is a lot of automation sitting around which we could plug in. I am thinking it would be good to support Hetnzer for VPS setup and Gandi for DNS in a first step. But I don't want to lump this all into the `abra` source, so I am thinking of a (*drum-roll*) plugin architecture! Anyone can support their own providers and we don't have to deal with it ourselves. We could write `abra-hetzner` and `abra-gandi` plugins which `abra` can pull in. They will also be just bash scripts and have their own installer script automation which will make it easy to install them via `abra`. I could imagine the following commands (it prompts for an API token and other stuff): > `abra server new [--provider=<provider>]` This runs basically (see [these docs](https://docs.hetzner.cloud/#servers-create-a-server)): ``` curl -X POST -H "Authorization: Bearer $API_TOKEN" -H "Content-Type: application/json" -d '{"name":"my-server","location":"nbg1","datacenter":"nbg1-dc3","server_type":"cx11","start_after_create":true,"image":"ubuntu-20.04","ssh_keys":["my-ssh-key"],"volumes":[],"networks":[],"user_data":"#cloud-config runcmd: - [touch, /root/cloud-init-worked] ","labels":{},"automount":false}' 'https://api.hetzner.cloud/v1/servers' ``` `abra server new` will error out if it cannot get `abra-hetzner` downloaded. Then, after you have your server up, you can wire up DNS entries for that with: > `abra server dns [--provider=<provider>]` Which will basically run (see [these docs](https://api.gandi.net/docs/domains/#post-v5-domain-domains)) and wire up two A records, the main one and wildcard one: ``` curl -X POST https://api.gandi.net/v5/domain/domains -H 'authorization: Apikey your-api-key' -H 'content-type: application/json' -d '{"fqdn":"example.com","duration":5,"owner":{"city":"Paris","given":"Alice","family":"Doe","zip":"75001","country":"FR","streetaddr":"5 rue neuve","phone":"+33.123456789","state":"FR-J","type":0,"email":"alice@example.org"}}' ``` Whatcha think?
decentral1se added this to the Beta release milestone 2021-03-04 11:02:36 +00:00
decentral1se added the
enhancement
label 2021-03-04 11:02:36 +00:00
Owner

Amazing plans 👏👏

thinking a (drum-roll) plugin architecture

omg yes! let the bash-torturing continue 😁

We could maybe have an ~/.abra/plugins dir, like ~/.abra/apps, with clones of the various plugins. Each one could have an abra.sh defining the plugin functions.

Amazing plans 👏👏 > thinking a (drum-roll) plugin architecture omg yes! let the bash-torturing continue 😁 We could maybe have an `~/.abra/plugins` dir, like `~/.abra/apps`, with clones of the various plugins. Each one could have an `abra.sh` defining the plugin functions.
Author
Owner

OK, away we go then!

I've made skeletons repos for them both:

I'll close off this ticket and break it down into specifics.

I think one promising thing about this is that we can then say to other co-ops, hey, listen, if you can give us API end-points for your infrastructure then we can start to have things like abra server new --provider=<$your-co-op> and really bring it off the corporate clouds.

OK, away we go then! I've made skeletons repos for them both: - https://git.autonomic.zone/coop-cloud/abra-gandi - https://git.autonomic.zone/coop-cloud/abra-hetzner I'll close off this ticket and break it down into specifics. I think one promising thing about this is that we can then say to other co-ops, hey, listen, if you can give us API end-points for your infrastructure then we can start to have things like `abra server new --provider=<$your-co-op>` and really bring it off the corporate clouds.
Owner

we can then say to other co-ops, hey, listen, if you can give us API end-points for your infrastructure then we can start to have things like abra server new --provider=<$your-co-op> and really bring it off the corporate clouds.

Oh yeah, super-fantastic 😍

> we can then say to other co-ops, hey, listen, if you can give us API end-points for your infrastructure then we can start to have things like `abra server new --provider=<$your-co-op>` and really bring it off the corporate clouds. Oh yeah, super-fantastic 😍
This repo is archived. You cannot comment on issues.
No Milestone
No Assignees
2 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/abra#86
No description provided.