list/http_post: adds http post distribution lists
This commit is contained in:
parent
218779bd20
commit
21f7cbddcb
3 changed files with 38 additions and 0 deletions
33
app/terraform/list/http_post.py
Normal file
33
app/terraform/list/http_post.py
Normal 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 %}
|
||||
"""
|
Loading…
Add table
Add a link
Reference in a new issue