This repository has been archived on 2026-01-10. You can view files and clone it, but cannot push or open issues or pull requests.
coder-templates/splunk.tf.j2
Steve McMaster c99e2e9ed0
All checks were successful
continuous-integration/drone/push Build is passing
fix
2024-02-06 00:42:26 -05:00

79 lines
1.8 KiB
Django/Jinja

{% extends "base.tf.j2" %}
{% block coder_apps %}
resource "coder_app" "splunk" {
agent_id = coder_agent.main.id
display_name = "Splunk Web"
slug = "splunkweb"
icon = "https://s3.mcmaster.io/images/Splunk.webp"
url = "http://localhost:8000/"
subdomain = true
share = "public"
healthcheck {
url = "http://localhost:8000/en-US/config?autoload=1"
interval = 3
threshold = 10
}
}
{% endblock %}
{% block kubernetes_pod_main_env %}
env {
name = "SPLUNK_PASSWORD"
value = "Temp1234!"
}
env {
name = "SPLUNK_START_ARGS"
value = "--accept-license"
}
{{ super() }}
{% endblock %}
{% block kubernetes_pod_main_volume_mount %}
volume_mount {
mount_path = "/opt/splunk/etc"
name = "home"
read_only = false
}
{% endblock %}
{% block parameters %}
{{ super() }}
data "coder_parameter" "splunk_version" {
name = "Splunk Version"
description = "Splunk Version"
type = "string"
default = "{{ splunk_versions[-1] }}"
icon = "https://s3.mcmaster.io/images/Splunk.webp"
mutable = true
{% for version in splunk_versions %}
option {
name = "{{ version }}"
value = "{{ version }}"
}
{% endfor %}
}
{% endblock %}
{% block coder_scripts %}
{{ super() }}
resource "coder_script" "splunk_ansible" {
agent_id = coder_agent.main.id
display_name = "splunk_ansible"
run_on_start = true
run_on_stop = false
script = <<EOT
#!/bin/bash
sudo -E -u ansible /sbin/entrypoint.sh start-and-exit
EOT
}
{% endblock %}
{% block kubernetes_pod_main_image %}
image = "{{image}}:${data.coder_parameter.splunk_version.value}"
{% endblock %}