From 257faf11c58b9d603ecfad835d89ce3ddf863cec Mon Sep 17 00:00:00 2001 From: Tobias Lehmann Date: Mon, 21 Jul 2025 09:16:14 +0200 Subject: [PATCH] added samba share --- inventory/hosts.yml | 2 + playbooks/lehmann-samba-public.yml | 63 ++++++++++++++++++++ templates/samba-public/.env.j2 | 0 templates/samba-public/docker-compose.yml.j2 | 25 ++++++++ 4 files changed, 90 insertions(+) create mode 100644 playbooks/lehmann-samba-public.yml create mode 100644 templates/samba-public/.env.j2 create mode 100644 templates/samba-public/docker-compose.yml.j2 diff --git a/inventory/hosts.yml b/inventory/hosts.yml index c77586f..9f53718 100644 --- a/inventory/hosts.yml +++ b/inventory/hosts.yml @@ -28,5 +28,7 @@ all: ansible_host: 192.168.110.20 urbackup: ansible_host: 192.168.110.21 + samba-public: + ansible_host: 192.168.110.112 llama01: ansible_host: 192.168.130.52 diff --git a/playbooks/lehmann-samba-public.yml b/playbooks/lehmann-samba-public.yml new file mode 100644 index 0000000..aea523c --- /dev/null +++ b/playbooks/lehmann-samba-public.yml @@ -0,0 +1,63 @@ +# +# +# Automated installation for bankmanager +# +# Project: playbooks +# Author: Tobias Lehmann +# License: MIT License (see LICENSE.md) +# +# Copyright (c) captica GmbH est. 2021 +# +- hosts: "leh01" + name: Create container + vars: + lxc_id: 112 + lxc_name: samba-public + lxc_domain: leh01.local + lxc_template: "local:vztmpl/debian-12-standard_12.2-1_amd64.tar.zst" + lxc_mac: CC:CC:CC:11:01:12 + lxc_bridge: vmbr110 + lxc_vlan: "" + lxc_disk: datapool:16 + lxc_cpu: 2 + lxc_memory: 2048 + lxc_swap: 1024 + lxc_ssh_pub_key: ~/.ssh/id_ed25519_ansible.pub + roles: + - lxc-container + +- hosts: "samba-public" + vars: + hostname: samba-public + tools_install_users: + - root + - ansible + ssh_pubkeys_root: + - "../files/ssh/root.pub" + ssh_pubkeys_ansible: + - "../files/ssh/id_ed25519_ansible.pub" + roles: + - linux-base-install + - zsh + - vim + - fzf + - linux-docker + +- hosts: "samba-public" + tags: + - samba-public + - install + vars: + service_name: samba-public + service_directory: /opt/samba-public + service_volume_dirs: + - appdata + - db + service_user_name: samba-public + service_user_id: 1020 + service_group_name: samba-public + service_group_id: 1020 + bankmanager_version: latest + tasks: + - name: "Install samba-public application" + include_tasks: setup-docker-application.yml \ No newline at end of file diff --git a/templates/samba-public/.env.j2 b/templates/samba-public/.env.j2 new file mode 100644 index 0000000..e69de29 diff --git a/templates/samba-public/docker-compose.yml.j2 b/templates/samba-public/docker-compose.yml.j2 new file mode 100644 index 0000000..dd5a6df --- /dev/null +++ b/templates/samba-public/docker-compose.yml.j2 @@ -0,0 +1,25 @@ +services: + samba-public: + image: dperson/samba + container_name: samba-public + restart: always + ports: + - "445:445" # Optional: 139:139 for SMB over NetBIOS + volumes: + - ./shared:/mount/shared + networks: + - default + command: > + -s "public;/mount/shared;yes;no;yes;all;guest" + -u "nobody;guest" + -g "nobody" + -p + + +networks: + default: + ipam: + driver: default + config: + - subnet: 172.7.0.0/16 + gateway: 172.7.0.1 \ No newline at end of file