Re:Show HN: HomelabOS – Ansible scripts to deploy self hoste...
by oarsinsync on Tuesday November 13, 2018 @05:18AM
(#18439950)
Can you publish this solution somewhere? It sounds grand!
[ Parent
| on HN ]
Re:Show HN: HomelabOS – Ansible scripts to deploy self hoste...
by zimablue on Tuesday November 13, 2018 @05:32PM
(#18445552)
Sorry I'm too ashamed, I was learning basically all the technology involved. I can give a recipe:
first 4 pages of this:
* https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial...
swapped out/skipped the sqllite3 for a single hardcoded user class (it's just me!)
* throw in boto3 routes which do add/remove/clear ip rules, and start/stop instances, a list of checkboxable instances pulled from ec2 listing them
* deploy using zappa https://github.com/Miserlou/Zappa
some things that can trip you: * for the ip there's a stupid mistake I made, when testing locally you can request.get(myip) to get which ip to use, remotely you pull it off of request.remote_addr * your lambda will need a specialised IAM role to have rights to do all this, it's configurable in zappa config and I just clicked creating one through aws management console * this is in the zappa docs but I didn't rtfm so I buil everything using conda which doesn't work, then I built it with a virtualenv with the same name as the project which doesn't work.