---
- set_fact:
portal_compose_dir: "{{ compose_configs_dir }}/{{app_name}}/portal"
tags: [liferay]
- set_fact:
liferay_home_dir: "{{liferay_base_dir}}/{{app_name}}"
tags: [liferay]
- include: rollback.yml
when: rollback_app is defined
- name: "Create Liferay Directories"
file:
dest: "{{ item }}"
state: directory
with_items:
- "{{ portal_compose_dir }}"
tags: [liferay]
- name: "Liferay App Swarm Filters"
template:
src: constraints.env.j2
dest: "{{ portal_compose_dir }}/constraints.env"
tags: [liferay]
- name: "Liferay Docker Compose"
template:
src: "liferay-compose.yml.j2"
dest: "{{ portal_compose_dir }}/docker-compose.yml"
tags: [liferay]
## TODO Refresh versions
- name: "Pull the Liferay App"
shell: docker-compose pull lportal
args:
chdir: "{{ portal_compose_dir}}"
environment:
DOCKER_HOST: "tcp://{{ ip }}:2376"
DOCKER_CERT_PATH: "/home/{{ ansible_ssh_user }}/.docker"
DOCKER_TLS_VERIFY: 1
PATH: "{{ path }}"
tags: [liferay]
- name: "Spin up Liferay Container"
shell: docker-compose up -d --no-recreate lportal
args:
chdir: "{{ portal_compose_dir }}"
environment:
DOCKER_HOST: "tcp://{{ ip }}:2376"
DOCKER_CERT_PATH: "/home/{{ ansible_ssh_user }}/.docker"
DOCKER_TLS_VERIFY: 1
PATH: "{{ path }}"
tags: [liferay]
- name: "Liferay Service Info"
get_url:
dest: /tmp/liferay_service_info.json
tags: [liferay-config]
- shell: "cat /tmp/liferay_service_info.json | jq --raw-output '.[] | .Address ' "
environment:
PATH: "{{ path }}"
register: liferay_hosts_info
tags: [liferay-config]
- debug: var=liferay_hosts_info.stdout
ignore_errors: true
tags: [liferay-config]
- add_host:
groups: liferay_deployed_hosts
name: "{{ liferay_hosts_info.stdout }}"
tags: [liferay-config]
- include: deploy-portal-ext.yml
tags: [liferay-config]