Skip to content

Commit

Permalink
Merge pull request #58 from erikschaberg/10.1.0
Browse files Browse the repository at this point in the history
local frontends and mol 10.1.0
  • Loading branch information
erikschaberg authored Feb 10, 2023
2 parents 4cb920f + 57ccffb commit d60a510
Show file tree
Hide file tree
Showing 54 changed files with 3,231 additions and 136 deletions.
1 change: 0 additions & 1 deletion molgenis10/.yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ rules:
allowed-values: ['True', 'true', 'False', 'false', 'yes', 'no']
check-keys: true
level: warning

15 changes: 8 additions & 7 deletions molgenis10/galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,29 @@ namespace: molgenis
name: molgenis10

# The version of the collection. Must be compatible with semantic versioning
version: 10.0.6
version: 10.1.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md

# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- Erik Schaberg <[email protected]>
- Sido Haakma <[email protected]>
- Molgenis operations team <[email protected]>
- Erik Schaberg <[email protected]>
- Molgenis operations team <[email protected]>


### OPTIONAL but strongly recommended

# A short summary description of the collection
description: this collection contains roles and playbooks to roll-out and update a Molgenis instance in your own infrastructure (see https://www.molgenis.org)
description: >
this collection contains roles and playbooks to roll-out and update a Molgenis instance
in your own infrastructure (see https://www.molgenis.org)
# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
license:
- GPL-2.0-or-later
- GPL-2.0-or-later

# The path to the license file for the collection. This path is relative to the root of the collection. This key is
# mutually exclusive with 'license'
Expand All @@ -50,7 +51,7 @@ dependencies: {}
repository: https://github.com/molgenis/

# The URL to any online docs
documentation: https://www.molgenis.org/learn.html
documentation: https://www.molgenis.org/learn.html

# The URL to the homepage of the collection/project
homepage: https://molgenis.org
Expand Down
4 changes: 2 additions & 2 deletions molgenis10/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
vars:
host_group: "all"
experimental: false
ci: false
minio:
access_key: molgenis
secret_key: molgenis
port: 9000
host: http://localhost
molgenis:
setup: true
version: 10.0.4
version: 10.1.0
ssh: true

roles:
Expand All @@ -36,6 +35,7 @@
- role: molgenis_user
- role: molgenis_application
- role: nginx
- role: nodejs

# additional configuration
- role: python
Expand Down
25 changes: 16 additions & 9 deletions molgenis10/playbook_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
host_group: "all"
molgenis:
setup: true
version: 10.0.4
version: 10.1.0

tasks:
- name: Gathering package facts
package_facts:
ansible.builtin.package_facts:
manager: auto

- name: Check if war of correct version is present
Expand All @@ -36,8 +36,8 @@
state: absent
path: "{{ item }}"
with_items:
- /usr/share/tomcat/webapps/ROOT.war
- /usr/local/share/molgenis/war/ROOT.war
- /usr/share/tomcat/webapps/ROOT.war
- /usr/local/share/molgenis/war/ROOT.war
when:
- '"molgenis" in ansible_facts.packages'

Expand All @@ -56,16 +56,18 @@
mode: '0775'
when: war_version.stat.isreg is not defined

- name: install war MOLGENIS
- name: Install war MOLGENIS
ansible.builtin.get_url:
url: https://registry.molgenis.org/repository/maven-public/org/molgenis/molgenis-app/{{ molgenis.version }}/molgenis-app-{{ molgenis.version }}.war
url: >
https://registry.molgenis.org/repository/maven-public/org/molgenis/molgenis-app/{{
molgenis.version }}/molgenis-app-{{ molgenis.version }}.war
mode: '0660'
owner: molgenis
group: molgenis
dest: /usr/local/share/molgenis/war/
when: war_version.stat.isreg is not defined

- name: create symbolic link
- name: Create symbolic link
ansible.builtin.file:
src: /usr/local/share/molgenis/war/molgenis-app-{{ molgenis.version }}.war
dest: /usr/share/tomcat/webapps/ROOT.war
Expand All @@ -74,19 +76,24 @@
state: link
when: war_version.stat.isreg is not defined

- name: role nginx
- name: Role nginx
ansible.builtin.include_role:
name: nginx
when: war_version.isreg is not defined

- name: Role nodejs
ansible.builtin.include_role:
name: nodejs
when: war_version.isreg is not defined

- name: Start elasticsearch
ansible.builtin.systemd:
name: elasticsearch
state: started
when: war_version.isreg is not defined

- name: Start tomcat
systemd:
ansible.builtin.systemd:
name: tomcat
state: started
when: war_version.isreg is not defined
32 changes: 19 additions & 13 deletions molgenis10/playbook_upgrade_from_9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@
become: true
vars:
host_group: "all"
ci: false
molgenis:
setup: true
version: 10.0.4
version: 10.1.0

tasks:
- name: Gathering package facts
package_facts:
ansible.builtin.package_facts:
manager: auto

