mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-07-27 00:05:44 +02:00
Update to 2022-08-19 16:00
This commit is contained in:
7
roles/linstor_satellite/tasks/conf.yml
Normal file
7
roles/linstor_satellite/tasks/conf.yml
Normal 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
|
||||
|
10
roles/linstor_satellite/tasks/directories.yml
Normal file
10
roles/linstor_satellite/tasks/directories.yml
Normal 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
|
||||
|
10
roles/linstor_satellite/tasks/facts.yml
Normal file
10
roles/linstor_satellite/tasks/facts.yml
Normal 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
|
20
roles/linstor_satellite/tasks/install.yml
Normal file
20
roles/linstor_satellite/tasks/install.yml
Normal 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
|
9
roles/linstor_satellite/tasks/iptables.yml
Normal file
9
roles/linstor_satellite/tasks/iptables.yml
Normal 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
|
||||
|
20
roles/linstor_satellite/tasks/main.yml
Normal file
20
roles/linstor_satellite/tasks/main.yml
Normal 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
|
7
roles/linstor_satellite/tasks/services.yml
Normal file
7
roles/linstor_satellite/tasks/services.yml
Normal 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
|
||||
|
Reference in New Issue
Block a user