S3 Data Storage #1
@@ -94,3 +94,10 @@ DEFAULT_MERGE_STYLE = merge
|
|||||||
|
|
||||||
[repository.signing]
|
[repository.signing]
|
||||||
DEFAULT_TRUST_MODEL = committer
|
DEFAULT_TRUST_MODEL = committer
|
||||||
|
|
||||||
|
[storage]
|
||||||
|
STORAGE_TYPE = minio
|
||||||
|
MINIO_ENDPOINT = s3.us-east-1.amazonaws.com
|
||||||
|
MINIO_BUCKET = myrica-faya
|
||||||
|
MINIO_USE_SSL = true
|
||||||
|
MINIO_INSECURE_SKIP_VERIFY = false
|
||||||
@@ -63,6 +63,8 @@
|
|||||||
GITEA__server__SSH_DOMAIN: "{{ full_domain.value }}"
|
GITEA__server__SSH_DOMAIN: "{{ full_domain.value }}"
|
||||||
GITEA__server__DOMAIN: "{{ full_domain.value }}"
|
GITEA__server__DOMAIN: "{{ full_domain.value }}"
|
||||||
GITEA__server__ROOT_URL: "https://{{ full_domain.value }}/"
|
GITEA__server__ROOT_URL: "https://{{ full_domain.value }}/"
|
||||||
|
GITEA__storage__MINIO_ACCESS_KEY_ID: "{{ minio_access_key }}"
|
||||||
|
GITEA__storage__MINIO_SECRET_ACCESS_KEY: "{{ minio_secret_key }}"
|
||||||
labels:
|
labels:
|
||||||
docker-volume-backup.stop-during-backup: "true"
|
docker-volume-backup.stop-during-backup: "true"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -11,22 +11,17 @@
|
|||||||
rebuild: always
|
rebuild: always
|
||||||
pull: true
|
pull: true
|
||||||
|
|
||||||
- name: Make temp file.
|
|
||||||
ansible.builtin.tempfile:
|
|
||||||
suffix: .tar
|
|
||||||
register: tar_file
|
|
||||||
|
|
||||||
- name: Push image to archive.
|
- name: Push image to archive.
|
||||||
community.docker.docker_image:
|
community.docker.docker_image:
|
||||||
name: "{{ image_name }}"
|
name: "{{ image_name }}"
|
||||||
archive_path: "{{ tar_file.path }}"
|
archive_path: ../dist/image.tar
|
||||||
source: local
|
source: local
|
||||||
|
|
||||||
- name: Compress archive to artifact.
|
- name: Compress archive to artifact.
|
||||||
register: compress_image
|
register: compress_image
|
||||||
community.general.archive:
|
community.general.archive:
|
||||||
path: "{{ tar_file.path }}"
|
path: ../dist/image.tar
|
||||||
dest: "{{ tar_file.path }}.xz"
|
dest: ../dist/image.tar.xz
|
||||||
format: xz
|
format: xz
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
|
||||||
@@ -34,7 +29,7 @@
|
|||||||
amazon.aws.s3_object:
|
amazon.aws.s3_object:
|
||||||
bucket: "{{ image_bucket }}"
|
bucket: "{{ image_bucket }}"
|
||||||
object: "{{ image_key }}"
|
object: "{{ image_key }}"
|
||||||
src: "{{ tar_file.path }}.xz"
|
src: ../dist/image.tar.xz
|
||||||
mode: put
|
mode: put
|
||||||
|
|
||||||
region: "{{ aws_region }}"
|
region: "{{ aws_region }}"
|
||||||
@@ -98,6 +93,8 @@
|
|||||||
GITEA__server__SSH_DOMAIN: "{{ full_domain.value }}"
|
GITEA__server__SSH_DOMAIN: "{{ full_domain.value }}"
|
||||||
GITEA__server__DOMAIN: "{{ full_domain.value }}"
|
GITEA__server__DOMAIN: "{{ full_domain.value }}"
|
||||||
GITEA__server__ROOT_URL: "https://{{ full_domain.value }}/"
|
GITEA__server__ROOT_URL: "https://{{ full_domain.value }}/"
|
||||||
|
GITEA__storage__MINIO_ACCESS_KEY_ID: "{{ minio_access_key }}"
|
||||||
|
GITEA__storage__MINIO_SECRET_ACCESS_KEY: "{{ minio_secret_key }}"
|
||||||
labels:
|
labels:
|
||||||
docker-volume-backup.stop-during-backup: "true"
|
docker-volume-backup.stop-during-backup: "true"
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
## Install extras.
|
||||||
rpm --rebuilddb
|
rpm --rebuilddb
|
||||||
amazon-linux-extras install docker ansible2 python3.8 -y
|
amazon-linux-extras install docker ansible2 python3.8 -y
|
||||||
|
|
||||||
@@ -10,7 +11,7 @@ systemctl start docker
|
|||||||
# Set up the correct version of Python (for Ansible).
|
# Set up the correct version of Python (for Ansible).
|
||||||
ln -sf /usr/bin/python3.8 /usr/bin/python3
|
ln -sf /usr/bin/python3.8 /usr/bin/python3
|
||||||
ln -sf /usr/bin/pip3.8 /usr/bin/pip3
|
ln -sf /usr/bin/pip3.8 /usr/bin/pip3
|
||||||
pip3 install botocore boto3 requests packaging
|
pip3 install botocore boto3 requests packaging --user ssm-user
|
||||||
python3 -m pip install -U pip
|
python3 -m pip install -U pip
|
||||||
|
|
||||||
# Add some swap space.
|
# Add some swap space.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ resource "aws_instance" "this" {
|
|||||||
subnet_id = module.vpc.public_subnets[0]
|
subnet_id = module.vpc.public_subnets[0]
|
||||||
|
|
||||||
user_data = file("install.sh")
|
user_data = file("install.sh")
|
||||||
user_data_replace_on_change = false
|
user_data_replace_on_change = true
|
||||||
|
|
||||||
iam_instance_profile = aws_iam_instance_profile.ssm.name
|
iam_instance_profile = aws_iam_instance_profile.ssm.name
|
||||||
vpc_security_group_ids = [aws_security_group.public_access.id]
|
vpc_security_group_ids = [aws_security_group.public_access.id]
|
||||||
|
|||||||
Reference in New Issue
Block a user