From 77088baa9bb25c218b64fb6167309fe238f13128 Mon Sep 17 00:00:00 2001 From: Tiago Carrondo Date: Fri, 12 Aug 2022 20:11:31 +0100 Subject: [PATCH] adiciona containers e tweaks --- 05_container_saucy.yaml | 46 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/05_container_saucy.yaml b/05_container_saucy.yaml index 766420e..e055285 100644 --- a/05_container_saucy.yaml +++ b/05_container_saucy.yaml @@ -13,25 +13,69 @@ - curl - gnupg - lsb-release + - python3-psycopg2 - name: SAUCY -- add Docker GPG key + become: true apt_key: url: https://download.docker.com/linux/ubuntu/gpg state: present - name: SAUCY -- add Docker repository to apt + become: true apt_repository: repo: deb https://download.docker.com/linux/ubuntu focal stable state: present - name: SAUCY -- install docker + become: true apt: name: '{{item}}' state: latest - update_cache: yes loop: - docker-ce - docker-ce-cli - containerd.io + - python3-docker - name: SAUCY -- start, and enable, docker service + become: true service: name: docker state: started enabled: yes + # postgres server and db, account + - name: SAUCY -- install postgresql + become: true + community.docker.docker_container: + name: postgresql + image: postgres:latest + state: started + container_default_behavior: no_defaults + volumes: + - /data:/var/lib/postgresql/data + ports: + - '5432:5432' + env: + POSTGRES_USER: '{{ db_user }}' + POSTGRES_PASSWORD: '{{ db_password }}' + POSTGRES_DB: '{{ db_name }}' + - name: SAUCY -- add Saucy container + community.docker.docker_container: + name: saucy + image: git.ansol.org/ansol/saucy:latest + state: started + container_default_behavior: no_defaults + ports: + - '80:3000' + env: + DATABASE_URL: 'postgres://{{ db_user }}:{{ db_password }}@{{ db_host }}/{{ db_name }}' + SMTP_ADDRESS: smtp.netureza.pt + SMTP_DOMAIN: ansol.org + SMTP_USERNAME: '{{ smtp_username }}' + SMTP_PASSWORD: '{{ smtp_password }}' + SMTP_FROM_ADDRESS: direccao@ansol.org + SMTP_FROM_NAME: ANSOL + + IFTHENPAY_KEY: '{{ ifthenpay_key }}' + IFTHENPAY_ACCOUNTS: '{{ ifthenpay_accounts }}' + + BASE_HOST: saucy.ansol.org + RAILS_LOG_TO_STDOUT: 'true' + RAILS_ENV: production