Skip to content

Commit

Permalink
Merge branch 'main' of gitlab.taurusgroup.one:clustervision/trinityx-…
Browse files Browse the repository at this point in the history
…combined into main
  • Loading branch information
aphmschonewille committed Mar 29, 2024
2 parents 716dc26 + 0419f31 commit f218db1
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 43 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In standard configuration TrinityX provides the following services to the cluste
* Luna, our default super-efficient node provisioner
* OpenLDAP
* SLURM or OpenPBS
* Telegraf, InfluxDB, Grafana and Sensu Core
* Prometheus and Grafana
* Infrastructure services such as NTP, DNS, DHCP
* and more

Expand All @@ -27,6 +27,7 @@ It will also set up:
* OpenHPC applications and libraries
* environment modules
* rsyslog
* High Availability
* and more

.. image:: img/triX_300.png
Expand Down
32 changes: 27 additions & 5 deletions site/roles/trinity/luna2/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,34 @@
mode: '0600'
ignore_errors: true

- name: Set me as Luna master
shell: "/usr/sbin/lmaster -s"
ignore_errors: true
# -------------- H/A stuff ------------------

- name: Render /etc/systemd/system/luna2-master.service
copy:
src: 'luna2-master.service'
dest: '/etc/systemd/system/luna2-master.service'
owner: root
group: root
mode: 0644
when: ha | default(False)

- block:
- name: Set me as Luna master
shell: "/usr/sbin/lmaster -s"
ignore_errors: true

- name: Add luna2 master systemd service
pcs_resource:
name: 'luna2-master'
resource_type: 'systemd:luna2-master.service'
options: 'op monitor interval=29s --group Trinity-stack'
state: present
tags: pcs
when:
- ha
- primary
- ha | default(False)
- primary | default(True)

# ------------------------------------------

- name: Setting default DNS forwarder
shell: "luna cluster change -fs \"{{ trix_dns_forwarders|join(',') }}\""
Expand Down
3 changes: 0 additions & 3 deletions site/roles/trinity/pacemaker/files/lmaster

This file was deleted.

33 changes: 6 additions & 27 deletions site/roles/trinity/pacemaker/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,12 @@
template:
src: "corosync.conf.j2"
dest: "/etc/corosync/corosync.conf"
notify:
- restart corosync

- name: Restart corosync
service:
name: corosync
state: restarted
enabled: true

# TODO: better way than below
- name: Install PCS
Expand Down Expand Up @@ -155,14 +159,6 @@

# ---------------------- resources and config ----------------

- name: Render /etc/systemd/system/luna2-master.service
copy:
src: 'luna2-master.service'
dest: '/etc/systemd/system/luna2-master.service'
owner: root
group: root
mode: 0644

- block:
- name: Set pacemaker properties
pcs_property:
Expand All @@ -184,23 +180,6 @@
resource_type: 'ocf:heartbeat:IPaddr2'
options: 'ip={{ trix_ctrl_ip }} nic={{ trix_ctrl_interface }} cidr_netmask={{ trix_cluster_netprefix }} op monitor interval=29s --group Trinity'
state: present

- name: Render temporary dummy lmaster script
copy:
src: 'lmaster'
dest: '/usr/sbin/lmaster'
owner: root
group: root
mode: 0755
force: no
ignore_errors: true

- name: Add luna2 master systemd service
pcs_resource:
name: 'luna2-master'
resource_type: 'systemd:luna2-master.service'
options: 'op monitor interval=29s --group Trinity'
state: present
when: primary

# --------------------- fencing ----------------------------
Expand Down
7 changes: 6 additions & 1 deletion site/roles/trinity/shared-fs/files/lvm-fixes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ if [ ! "$LVM_DISKS" ] && [ ! "$VGROUPS" ]; then
fi
find /dev -type l -exec echo -n {}'=' \; -exec readlink -f {} \; > /tmp/dev-links.dat

FILTER="["
# Default is empty filter, but we have seen sometimes partlabel causing issues
# where the kernel sees it at a later point, after this script ran.
# we assume(!) that no-one is using a disk by /dev/disk/by-partlabel/primary
# and therefor we block it from the get go.
# FILTER = "[ "
FILTER="[ \"r|/dev/disk/by-partlabel/primary|\","
for DISK in $LVM_DISKS; do
REAL_DISK=""
EXCL_LINK=""
Expand Down
24 changes: 24 additions & 0 deletions site/roles/trinity/shared-fs/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
- debug:
msg: "{{ drbd_fs_disks }}"

- name: Gather the disks used for DRBD
stat:
path: "{{ item.disk }}"
with_items: "{{ drbd_fs_disks }}"
register: drbd_disks_stat

- name: Verify if requested disks exist
fail:
msg: "Disk {{ item.disk }} does not seem to exist. DRBD config cannot continue, but can be re-run after enabling the disk or changing the configuration."
with_items: "{{ drbd_disks_stat.results | rejectattr('stat.exists') | map(attribute='item') | list }}"
when: drbd_disks_stat is defined

- name: Configure DRBD
ansible.builtin.include_tasks:
file: drbd.yaml
Expand Down Expand Up @@ -71,6 +83,18 @@
- debug:
msg: "{{ direct_fs_disks }}"

- name: Gather the disks used for Direct
stat:
path: "{{ item.device }}"
with_items: "{{ direct_fs_disks }}"
register: direct_disks_stat

- name: Verify if requested devices exist
fail:
msg: "Disk {{ item.device }} does not seem to exist. Direct config cannot continue, but can be re-run after enabling the device or changing the configuration."
with_items: "{{ direct_disks_stat.results | rejectattr('stat.exists') | map(attribute='item') | list }}"
when: direct_disks_stat is defined

- name: Configure Direct attached disks
ansible.builtin.include_tasks:
file: direct.yaml
Expand Down
17 changes: 11 additions & 6 deletions site/roles/trinity/wrapup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@
ignore_errors: true
when: wrapup_fix_firewalld_zones_script.stat.exists

- name: set property 'standby' to 'absent' for non-primary node (unstandby)
pcs_property:
name: 'standby'
node: '{{ ansible_hostname }}'
state: 'absent'
ignore_errors: true
- block:
- name: set property 'standby' to 'absent' for non-primary node (unstandby)
pcs_property:
name: 'standby'
node: '{{ ansible_hostname }}'
state: 'absent'
ignore_errors: true

- name: Clear possible pacemaker dependency messages
shell: "pcs resource cleanup"
ignore_errors: true
tags: ha,pcs,pacemaker
when:
- ha
Expand Down

0 comments on commit f218db1

Please sign in to comment.