Update Dockerfile.ansible — container web UI with JSON/MD/PDF export
This commit is contained in:
+17
-7
@@ -67,7 +67,8 @@ RUN pip3 install --no-cache-dir --break-system-packages \
|
|||||||
xmltodict>=0.13 \
|
xmltodict>=0.13 \
|
||||||
pyyaml>=6.0 \
|
pyyaml>=6.0 \
|
||||||
cryptography>=41.0 \
|
cryptography>=41.0 \
|
||||||
packaging
|
packaging \
|
||||||
|
fpdf2>=2.7
|
||||||
|
|
||||||
# ── Ansible collections ──────────────────────────────────
|
# ── Ansible collections ──────────────────────────────────
|
||||||
RUN ansible-galaxy collection install \
|
RUN ansible-galaxy collection install \
|
||||||
@@ -113,11 +114,16 @@ control_path = /tmp/ansible-%%h-%%p-%%r' \
|
|||||||
RUN mkdir -p /ansible/playbooks /ansible/inventory
|
RUN mkdir -p /ansible/playbooks /ansible/inventory
|
||||||
WORKDIR /ansible
|
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) ───────────────────────
|
# ── Default inventory (placeholder) ───────────────────────
|
||||||
RUN printf '[windows]\n\
|
RUN printf '[windows]\n\
|
||||||
[cisc o_asa]\n\
|
[cisco_asa]\n\
|
||||||
[cisc o_ios]\n\
|
[cisco_ios]\n\
|
||||||
[cisc o_nxos]\n\
|
[cisco_nxos]\n\
|
||||||
[vmware]\n\
|
[vmware]\n\
|
||||||
[mssql]\n\
|
[mssql]\n\
|
||||||
[linux]\n\
|
[linux]\n\
|
||||||
@@ -126,6 +132,10 @@ RUN printf '[windows]\n\
|
|||||||
ansible_user=ansible\n' \
|
ansible_user=ansible\n' \
|
||||||
> /ansible/inventory/inventory.ini
|
> /ansible/inventory/inventory.ini
|
||||||
|
|
||||||
# ── Entrypoint: run ansible-playbook by default ───────────
|
# ── Entrypoint: web UI by default, ansible-playbook if args ─
|
||||||
ENTRYPOINT ["ansible-playbook"]
|
# docker run -p 8080:8080 ansible-node → web UI
|
||||||
CMD ["--help"]
|
# 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