69 lines
1.8 KiB
Markdown
69 lines
1.8 KiB
Markdown
# cosmos-plan-crm-ansible-deploy
|
|
|
|
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
|
|
|