Automation and setup for sites I own.
Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
|
- resource "null_resource" "post_setup" {
- depends_on = [ linode_instance.prod ]
- connection {
- host = linode_instance.prod.ip_address
- user = "root"
- private_key = file("~/.ssh/id_rsa")
- }
- provisioner "remote-exec" {
- inline = [<<FIN
- apk update
- apk upgrade
- apk add iproute2 sqlite bind-tools tar xz
- sed -i -e 's/AllowTcpForwarding .*/AllowTcpForwarding yes/g' /etc/ssh/sshd_config
- rc-service sshd restart
- FIN
- ]
- }
- }
-
- resource "null_resource" "nginx_install" {
- depends_on = [ null_resource.post_setup ]
- connection {
- host = linode_instance.prod.ip_address
- user = "root"
- private_key = file("~/.ssh/id_rsa")
- }
- provisioner "file" {
- source = "http-default.conf"
- destination = "/tmp/http-default.conf"
- }
- provisioner "remote-exec" {
- inline = [<<FIN
- flock -x /tmp/apk -c 'apk add nginx'
- [ -e /etc/nginx/conf.d/default.conf ] && mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.disable
- install -m644 /tmp/http-default.conf /etc/nginx/conf.d/http-default.conf
-
- install -dm755 /var/www/default/htdocs /var/www/.well-known/acme-challenge
- echo todo write more stuff > /var/www/default/htdocs/index.html
-
- rc-update add nginx default
- rc-service nginx restart
- rm /tmp/http-default.conf
- FIN
- ]
- }
- }
-
- resource "null_resource" "uacme_install" {
- depends_on = [ null_resource.post_setup ]
- connection {
- host = linode_instance.prod.ip_address
- user = "root"
- private_key = file("~/.ssh/id_rsa")
- }
- provisioner "remote-exec" {
- inline = [<<FIN
- flock -x /tmp/apk -c 'apk add muacme'
- FIN
- ]
- }
- }
-
- resource "null_resource" "gitea_install" {
- depends_on = [ null_resource.post_setup ]
- connection {
- host = linode_instance.prod.ip_address
- user = "root"
- private_key = file("~/.ssh/id_rsa")
- }
- provisioner "remote-exec" {
- inline = [<<FIN
- flock -x /tmp/apk -c 'apk add gitea'
- FIN
- ]
- }
- }
|