From 4a1088ec2eea335a672b538b08f5e20c6948c814 Mon Sep 17 00:00:00 2001 From: "Daniel A. Maierhofer" Date: Wed, 19 Sep 2018 12:08:26 +0200 Subject: [PATCH] Add samba server progress for scanner --- host_vars/ariane | 11 +++++++++++ host_vars/progress | 2 ++ hosts/production | 1 + roles/gitea/templates/gitea.conf.j2 | 2 ++ roles/scans/defaults/main.yml | 4 ++++ roles/scans/handlers/main.yml | 3 +++ roles/scans/tasks/main.yml | 3 +++ roles/scans/tasks/samba.yml | 17 +++++++++++++++++ roles/scans/templates/smb.conf.j2 | 26 ++++++++++++++++++++++++++ site.yml | 4 ++++ 10 files changed, 73 insertions(+) create mode 100644 host_vars/progress create mode 100644 roles/scans/defaults/main.yml create mode 100644 roles/scans/handlers/main.yml create mode 100644 roles/scans/tasks/main.yml create mode 100644 roles/scans/tasks/samba.yml create mode 100644 roles/scans/templates/smb.conf.j2 diff --git a/host_vars/ariane b/host_vars/ariane index 0d5b2c6..695c254 100644 --- a/host_vars/ariane +++ b/host_vars/ariane @@ -33,6 +33,17 @@ lxc: - lxc.network.hwaddr = 2e:6d:b6:07:15:01 - lxc.pts = 6 + - name: progress + revision: "01" + template: voidlinux + config: + - lxc.network.type = veth + - lxc.network.hwaddr = 2e:6d:b6:07:19:01 + - lxc.network.link = br0 + - lxc.network.flags = up + - lxc.pts = 6 + - lxc.mount.entry = /zv1/daten/Scans /var/lib/lxc/lxc-progress-01/rootfs/mnt/scans none bind,create=dir 0 0 + - name: sojus revision: "01" template: voidlinux diff --git a/host_vars/progress b/host_vars/progress new file mode 100644 index 0000000..fd4b7ce --- /dev/null +++ b/host_vars/progress @@ -0,0 +1,2 @@ +inventory_hostname: progress.fet.htu.tuwien.ac.at +inventory_hostname_short: progress diff --git a/hosts/production b/hosts/production index 834bc7b..9499faf 100644 --- a/hosts/production +++ b/hosts/production @@ -13,6 +13,7 @@ all: hosts: zyklon: sojus: + progress: fet_qemu: hosts: maria-storage: diff --git a/roles/gitea/templates/gitea.conf.j2 b/roles/gitea/templates/gitea.conf.j2 index e209bb0..5a52c17 100644 --- a/roles/gitea/templates/gitea.conf.j2 +++ b/roles/gitea/templates/gitea.conf.j2 @@ -1,3 +1,5 @@ +# {{ ansible_managed }} + ; App name that shows on every page title APP_NAME = FET-Gitea ; Change it if you run locally diff --git a/roles/scans/defaults/main.yml b/roles/scans/defaults/main.yml new file mode 100644 index 0000000..9d06c5f --- /dev/null +++ b/roles/scans/defaults/main.yml @@ -0,0 +1,4 @@ +--- +samba_users: + - name: dell + smbpasswd: delloscanner diff --git a/roles/scans/handlers/main.yml b/roles/scans/handlers/main.yml new file mode 100644 index 0000000..b90ebae --- /dev/null +++ b/roles/scans/handlers/main.yml @@ -0,0 +1,3 @@ +--- + - name: restart samba + service: name=smbd enabled=yes state=restarted diff --git a/roles/scans/tasks/main.yml b/roles/scans/tasks/main.yml new file mode 100644 index 0000000..d61bacc --- /dev/null +++ b/roles/scans/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- import_tasks: samba.yml + tags: [ samba ] diff --git a/roles/scans/tasks/samba.yml b/roles/scans/tasks/samba.yml new file mode 100644 index 0000000..6cb1881 --- /dev/null +++ b/roles/scans/tasks/samba.yml @@ -0,0 +1,17 @@ +--- +- name: samba - install + package: name={{ item }} + with_items: + - samba + +- name: samba - /etc/smb.conf + template: dest=/etc/smb.conf src=smb.conf.j2 owner=root group=root mode=0644 + notify: restart samba + +- name: samba - add smb users + user: "name={{ item['name'] }} shell=/bin/false" + with_items: '{{ samba_users }}' + +- name: samba - set smbpasswds + shell: "(echo {{ item['smbpasswd'] }}; echo {{ item['smbpasswd'] }}) | smbpasswd -s -a {{ item['name'] }}" + with_items: '{{ samba_users }}' diff --git a/roles/scans/templates/smb.conf.j2 b/roles/scans/templates/smb.conf.j2 new file mode 100644 index 0000000..0ac3ea9 --- /dev/null +++ b/roles/scans/templates/smb.conf.j2 @@ -0,0 +1,26 @@ +# {{ ansible_managed }} + +[global] + + workgroup = WORKGROUP + server string = PROGRESS + + security = user + hosts allow = 192.168.86.14 + + log file = /var/log/samba/%m.log + max log size = 500 + + dns proxy = no + load printers = no + printing = bsd + printcap name = /dev/null + disable spoolss = yes + +[scans] + comment = scans + path = /mnt/scans + valid users = dell + public = no + browseable = yes + writeable = yes diff --git a/site.yml b/site.yml index 6ae274c..012e9b2 100644 --- a/site.yml +++ b/site.yml @@ -55,6 +55,10 @@ roles: - borg_client +- hosts: progress + roles: + - scans + #- hosts: ruby # become: True # roles: