diff options
author | clarkzjw <[email protected]> | 2022-12-10 03:09:40 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2022-12-10 03:09:40 -0800 |
commit | c3a0b2affb1b3b5fca2eb69adfbd005a7a22ea3b (patch) | |
tree | a32ee4fcac05fa7f96fc895384728ecaee535da6 | |
parent | 027b7bd2633bf57e1c49b29329ad61a039a97869 (diff) | |
download | jinwei.me-c3a0b2affb1b3b5fca2eb69adfbd005a7a22ea3b.tar.gz |
infra: add rds initial database
config: install docker & docker-compose
-rw-r--r-- | jinwei.me/config/roles/debian_init/tasks/main.yaml | 9 | ||||
-rw-r--r-- | jinwei.me/config/site.yaml | 1 | ||||
-rw-r--r-- | jinwei.me/infra/rds.tf | 1 | ||||
-rw-r--r-- | jinwei.me/infra/variables.tf | 4 |
4 files changed, 15 insertions, 0 deletions
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 @@ | |||
12 | - ca-certificates | 12 | - ca-certificates |
13 | - mariadb-client | 13 | - mariadb-client |
14 | - lsb-release | 14 | - lsb-release |
15 | - python3 | ||
16 | - python3-dev | ||
17 | - python3-pip | ||
15 | - unzip | 18 | - unzip |
16 | - gnupg | 19 | - gnupg |
17 | - htop | 20 | - htop |
@@ -50,6 +53,12 @@ | |||
50 | state: latest | 53 | state: latest |
51 | update_cache: true | 54 | update_cache: true |
52 | 55 | ||
56 | - name: Install Docker Module for Python | ||
57 | pip: | ||
58 | name: | ||
59 | - docker | ||
60 | - docker-compose | ||
61 | |||
53 | - name: enable docker service | 62 | - name: enable docker service |
54 | systemd: | 63 | systemd: |
55 | name: docker | 64 | 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 @@ | |||
1 | - hosts: jinwei-me | 1 | - hosts: jinwei-me |
2 | roles: | 2 | roles: |
3 | - role: debian_init | 3 | - role: debian_init |
4 | - 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" { | |||
6 | 6 | ||
7 | resource "aws_db_instance" "jinwei-me" { | 7 | resource "aws_db_instance" "jinwei-me" { |
8 | identifier = var.name | 8 | identifier = var.name |
9 | db_name = var.rds_initial_db_name | ||
9 | instance_class = var.rds_instance_class | 10 | instance_class = var.rds_instance_class |
10 | allocated_storage = var.rds_storage | 11 | allocated_storage = var.rds_storage |
11 | engine = var.rds_engine | 12 | 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" { | |||
14 | 14 | ||
15 | 15 | ||
16 | # RDS | 16 | # RDS |
17 | variable "rds_initial_db_name" { | ||
18 | default = "wordpress" | ||
19 | } | ||
20 | |||
17 | variable "rds_instance_class" { | 21 | variable "rds_instance_class" { |
18 | default = "db.t3.micro" | 22 | default = "db.t3.micro" |
19 | } | 23 | } |