diff --git a/app/routes/api.py b/app/routes/api.py
index 2a398f2..a610150 100644
--- a/app/routes/api.py
+++ b/app/routes/api.py
@@ -1,6 +1,7 @@
-from flask import Blueprint
+from flask import Blueprint, render_template
from app.models import Operation
from app.library.cache import cache
+from app import config
bp = Blueprint('api', 'api')
@@ -13,3 +14,14 @@ def get_info(codename):
return cache.get_info(op.codename)
else:
return {}
+
+@bp.route('/api/export/ansible')
+def export_ansible():
+ ops = Operation.query.filter(
+ Operation.droplet_id > 0
+ )
+ return render_template(
+ 'export_ansible.html',
+ ops=ops,
+ domain=config.DO_DOMAIN
+ )
diff --git a/app/templates/export_ansible.html b/app/templates/export_ansible.html
new file mode 100644
index 0000000..1b6e78d
--- /dev/null
+++ b/app/templates/export_ansible.html
@@ -0,0 +1,9 @@
+[xmrcannon]
+
+{% for op in ops %}
+{{ op.codename }}.{{ domain }}
+{% endfor %}
+
+[xmrcannon:vars]
+
+ansible_ssh_user=root