From c3a0b2affb1b3b5fca2eb69adfbd005a7a22ea3b Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Sat, 10 Dec 2022 03:09:40 -0800 Subject: infra: add rds initial database config: install docker & docker-compose --- jinwei.me/config/roles/debian_init/tasks/main.yaml | 9 +++++++++ jinwei.me/config/site.yaml | 1 + jinwei.me/infra/rds.tf | 1 + jinwei.me/infra/variables.tf | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/jinwei.me/config/roles/debian_init/tasks/main.yaml b/jinwei.me/config/roles/debian_init/tasks/main.yaml index 48e8380..664d41c 100644 --- a/jinwei.me/config/roles/debian_init/tasks/main.yaml +++ b/jinwei.me/config/roles/debian_init/tasks/main.yaml @@ -12,6 +12,9 @@ - ca-certificates - mariadb-client - lsb-release + - python3 + - python3-dev + - python3-pip - unzip - gnupg - htop @@ -50,6 +53,12 @@ state: latest update_cache: true +- name: Install Docker Module for Python + pip: + name: + - docker + - docker-compose + - name: enable docker service systemd: name: docker diff --git a/jinwei.me/config/site.yaml b/jinwei.me/config/site.yaml index 3dbcc71..438033b 100644 --- a/jinwei.me/config/site.yaml +++ b/jinwei.me/config/site.yaml @@ -1,3 +1,4 @@ - hosts: jinwei-me roles: - role: debian_init + - role: wordpress diff --git a/jinwei.me/infra/rds.tf b/jinwei.me/infra/rds.tf index 6565332..381868e 100644 --- a/jinwei.me/infra/rds.tf +++ b/jinwei.me/infra/rds.tf @@ -6,6 +6,7 @@ resource "aws_db_parameter_group" "jinwei-me" { resource "aws_db_instance" "jinwei-me" { identifier = var.name + db_name = var.rds_initial_db_name instance_class = var.rds_instance_class allocated_storage = var.rds_storage engine = var.rds_engine diff --git a/jinwei.me/infra/variables.tf b/jinwei.me/infra/variables.tf index 6745915..575b118 100644 --- a/jinwei.me/infra/variables.tf +++ b/jinwei.me/infra/variables.tf @@ -14,6 +14,10 @@ variable "region" { # RDS +variable "rds_initial_db_name" { + default = "wordpress" +} + variable "rds_instance_class" { default = "db.t3.micro" } -- cgit v1.2.3