UNCLASSIFIED

Skip to content
Snippets Groups Projects
Commit b4769c21 authored by John Ward's avatar John Ward
Browse files

Initial Commit of Opensearch 2.2.0 formula

parent c190f719
Branches main
No related merge requests found
## Copyright 2022 United States Amry Cyber School
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
create openseach network:
cmd.run:
- name: podman network create opensearch-net
- unless:
- podman network ls -a | grep -q opensearch-net
create opensearch container:
cmd.run:
- name: podman create -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" --network opensearch-net -h opensearch --name opensearch docker.io/opensearchproject/opensearch:2.2.0
- unless:
- podman container ls -a | grep -q opensearch
/etc/systemd/system/opensearch-container.service:
file.managed:
- source: salt://formulas/opensearch/files/container.j2
- mode: "0644"
- template: jinja
- defaults:
container: "opensearch"
- require:
- cmd: create opensearch container
module.run:
- name: service.systemctl_reload
opensearch-container:
service.running:
- enable: True
- require:
- file: /etc/systemd/system/opensearch-container.service
- watch:
- file: /etc/systemd/system/opensearch-container.service
create opensearch-dashboard container:
cmd.run:
- name: podman create -p 5601:5601 --name opensearch-dashboard -e 'OPENSEARCH_HOSTS=["https://172.17.3.5:9200"]' --network opensearch-net docker.io/opensearchproject/opensearch-dashboards:2.2.0
- unless:
- podman container ls -a | grep -q opensearch-dashboard
/etc/systemd/system/opensearch-dashboard-container.service:
file.managed:
- source: salt://formulas/opensearch/files/container.j2
- mode: "0644"
- template: jinja
- defaults:
container: "opensearch-dashboard"
- require:
- cmd: create opensearch-dashboard container
module.run:
- name: service.systemctl_reload
opensearch-dashboard-container:
service.running:
- enable: True
- require:
- file: /etc/systemd/system/opensearch-dashboard-container.service
- watch:
- file: /etc/systemd/system/opensearch-dashboard-container.service
\ No newline at end of file
[Unit]
Description={{ container }} Container
After=network-online.target
Wants=network-online.target
[Service]
Restart=always
ExecStart=/usr/bin/podman start -a {{ container }}
ExecStop=/usr/bin/podman stop -t 2 {{ container }}
[Install]
WantedBy=multi-user.target
\ No newline at end of file
## Copyright 2022 United States Amry Cyber School
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
{% elif grains['os_family'] in ('RedHat', 'Rocky') %}
opensearch-packages:
pkg.installed:
- pkgs:
- podman
- reload_modules: True
{% endif %}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment