Update to 2022-08-19 16:00

This commit is contained in:
Daniel Berteaud
2022-08-19 16:00:17 +02:00
parent 6ebee1169f
commit f17ab3267b
50 changed files with 516 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
---
# Port on which the satellite will listen
linsat_api_port: 3366
# URL of the linstor-controller API (you can set several and they will be tried in order)
linsat_controllers_url:
- http://localhost:3370
# List of IP/CIDR which can reach the API of the satellite (only Linstor controller should reach it)
linsat_api_src_ip: []
# HA NFS Service
linsat_nfs_src_ip: []
# HA iSCSI Service
linsat_iscsi_src_ip: []
# Version of linstor-gateway to install
linsat_gateway_version: 0.13.1
# URL where linstor-gateway will be downloaded
linsat_gateway_url: https://github.com/LINBIT/linstor-gateway/releases/download/v{{ linsat_gateway_version }}/linstor-gateway-linux-amd64
# Expected sha256 of the binary
linsat_gateway_sha256: 83d4d13154caeee79a0bec01db4a571cc417301fc001eb0ee9a6210279201934

View File

@@ -0,0 +1,6 @@
---
- name: restart linstor-satellite
service: name=linstor-satellite state=restarted
when: not linsat_started

View File

@@ -0,0 +1,4 @@
---
dependencies:
- role: drbd

View File

@@ -0,0 +1,7 @@
---
- name: Configure linstor-satellite
template: src=linstor_satellite.toml.j2 dest=/etc/linstor/linstor_satellite.toml
notify: restart linstor-satellite
tags: drbd

View File

@@ -0,0 +1,10 @@
---
- name: Create linstor-satellite unit snippet dir
file: path=/etc/systemd/system/linstor-satellite.service.d state=directory
tags: drbd
- name: Create linstor conf dir
file: path=/etc/linstor state=directory
tags: drbd

View File

@@ -0,0 +1,10 @@
---
# Load distribution specific variables
- include_vars: "{{ item }}"
with_first_found:
- "{{ role_path }}/vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_distribution }}.yml"
- "{{ role_path }}/vars/{{ ansible_os_family }}.yml"
tags: drbd

View File

@@ -0,0 +1,20 @@
---
- name: Install packages
package: name={{ linsat_packages }}
tags: drbd
- name: Customize satellite service
copy:
content: |
[Service]
Type=notify
dest: /etc/systemd/system/linstor-satellite.service.d/99-ansible.conf
notify: restart linstor-satellite
register: linsat_unit
tags: drbd
- name: Reload systemd
systemd: daemon_reload=True
when: linsat_unit.changed
tags: drbd

View File

@@ -0,0 +1,9 @@
---
- name: Handle API ports
iptables_raw:
name: linsat_api_port
state: "{{ (linsat_api_src_ip | length > 0) | ternary('present','absent') }}"
rules: "-A INPUT -m state --state NEW -p tcp --dport {{ linsat_api_port }} -s {{ linsat_api_src_ip | join(',') }} -j ACCEPT"
tags: firewall,drbd

View File

@@ -0,0 +1,20 @@
---
- include_tasks: directories.yml
tags: always
- include_tasks: facts.yml
tags: always
- include_tasks: install.yml
tags: always
- include_tasks: conf.yml
tags: always
- include_tasks: iptables.yml
when: iptables_manage | default(True)
tags: always
- include_tasks: services.yml
tags: always

View File

@@ -0,0 +1,7 @@
---
- name: Start and enable the linstor-satellite
service: name=linstor-satellite state=started enabled=True
register: linsat_started
tags: drbd

View File

@@ -0,0 +1,8 @@
[Unit]
Description=Reload drbd-reactor on plugin changes
[Path]
PathChanged=/etc/drbd-reactor.d
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Reload drbd-reactor on plugin changes
After=drbd-reactor.service
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl reload drbd-reactor.service
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,9 @@
[Unit]
Description=LINSTOR Gateway
After=network.target
[Service]
ExecStart=/usr/local/bin/linstor-gateway server --addr ":8080"
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,6 @@
[linstor]
controllers = [
{% for url in linsat_controllers_url %}
"{{ url }}"
{% endfor %}
]

View File

@@ -0,0 +1,11 @@
[netcom]
type = "plain"
bind_address = "0.0.0.0"
port = {{ linsat_api_port }}
[files]
allowExtFiles = [
"/etc/systemd/system",
"/etc/systemd/system/linstor-satellite.service.d",
"/etc/drbd-reactor.d"
]

View File

@@ -0,0 +1,5 @@
---
linsat_packages:
- linstor-satellite
- lvm2