2022-05-27 23:27:40 +00:00
|
|
|
---
|
|
|
|
- name: Install unzip using apt
|
2022-07-07 20:48:50 +00:00
|
|
|
become: true
|
2022-05-27 23:27:40 +00:00
|
|
|
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"
|
2022-07-07 21:03:54 +00:00
|
|
|
become: true
|
2022-05-27 23:27:40 +00:00
|
|
|
ufw:
|
|
|
|
rule: allow
|
|
|
|
proto: tcp
|
|
|
|
port: "{{ item }}"
|
|
|
|
loop:
|
|
|
|
- '3000'
|
|
|
|
- '80'
|
|
|
|
- '443'
|
|
|
|
- '22'
|
|
|
|
|
2022-05-30 04:09:48 +00:00
|
|
|
- name: Creates directory structure for rocketchat data
|
2022-05-27 23:27:40 +00:00
|
|
|
file:
|
2022-05-30 02:03:23 +00:00
|
|
|
path: /home/{{ main_user }}/rocketchat/data
|
2022-05-27 23:27:40 +00:00
|
|
|
state: directory
|
|
|
|
owner: "{{ main_user }}"
|
|
|
|
group: "{{ main_user }}"
|
|
|
|
mode: 0775
|
|
|
|
|
2022-05-30 04:09:48 +00:00
|
|
|
- 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-07-08 01:33:50 +00:00
|
|
|
- name: Creates directory structure for upload data
|
|
|
|
file:
|
|
|
|
path: /home/{{ main_user }}/rocketchat/uploads
|
|
|
|
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/
|
2022-05-30 03:52:02 +00:00
|
|
|
|
2022-05-30 02:03:23 +00:00
|
|
|
- name: bring down rocketchat docker-compose
|
2022-05-27 23:27:40 +00:00
|
|
|
become_user: "{{ main_user }}"
|
|
|
|
docker_compose:
|
2022-05-30 02:03:23 +00:00
|
|
|
project_src: /home/{{ main_user }}/rocketchat/
|
2022-05-27 23:27:40 +00:00
|
|
|
state: absent
|
2022-05-30 02:03:23 +00:00
|
|
|
register: __remove_rocketchat
|
2022-05-27 23:27:40 +00:00
|
|
|
tags:
|
|
|
|
- bring-down
|
|
|
|
|
|
|
|
- name: update permissions
|
2022-07-07 21:03:54 +00:00
|
|
|
become: true
|
2022-05-27 23:27:40 +00:00
|
|
|
file:
|
|
|
|
path: /home/{{ main_user }}
|
|
|
|
state: directory
|
|
|
|
recurse: yes
|
|
|
|
owner: "{{ main_user }}"
|
|
|
|
group: "{{ main_user }}"
|
|
|
|
mode: 0775
|
|
|
|
|
2022-05-30 02:03:23 +00:00
|
|
|
- name: setup nginx reverse proxy from template
|
|
|
|
template:
|
2022-05-30 04:03:36 +00:00
|
|
|
src: templates/nginx.conf.j2
|
2022-05-30 02:03:23 +00:00
|
|
|
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:
|
2022-05-30 02:03:23 +00:00
|
|
|
project_src: /home/{{ main_user }}/rocketchat/
|
2022-05-27 23:27:40 +00:00
|
|
|
state: present
|
2022-05-30 02:03:23 +00:00
|
|
|
register: __rocketchat
|
2022-05-27 23:27:40 +00:00
|
|
|
|
|
|
|
- name: debug docker compose down
|
|
|
|
debug:
|
2022-05-30 02:03:23 +00:00
|
|
|
var: __remove_rocketchat
|
2022-05-27 23:27:40 +00:00
|
|
|
|
2022-05-30 02:03:23 +00:00
|
|
|
- name: debug docker compose up debug
|
2022-05-27 23:27:40 +00:00
|
|
|
debug:
|
2022-05-30 02:03:23 +00:00
|
|
|
var: __rocketchat
|