|
15 | 15 | path: /etc/systemd/system/opendistro.service |
16 | 16 | state: absent |
17 | 17 |
|
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 |
| 18 | +- name: Enumerate files in data directory |
| 19 | + find: |
| 20 | + path: "{{ opensearch_data_path }}" |
| 21 | + register: _find_opensearch_data |
| 22 | + |
| 23 | +- name: Archive incorrectly indexed data |
| 24 | + import_tasks: archive_data.yml |
| 25 | + when: |
| 26 | + - _find_opensearch_data.files | length > 0 |
| 27 | + - "'slurm_jobid_index' not in _find_opensearch_data.files | map(attribute='path') | map('basename')" |
26 | 28 |
|
27 | 29 | - name: Ensure required opensearch host directories exist |
28 | 30 | file: |
|
35 | 37 | loop: |
36 | 38 | - "{{ opensearch_config_path }}" |
37 | 39 | - "{{ opensearch_data_path }}" |
38 | | - when: "'started' in opensearch_state" # don't run during image build |
| 40 | + |
| 41 | +- name: Set indexed data flag |
| 42 | + copy: |
| 43 | + dest: "{{ opensearch_data_path }}/slurm_jobid_index" |
| 44 | + content: | |
| 45 | + This is a flag file to indicate that filebeat is pushing data |
| 46 | + indexed by Slurm JobID to prevent duplicate OpenSearch records |
| 47 | + owner: "{{ opensearch_podman_user }}" |
| 48 | + group: "{{ opensearch_podman_user }}" |
39 | 49 |
|
40 | 50 | - name: Create certs |
41 | 51 | import_tasks: certs.yml |
42 | | - when: "'started' in opensearch_state" # don't run during image build |
43 | 52 |
|
44 | 53 | - name: Template general configuration |
45 | 54 | ansible.builtin.template: |
|
52 | 61 | mode: 0660 |
53 | 62 | notify: Restart opensearch service |
54 | 63 | become: true |
55 | | - when: "'started' in opensearch_state" # don't run during image build |
56 | 64 |
|
57 | 65 | - name: Template internal user configuration |
58 | 66 | template: |
|
65 | 73 | mode: 0660 |
66 | 74 | notify: Restart opensearch service |
67 | 75 | become: true |
68 | | - when: "'started' in opensearch_state" # don't run during image build |
69 | 76 |
|
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 |
| 77 | +- name: Pull container |
| 78 | + containers.podman.podman_image: |
| 79 | + name: "opensearchproject/opensearch:{{ opensearch_version }}" |
| 80 | + become_user: "{{ opensearch_podman_user }}" |
76 | 81 |
|
77 | 82 | - name: Flush handlers |
78 | 83 | meta: flush_handlers |
|
0 commit comments