list/http_post: adds http post distribution lists

This commit is contained in:
Iain Learmonth 2022-11-08 14:31:45 +00:00
parent 218779bd20
commit 21f7cbddcb
3 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,33 @@
from app.terraform.list import ListAutomation
class ListHttpPostAutomation(ListAutomation):
short_name = "list_http_post"
description = "Update mirror lists by HTTP POST"
provider = "http_post"
template_parameters = []
template = """
terraform {
{{ backend_config }}
required_providers {
http = {
version = "~> 3.2.0"
}
}
}
{% for list in lists %}
data "http" "post_{{ list.id }}" {
url = "{{ list.container }}"
method = "POST"
request_body = file("{{ list.format }}.{{ list.pool.pool_name }}.{{ list.encoding }}")
request_headers = {
Update-Key = "{{ list.filename }}"
}
}
{% endfor %}
"""