- name: clear versionlocks
- name: Clear versionlocks
ansible.builtin.command: yum versionlock clear
args:
warn: false # set warn=false to prevent warning about better using yum module
changed_when: false
when:
when:
- war_version.stat.isreg is not defined
- ansible_os_family == 'RedHat'

Expand All @@ -34,7 +33,7 @@
name: tomcat
state: stopped
when: war_version.stat.isreg is not defined

- name: Remove elastic indexes before upgrade to elastic 7
ansible.builtin.uri:
url: http://localhost:9200/*
Expand All @@ -53,20 +52,20 @@
path: "/var/lib/elasticsearch/nodes"
when: war_version.stat.isreg is not defined

- name: remove old elastic 5.6 rpm
- name: Remove old elastic 5.6 rpm
ansible.builtin.yum:
state: absent
name: elasticsearch
when:
when:
- war_version.stat.isreg is not defined
- ansible_os_family == 'RedHat'

- name: purge old elastic 5.6 package
- name: Purge old elastic 5.6 package
ansible.builtin.apt:
state: absent
purge: yes
name: elasticsearch
when:
when:
- war_version.stat.isreg is not defined
- ansible_os_family == 'Debian'

Expand Down Expand Up @@ -98,16 +97,18 @@
mode: '0775'
when: war_version.stat.isreg is not defined

- name: install war MOLGENIS
- name: Install war MOLGENIS
ansible.builtin.get_url:
url: https://registry.molgenis.org/repository/maven-public/org/molgenis/molgenis-app/{{ molgenis.version }}/molgenis-app-{{ molgenis.version }}.war
url: >
https://registry.molgenis.org/repository/maven-public/org/molgenis/molgenis-app/{{
molgenis.version }}/molgenis-app-{{ molgenis.version }}.war
mode: '0660'
owner: molgenis
group: molgenis
dest: /usr/local/share/molgenis/war/
when: war_version.stat.isreg is not defined

- name: create symbolic link
- name: Create symbolic link
ansible.builtin.file:
src: /usr/local/share/molgenis/war/molgenis-app-{{ molgenis.version }}.war
dest: /usr/share/tomcat/webapps/ROOT.war
Expand All @@ -128,6 +129,11 @@
state: started
when: war_version.stat.isreg is not defined

- name: NodeJs role
ansible.builtin.include_role:
name: nodejs
when: war_version.stat.isreg is not defined

- name: Nginx role
ansible.builtin.include_role:
name: nginx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
# node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
Expand All @@ -40,7 +40,7 @@ path.logs: /var/log/elasticsearch
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
# bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
Expand All @@ -53,12 +53,12 @@ path.logs: /var/log/elasticsearch
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
#network.host: 192.168.0.1
# network.host: 192.168.0.1
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
#http.port: 9200
# http.port: 9200
#
# For more information, consult the network module documentation.
#
Expand All @@ -67,17 +67,17 @@ path.logs: /var/log/elasticsearch
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
# discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
# cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
# action.destructive_requires_name: true
discovery.type: single-node
3 changes: 1 addition & 2 deletions molgenis10/roles/elasticsearch_7/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
- name: restart elasticsearch service
- name: Restart elasticsearch service
ansible.builtin.systemd:
name: elasticsearch
state: restarted
enabled: yes
listen: "restart elasticsearch"
when: not ci|bool
19 changes: 19 additions & 0 deletions molgenis10/roles/elasticsearch_7/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
galaxy_info:
role_name: elasticsearch_7
author: Erik Schaberg
description: this role is part of the Molgenis installation
company: UMCG/RUG
license: license (GPLv3)
min_ansible_version: 2.7.9
platforms:
- name: EL
versions:
- "8"
- "7"
- name: Ubuntu
versions:
- "focal"
- "jammy"
galaxy_tags: [molgenis]
dependencies: []
4 changes: 2 additions & 2 deletions molgenis10/roles/elasticsearch_7/tasks/debian.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Add elastic repo key
apt_key:
ansible.builtin.apt_key:
url: https://artifacts.elastic.co/GPG-KEY-elasticsearch
state: present

Expand All @@ -14,4 +14,4 @@
ansible.builtin.apt:
pkg:
- elasticsearch
update_cache: yes
update_cache: yes
4 changes: 1 addition & 3 deletions molgenis10/roles/elasticsearch_7/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,9 @@
state: present
reload: yes
notify: "restart elasticsearch"
when: not ci|bool

- name: start elasticsearch service
- name: Start elasticsearch service
ansible.builtin.systemd:
name: elasticsearch
state: started
enabled: yes
when: not ci|bool
2 changes: 1 addition & 1 deletion molgenis10/roles/minio/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: restart Minio
- name: Restart Minio
ansible.builtin.systemd:
name: minio
state: restarted
Expand Down
3 changes: 2 additions & 1 deletion molgenis10/roles/minio/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ galaxy_info:
- "7"
- name: Ubuntu
versions:
- focal
- "focal"
- "jammy"
galaxy_tags: [molgenis]
dependencies: []
Loading

0 comments on commit d60a510

Please sign in to comment.