ansible-role-rocketchat/tasks/rocketchat.yml

75 lines
1.7 KiB
YAML
Raw Normal View History

2022-05-27 23:27:40 +00:00
---
- name: Install unzip using apt
apt: name=unzip state=latest update_cache=yes force_apt_get=yes
- name: "NOTSCORED | 3.5.1.6 | PATCH | Ensure firewall rules exist for all open ports"
ufw:
rule: allow
proto: tcp
port: "{{ item }}"
loop:
- '3000'
- '80'
- '443'
- '22'
- name: Creates directory structure for rocketchat data
2022-05-27 23:27:40 +00:00
file:
path: /home/{{ main_user }}/rocketchat/data
2022-05-27 23:27:40 +00:00
state: directory
owner: "{{ main_user }}"
group: "{{ main_user }}"
mode: 0775
- name: Creates directory structure for nginx data
file:
path: /home/{{ main_user }}/rocketchat/nginx
state: directory
owner: "{{ main_user }}"
group: "{{ main_user }}"
mode: 0775
2022-05-30 03:38:56 +00:00
- name: copy docker compose to server
become_user: "{{ main_user }}"
copy:
2022-05-30 04:00:13 +00:00
src: files/docker-compose.yml
2022-05-30 03:38:56 +00:00
dest: /home/{{ main_user }}/rocketchat/
- name: bring down rocketchat docker-compose
2022-05-27 23:27:40 +00:00
become_user: "{{ main_user }}"
docker_compose:
project_src: /home/{{ main_user }}/rocketchat/
2022-05-27 23:27:40 +00:00
state: absent
register: __remove_rocketchat
2022-05-27 23:27:40 +00:00
tags:
- bring-down
- name: update permissions
file:
path: /home/{{ main_user }}
state: directory
recurse: yes
owner: "{{ main_user }}"
group: "{{ main_user }}"
mode: 0775
- name: setup nginx reverse proxy from template
template:
2022-05-30 04:03:36 +00:00
src: templates/nginx.conf.j2
dest: /home/{{ main_user }}/rocketchat/nginx/nginx.conf
2022-05-27 23:27:40 +00:00
- name: docker compose up
become_user: "{{ main_user }}"
docker_compose:
project_src: /home/{{ main_user }}/rocketchat/
2022-05-27 23:27:40 +00:00
state: present
register: __rocketchat
2022-05-27 23:27:40 +00:00
- name: debug docker compose down
debug:
var: __remove_rocketchat
2022-05-27 23:27:40 +00:00
- name: debug docker compose up debug
2022-05-27 23:27:40 +00:00
debug:
var: __rocketchat