Update Dockerfile.ansible — container web UI with JSON/MD/PDF export
This commit is contained in:
+14
-4
@@ -67,7 +67,8 @@ RUN pip3 install --no-cache-dir --break-system-packages \
|
||||
xmltodict>=0.13 \
|
||||
pyyaml>=6.0 \
|
||||
cryptography>=41.0 \
|
||||
packaging
|
||||
packaging \
|
||||
fpdf2>=2.7
|
||||
|
||||
# ── Ansible collections ──────────────────────────────────
|
||||
RUN ansible-galaxy collection install \
|
||||
@@ -113,6 +114,11 @@ control_path = /tmp/ansible-%%h-%%p-%%r' \
|
||||
RUN mkdir -p /ansible/playbooks /ansible/inventory
|
||||
WORKDIR /ansible
|
||||
|
||||
# ── Container web UI (JSON / Markdown / PDF export) ──────
|
||||
COPY webui/container-app.py /usr/local/bin/container-webui.py
|
||||
COPY reports/render_report.py /ansible/reports/render_report.py
|
||||
RUN chmod +x /usr/local/bin/container-webui.py
|
||||
|
||||
# ── Default inventory (placeholder) ───────────────────────
|
||||
RUN printf '[windows]\n\
|
||||
[cisco_asa]\n\
|
||||
@@ -126,6 +132,10 @@ RUN printf '[windows]\n\
|
||||
ansible_user=ansible\n' \
|
||||
> /ansible/inventory/inventory.ini
|
||||
|
||||
# ── Entrypoint: run ansible-playbook by default ───────────
|
||||
ENTRYPOINT ["ansible-playbook"]
|
||||
CMD ["--help"]
|
||||
# ── Entrypoint: web UI by default, ansible-playbook if args ─
|
||||
# docker run -p 8080:8080 ansible-node → web UI
|
||||
# docker run ansible-node site.yml -i hosts → ansible-playbook
|
||||
COPY scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
CMD []
|
||||
|
||||
Reference in New Issue
Block a user