forked from pablokbs/peladonerd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Desactivo ClamAV, Agrego SPF, DMARC y volumen para datos
- Loading branch information
Showing
6 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# | ||
# Exportamos nuestra key SSH | ||
|
||
resource "digitalocean_ssh_key" "pelado" { | ||
name = "pelado" | ||
public_key = "${file("id_rsa.pub")}" | ||
resource "digitalocean_ssh_key" "imcosta" { | ||
name = "imcosta" | ||
public_key = file("id_rsa.pub") | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# | ||
# Creamos el droplet | ||
|
||
variable "domain" {} | ||
|
||
resource "digitalocean_droplet" "mail" { | ||
image = "ubuntu-18-04-x64" | ||
name = "mail.pablokbs.com" | ||
image = "debian-10-x64" | ||
name = "mail.${var.domain}" | ||
region = "nyc1" | ||
size = "s-1vcpu-1gb" | ||
user_data = "${file("userdata.yaml")}" | ||
ssh_keys = ["${digitalocean_ssh_key.pelado.fingerprint}"] | ||
} | ||
user_data = file("userdata.yaml") | ||
ssh_keys = ["${digitalocean_ssh_key.imcosta.fingerprint}"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
resource "digitalocean_volume" "mail" { | ||
region = "nyc1" | ||
name = "mail" | ||
size = 5 | ||
initial_filesystem_type = "ext4" | ||
description = "Email disk" | ||
} | ||
|
||
resource "digitalocean_volume_attachment" "mail" { | ||
droplet_id = digitalocean_droplet.mail.id | ||
volume_id = digitalocean_volume.mail.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Creamos un dominio nuevo | ||
|
||
# Add a record to the domain | ||
resource "digitalocean_record" "mail" { | ||
domain = var.domain | ||
type = "A" | ||
name = "mail" | ||
ttl = "30" | ||
value = digitalocean_droplet.mail.ipv4_address | ||
} | ||
|
||
# Add mx record to the domain (so it can receive emails) | ||
resource "digitalocean_record" "mx" { | ||
domain = var.domain | ||
type = "MX" | ||
name = "@" | ||
priority = "10" | ||
ttl = "14400" | ||
value = "mail.${var.domain}." | ||
} | ||
|
||
# SPF | ||
resource "digitalocean_record" "spf" { | ||
domain = var.domain | ||
type = "TXT" | ||
name = "@" | ||
ttl = "14400" | ||
value = "v=spf1 mx ~all" | ||
} | ||
|
||
# DMARC | ||
resource "digitalocean_record" "dmarc" { | ||
domain = var.domain | ||
type = "TXT" | ||
name = "_dmarc.${var.domain}" | ||
ttl = "14400" | ||
value = "v=DMARC1; p=none; rua=mailto:dmarc-reports@${var.domain}" | ||
} | ||
|
||
# SMTP | ||
resource "digitalocean_record" "smtp" { | ||
domain = var.domain | ||
type = "CNAME" | ||
name = "smtp" | ||
ttl = "14400" | ||
value = "mail.${var.domain}." | ||
} | ||
|
||
# POP | ||
resource "digitalocean_record" "pop" { | ||
domain = var.domain | ||
type = "CNAME" | ||
name = "pop" | ||
ttl = "14400" | ||
value = "mail.${var.domain}." | ||
} | ||
|
||
# IMAP | ||
resource "digitalocean_record" "imap" { | ||
domain = var.domain | ||
type = "CNAME" | ||
name = "imap" | ||
ttl = "14400" | ||
value = "mail.${var.domain}." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters