Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Current versions of rocketchat #114

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ Features
Supported Platforms
-------------------
### Debian
- Strect (9)
- Strecth (9)
- Buster (10)

### Ubuntu
- Focal Fossa: 20.04 LTS
- Bionic Beaver: 18.04 LTS
- Xenial: 16.04 LTS
- Trusty: 14.04 LTS

### EL (RHEL/CentOS)
- 7
- 8

If you'd like to see your distribution/operating system supported, please [raise an issue](https://github.com/RocketChat/Rocket.Chat.Ansible/issues)!

Expand Down Expand Up @@ -118,7 +119,7 @@ Set in [`vars/RedHat.yml`](vars/RedHat.yml)
| `rocket_chat_mongodb_dbpath` | `/var/lib/mongodb` | The path for MongoDB to store its databases |
| `rocket_chat_nginx_process_user` | `nginx` | The user for that will be used to spawn the Nginx server process |

### RHEL/CentOS 7 variables
### RHEL/CentOS 7/8 variables
Set in [`vars/RedHat_7.yml`](vars/RedHat_7.yml)

| Name | Default Value | Description |
Expand All @@ -128,6 +129,7 @@ Set in [`vars/RedHat_7.yml`](vars/RedHat_7.yml)
| ` src` | `rocketchat.service.j2` | The source template to deploy for the Rocket.Chat service manifest |
| ` dest` | `/usr/lib/systemd/system/rocketchat.service` | The destination to deploy the Rocket.Chat service manifest to |
| `rocket_chat_tarball_validate_remote_cert` | false | A boolean value that determines wether or not to validate the SSL certs for the Rocket.Chat tarball remote |
| `rocket_chat_epel_key` | `/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7` | EPEL repository GPG key to be used |

### Debian variables
Set in [`vars/Debian.yml`](vars/Debian.yml)
Expand Down
5 changes: 3 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rocket_chat_tarball_asc_remote: https://releases.rocket.chat/{{ rocket_chat_ver
# Using the sha256sum is deprecated in favor of GPG verifying
rocket_chat_tarball_sha256sum: 0
rocket_chat_tarball_gpg_key: 0E163286C20D07B9787EBE9FD7F9D0414FD08104
rocket_chat_tarball_gpg_keyserver: ha.pool.sks-keyservers.net
rocket_chat_tarball_gpg_keyserver: keyserver.ubuntu.com
rocket_chat_tarball_check_checksum: false
rocket_chat_tarball_check_pgp: true
rocket_chat_tarball_fetch_timeout: 100
Expand All @@ -23,7 +23,7 @@ rocket_chat_service_host: "{{ ansible_fqdn }}"
rocket_chat_service_port: 3000
rocket_chat_service_environment: {}
rocket_chat_service_extra_instances: []
rocket_chat_node_version: 12.16.1
rocket_chat_node_version: 12.22.1
rocket_chat_node_prefix: /usr/local/n/versions/node/{{ rocket_chat_node_version }}
rocket_chat_node_path: "{{ rocket_chat_node_prefix }}/bin/node"
rocket_chat_npm_version: 6.14.0
Expand Down Expand Up @@ -76,3 +76,4 @@ rocket_chat_letsencrypt_acmetiny_path: /opt/acme-tiny
rocket_chat_letsencrypt_wellknown_path: /var/www/letsencrypt
rocket_chat_letsencrypt_ca_cert: https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem
rocket_chat_letsencrypt_force_renew: false
rocket_chat_n_path: 'n'
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

- name: Ensure the EPEL repository GPG key is imported
rpm_key:
key: /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
key: "{{ rocket_chat_epel_key }}"
state: present

when: ((ansible_distribution | lower) == "centos")
Expand Down
2 changes: 1 addition & 1 deletion tasks/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
when:
- (rocket_chat_nginx_pfs_file is defined)
- (rocket_chat_nginx_pfs_file)
- (rocket_chat_nginx_pfs_file | exists)
- (rocket_chat_nginx_pfs_file is exists)
notify: Reload the Nginx service
tags: pfs

Expand Down
2 changes: 1 addition & 1 deletion tasks/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
register: n_node_bin

- name: "Install the supported NodeJS environment via n [Version: {{ rocket_chat_node_version }}]"
shell: n {{ rocket_chat_node_version }}
shell: '{{ rocket_chat_n_path }} {{ rocket_chat_node_version }}'
when: ('stat' in n_node_bin)
and (not (n_node_bin.stat.exists | bool))

