Skip to content

Commit 2aa0706

Browse files
committed
break opensearch into install and runtime task books
1 parent 3dfe924 commit 2aa0706

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

ansible/fatimage.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
tasks_from: vnc_compute.yml
6060

6161
# - import_playbook: monitoring.yml:
62+
- import_role:
63+
name: opensearch
64+
tasks_from: install.yml
65+
become: true
66+
6267
# opensearch - containerised, nothing to do
6368
# slurm_stats - nothing to do
6469
# filebeat - containerised - nothing to do

ansible/monitoring.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
tasks:
88
- import_role:
99
name: opensearch
10+
tasks_from: install.yml
11+
become: true
12+
- import_role:
13+
name: opensearch
14+
tasks_from: runtime.yml
1015
become: true
1116

1217
- name: Setup slurm stats
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# safe to use during build
2+
3+
- name: Increase maximum number of virtual memory maps
4+
# see https://opensearch.org/docs/2.0/opensearch/install/important-settings/
5+
ansible.posix.sysctl:
6+
name: vm.max_map_count
7+
value: '262144'
8+
state: present
9+
reload: yes
10+
11+
- name: Create systemd unit file
12+
template:
13+
dest: /etc/systemd/system/opensearch.service
14+
src: opensearch.service.j2
15+
notify: Restart opensearch service

ansible/roles/opensearch/tasks/main.yml renamed to ansible/roles/opensearch/tasks/runtime.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@
1515
path: /etc/systemd/system/opendistro.service
1616
state: absent
1717

18-
- name: Increase maximum number of virtual memory maps
19-
# see https://opensearch.org/docs/2.0/opensearch/install/important-settings/
20-
ansible.posix.sysctl:
21-
name: vm.max_map_count
22-
value: '262144'
23-
state: present
24-
reload: yes
25-
become: true
26-
2718
- name: Ensure required opensearch host directories exist
2819
file:
2920
state: directory
@@ -35,11 +26,9 @@
3526
loop:
3627
- "{{ opensearch_config_path }}"
3728
- "{{ opensearch_data_path }}"
38-
when: "'started' in opensearch_state" # don't run during image build
3929

4030
- name: Create certs
4131
import_tasks: certs.yml
42-
when: "'started' in opensearch_state" # don't run during image build
4332

4433
- name: Template general configuration
4534
ansible.builtin.template:
@@ -52,7 +41,6 @@
5241
mode: 0660
5342
notify: Restart opensearch service
5443
become: true
55-
when: "'started' in opensearch_state" # don't run during image build
5644

5745
- name: Template internal user configuration
5846
template:
@@ -65,19 +53,10 @@
6553
mode: 0660
6654
notify: Restart opensearch service
6755
become: true
68-
when: "'started' in opensearch_state" # don't run during image build
69-
70-
- name: Create systemd unit file
71-
template:
72-
dest: /etc/systemd/system/opensearch.service
73-
src: opensearch.service.j2
74-
become: true
75-
notify: Restart opensearch service
7656

7757
- name: Pull container
7858
containers.podman.podman_image:
7959
name: "opensearchproject/opensearch:{{ opensearch_version }}"
80-
become: true
8160
become_user: "{{ opensearch_podman_user }}"
8261

8362
- name: Flush handlers

0 commit comments

Comments
 (0)