# weblab/fillo
---
- hosts: all
  gather_facts: no
  user: "{{ lookup('env','DEPLOY_USER') }}"
  vars:
    image: "{{ lookup('env','AWS_ACCOUNT_ID') }}.dkr.ecr.us-east-1.amazonaws.com/weblab/fillo:{{ lookup('env','SERVICE_VERSION') }}"
    MONGO_URI: "{{ lookup('env','MONGO_URI') }}"

  tasks:
  - name: Get AWS ECR login token
    shell: eval $(aws ecr get-login --region us-east-1)

  - name: Get Fillo image
    command: docker pull {{ image }}

  - name: Redeploy container
    docker_container:
      name: fillo
      image: "{{ image }}"
      state: started
      ignore_image: True
      ports: "5002:3000"
      restart: yes
      restart_policy: always
      env:
        MONGO_URI: "{{ MONGO_URI }}"

# weblab/fillo
---
- hosts: all
  gather_facts: no
  user: "{{ lookup('env','DEPLOY_USER') }}"
  vars:
    image: "{{ lookup('env','AWS_ACCOUNT_ID') }}.dkr.ecr.us-east-1.amazonaws.com/weblab/fillo:{{ lookup('env','SERVICE_VERSION') }}"
    MONGO_URI: "{{ lookup('env','MONGO_URI') }}"
    REDIS_URL: "{{ lookup('env','REDIS_URL') }}"
    JWT_SECRET: "{{ lookup('env','JWT_SECRET') }}"

  tasks:
  - name: Get AWS ECR login token
    shell: eval $(aws ecr get-login --region us-east-1)

  - name: Get Fillo image
    command: docker pull {{ image }}

  - name: Redeploy container
    docker_container:
      name: fillo
      image: "{{ image }}"
      state: started
      ignore_image: True
      ports: "5002:3000"
      restart: yes
      restart_policy: always
      env:
        MONGO_URI: "{{ MONGO_URI }}"
        REDIS_URL: "{{ REDIS_URL }}"
        JWT_SECRET: "{{ JWT_SECRET }}"

Add REDIS_URL and JWT_SECRET env vars
[INFRA] Add REDIS_URL and JWT_SECRET env vars
