From d9bb69a7a9e9cd5532ac506181b5905703fba20e Mon Sep 17 00:00:00 2001 From: ikhwan Date: Thu, 25 Sep 2025 11:08:07 +0800 Subject: [PATCH] cicd: modified README.md --- README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d58d2a..bc2393f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,68 @@ # cosmos-plan-crm-ansible-deploy -Ansible Playbook for deployment \ No newline at end of file +Ansible Playbook for deployment + +## Installation +1. Make sure podman, Playbook Ansible and containers.podman is installed + ```bash + dnf install podman + dnf install ansible + ansible-galaxy collection install containers.podman + ``` +2. Install AWS CLI as a user(Not as a root) + ```bash + unzip awscliv2.zip + curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + ./aws/install -i ~/.local/aws-cli -b ~/.local/bin + ``` + +## Setup Environment +Using quadlets to run container as service in systemd(rootless) +1. Allows the user's systemd services to continue running even after they have logged out of all sessions. Trigger command from root + ```bash + loginctl enable-linger {username} + ``` +2. Check subid and subgid(root). + ```bash + cat /etc/subuid + cat /etc/subgid + ``` +3. Add if not exists + ```bash + nano /etc/subuid + ``` +4. Then + ```makefile + user:100000:65536 + ``` +5. Check if $HOME/.config/containers/systemd exits. Else, create folder + ```bash + $HOME/.config/containers/systemd + ``` +## Setup Ansible Playbook +1. Navigate to cosmos-plan-crm-ansible-deploy folder +2. Create containers folder +3. Create crm-server.container & crm-client.container inside containers folder +4. Create env-file folder +5. Copy .env from crm-server/src/Web.Api/.env to env-file folder +4. Create vars folder +5. Create aws.yml in vars folder by command + ```bash + ansible-vault create aws.yml --ask-vault-pass + ``` +6. Save as below + ```makefile + aws_access_key: + aws_secret_key: + aws_region: + aws_account_id: + ``` + +## Run Ansible Playbook +1. Navigate to cosmos-plan-crm-ansible-deploy folder +2. Run command in terminal + ```bash + ansible-playbook playbook.yml --ask-vault-pass + ``` +3. Key in password and let process finish +