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
#!/bin/bash | |
mv /var/www/html /var/www/html.old | |
mv /var/www/wordpress /var/www/html | |
chown -Rf www-data:www-data /var/www/html | |
sed -i "s/\$domain/${domain}/g" /etc/apache2/sites-enabled/000-default.conf | |
a2enconf block-xmlrpc | |
service apache2 restart |
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
#!/bin/bash | |
mv /var/www/html /var/www/html.old | |
mv /var/www/wordpress /var/www/html | |
chown -Rf www-data:www-data /var/www/html | |
sed -i "s/\$domain/$dom/g" /etc/apache2/sites-enabled/000-default.conf | |
a2enconf block-xmlrpc | |
service apache2 restart |
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
output "price_monthly" { | |
value = "${digitalocean_droplet.default.price_monthly}" | |
} | |
output "ipv4_address" { | |
value = "${digitalocean_droplet.default.ipv4_address}" | |
} |
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
resource "digitalocean_domain" "default" { | |
name = "${var.domain}" | |
ip_address = "${digitalocean_droplet.default.ipv4_address}" | |
} | |
resource "digitalocean_droplet" "default" { | |
name = "${coalesce(var.droplet_name, var.domain)}" | |
image = "wordpress-18-04" | |
region = "${var.droplet_region}" | |
size = "${var.droplet_size}" |
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
module "project_name" { | |
source = "git@github.com:sergeykuzmich/tfmodule-do_wordpress.git" | |
domain = "project_domain.com" | |
} |
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
#!/bin/bash | |
# | |
# WordPress activation script | |
# | |
# This script will configure Apache with the domain | |
# provided by the user and offer the option to set up | |
# LetsEncrypt as well. | |
# Enable WordPress on firstlogin | |
mv /var/www/html /var/www/html.old |
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
provider "digitalocean" {} |
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
provider "digitalocean" { | |
token = "${var.do_token}" | |
} |
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
variable "do_token" { | |
description = "DigitalOcean API Token" | |
} | |
variable "domain" { | |
description = "Domain name the service should be located on" | |
} | |
variable "droplet_name" { | |
description = "Droplet name in DigitalOcean Control Panel" |
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
variable "variable_name" { | |
type = "string|list|map" | |
default = "" | |
description = "A human-friendly description for the variable" | |
} |