Expand Down
39 changes: 20 additions & 19 deletions tests/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ MEM_SIZE = 1024
LV_CPU_MODE = 'host-passthrough'.freeze
ANSIBLE_GROUP_NAME = 'chat_servers'.freeze
SHARED_FOLDER_DISABLED = true

Vagrant.configure('2') do |config|
config.ssh.insert_key = false
config.ssh.username = 'vagrant'
Expand All @@ -21,6 +20,7 @@ Vagrant.configure('2') do |config|
ansible.verbose = "vv"
ansible.become = true
ansible.playbook = 'provision.yml'
ansible.compatibility_mode = "2.0"
# ansible.raw_arguments = ['-t check']
end
end
Expand All @@ -36,12 +36,9 @@ Vagrant.configure('2') do |config|
'id' => 1,
'atlas_name' => 'debian/stretch64'
},
'ubuntu14' => {
'debian10' => {
'id' => 2,
'atlas_name' => 'ubuntu/trusty64',
# Some random guy's image that looked ok
# Libvirt boxes are hard to come by for trusty64.
'lv_atlas_name' => 'peru/ubuntu-14.04-server-amd64'
'atlas_name' => 'debian/buster64'
},
'ubuntu16' => {
'id' => 3,
Expand All @@ -50,23 +47,27 @@ Vagrant.configure('2') do |config|
'ansible_python_interpreter': '/usr/bin/python3'
}
},
# 'ubuntu18' => {
# 'id' => 4,
# 'atlas_name' => 'generic/ubuntu1804',
# 'extra_vars' => {
# 'ansible_python_interpreter': '/usr/bin/python3'
# }
# },
'centos7' => {
'id' => 5,
'atlas_name' => 'centos/7'
'ubuntu18' => {
'id' => 4,
'atlas_name' => 'generic/ubuntu1804',
'extra_vars' => {
'ansible_python_interpreter': '/usr/bin/python3'
}
},
'fedora27' => {
'id' => 6,
'atlas_name' => 'fedora/27-cloud-base',
'ubuntu20' => {
'id' => 5,
'atlas_name' => 'generic/ubuntu2004',
'extra_vars' => {
'ansible_python_interpreter': '/usr/bin/python3'
}
},
'centos7' => {
'id' => 6,
'atlas_name' => 'centos/7'
},
'centos8' => {
'id' => 7,
'atlas_name' => 'centos/8'
}
}

Expand Down
13 changes: 9 additions & 4 deletions tests/provision.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
line: '%{{ ansible_user }} ALL=(ALL) NOPASSWD: ALL'
validate: visudo -cf %s

- name: Copy PEM file
copy:
src: "{{ rocket_chat_nginx_pfs_file }}"
dest: "{{ rocket_chat_nginx_pfs_file }}"

- name: Include the Rocket.Chat role
include_role:
name: "{{ role_name | default('../..') }}"
Expand All @@ -53,7 +58,7 @@
port: "{{ rocket_chat_service_port }}"
host: localhost
state: started
timeout: 30
timeout: 60
register: api_pre_check

- name: Do a basic status check of the API
Expand All @@ -68,7 +73,7 @@
- (api_check.status|int != 200)
or (api_check.msg|string is not search('^OK '))
or (api_check.json.success|bool != True)
when: (api_pre_check | succeeded)
when: (api_pre_check is succeeded)

- name: Destroy the last successful vagrant box
local_action: shell
Expand All @@ -79,7 +84,7 @@
when:
- (api_pre_check is succeeded) and (api_check is succeeded)
- ((ansible_virtualization | default(None) | lower) != "docker")
- (lookup('pipe','command -v vagrant') | search('vagrant$'))
- (lookup('pipe','command -v vagrant') is search('vagrant$'))

# We use YAML anchoring to duplicate this below
# because Ansible does not supported nested rescue.
Expand All @@ -101,7 +106,7 @@
poll: 0
when:
- ((ansible_virtualization | default(None) | lower) != "docker")
- (lookup('pipe','command -v vagrant') | search('vagrant$'))
- (lookup('pipe','command -v vagrant') is search('vagrant$'))
tags: check
# API BLOCK END

Expand Down
1 change: 1 addition & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ rocket_chat_dep_packages:
# This seems to install something on Docker that causes a failure in the tests
- cron
- gnupg2
- dirmngr

rocket_chat_mongodb_org_pkgs: true
rocket_chat_mongodb_apt_repo: "\
Expand Down
2 changes: 2 additions & 0 deletions vars/Debian_8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
rocket_chat_dist_specific_packages:
- nodejs
- npm

rocket_chat_mongodb_service_name: mongod
16 changes: 9 additions & 7 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ rocket_chat_mongodb_packages:
rocket_chat_mongodb_repl_setname: 001-rs
rocket_chat_mongodb_repl_lines: 'replSet={{ rocket_chat_mongodb_repl_setname }}'
rocket_chat_mongodb_fork: true
rocket_chat_mongodb_pidfile_path: /var/run/mongodb/mongodb.pid
rocket_chat_mongodb_pidfile_path: /var/run/mongodb/mongod.pid
rocket_chat_mongodb_logpath: /var/log/mongodb/mongod.log
rocket_chat_mongodb_unixsocketprefix: /var/run/mongodb
rocket_chat_mongodb_dbpath: /var/lib/mongodb
rocket_chat_mongodb_org_pkgs: false
rocket_chat_mongodb_dbpath: /var/lib/mongo
rocket_chat_mongodb_org_pkgs: true
rocket_chat_mongodb_service_name: mongod
rocket_chat_mongodb_service_user: mongod

rocket_chat_nginx_process_user: nginx

rocket_chat_mongodb_rpm_repo:
name: mongodb-org-3.4
desc: MongoDB 3.4 Repository
baseurl: https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/3.4/x86_64/
pgp_key: https://www.mongodb.org/static/pgp/server-3.4.asc
name: mongodb-org-4.4
desc: MongoDB 4.4 Repository
baseurl: https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.4/x86_64/
pgp_key: https://www.mongodb.org/static/pgp/server-4.4.asc
gpgcheck: true
7 changes: 7 additions & 0 deletions vars/RedHat_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@ rocket_chat_service_template_at:
src: rocketchat@.service.j2
dest: /usr/lib/systemd/system/rocketchat@.service
rocket_chat_tarball_validate_remote_cert: true
rocket_chat_epel_key: /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
rocket_chat_mongodb_rpm_repo:
name: mongodb-org-4.4
desc: MongoDB 4.4 Repository
baseurl: https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.4/x86_64/
pgp_key: https://www.mongodb.org/static/pgp/server-4.4.asc
gpgcheck: true
27 changes: 27 additions & 0 deletions vars/RedHat_8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
rocket_chat_service_update_command: systemctl daemon-reload
rocket_chat_service_template:
src: rocketchat.service.j2
dest: /usr/lib/systemd/system/rocketchat.service
rocket_chat_service_template_at:
src: rocketchat@.service.j2
dest: /usr/lib/systemd/system/rocketchat@.service
rocket_chat_tarball_validate_remote_cert: true
rocket_chat_epel_key: /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
rocket_chat_mongodb_rpm_repo:
name: mongodb-org-4.4
desc: MongoDB 4.4 Repository
baseurl: https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.4/x86_64/
pgp_key: https://www.mongodb.org/static/pgp/server-4.4.asc
gpgcheck: true
rocket_chat_dep_packages:
- git
- GraphicsMagick
- nodejs
- npm
- make
- gcc-c++
- wget
- crontabs
- gnupg2
rocket_chat_n_path: /usr/local/bin/n
1 change: 1 addition & 0 deletions vars/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rocket_chat_mongodb_apt_repo: "\
{{ ansible_distribution_release | lower }}/mongodb-org/\
{{ rocket_chat_mongodb_org_version }} multiverse"

rocket_chat_mongodb_service_name: mongod
rocket_chat_mongodb_packages:
- mongodb
- mongodb-server
Expand Down
7 changes: 0 additions & 7 deletions vars/Ubuntu_14.yml

This file was deleted.

1 change: 1 addition & 0 deletions vars/Ubuntu_18.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
rocket_chat_mongodb_org_pkgs: false
rocket_chat_mongodb_service_name: mongodb
12 changes: 12 additions & 0 deletions vars/Ubuntu_20.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
rocket_chat_mongodb_org_pkgs: false
rocket_chat_dep_packages:
- git
- graphicsmagick
- nodejs
- make
- wget
- cron
- gnupg2
- g++
rocket_chat_mongodb_service_name: mongodb