Implement LAN server sharing home directories via smb or sshfs.
This commit is contained in:
parent
c976c69bed
commit
e5ae626936
8 changed files with 213 additions and 1 deletions
55
sambox.yml
Normal file
55
sambox.yml
Normal file
|
@ -0,0 +1,55 @@
|
|||
---
|
||||
## This playbook deploys the sambox server. Add 'hostname=XXX' and 'domain=YYY'
|
||||
## to the installer boot parameters to set hostname and domain.
|
||||
##
|
||||
|
||||
|
||||
- name: apply configuration to the sambox server
|
||||
hosts: all
|
||||
remote_user: ansible
|
||||
become: yes
|
||||
|
||||
vars:
|
||||
## This interface provides the default route:
|
||||
if_wan: "{{ ansible_default_ipv4.interface }}"
|
||||
|
||||
## Use the first remaining interface for the LAN:
|
||||
if_lan: "{{ ansible_interfaces | difference([if_wan, 'lo']) | first }}"
|
||||
|
||||
## LAN IP address range:
|
||||
ipaddr_lan: 192.168.0.10/24
|
||||
dhcp_range: 192.168.0.50,192.168.0.99,2h
|
||||
in_inventory: 192.168.0.[50:99]
|
||||
|
||||
di_dist: "{{ ansible_distribution_release }}"
|
||||
di_version: 10 #"{{ ansible_distribution_major_version }}"
|
||||
di_pkg: "debian-installer-{{ di_version }}-netboot-amd64"
|
||||
|
||||
ansible_user: ansible
|
||||
repo_dir: "/home/{{ ansible_user }}/debian-lan"
|
||||
ansible_python_interpreter: "/usr/bin/python3" ## needed for firewalld module
|
||||
|
||||
|
||||
vars_prompt:
|
||||
- name: "foo_pwd"
|
||||
prompt:
|
||||
In case you would like to prepare a test user 'foo' and have
|
||||
not done so yet, provide foo's password here. Leave empty to
|
||||
just continue
|
||||
private: yes
|
||||
|
||||
|
||||
pre_tasks:
|
||||
- name: validate if interfaces are available
|
||||
fail:
|
||||
msg: "Interfaces {{ ansible_interfaces }} found. WAN: '{{ if_wan }}', LAN: '{{ if_lan }}'. Two NICs needed."
|
||||
when: (if_lan not in ansible_interfaces) or (if_wan not in ansible_interfaces) or (if_lan == if_wan)
|
||||
|
||||
|
||||
roles:
|
||||
- up2date-debian
|
||||
- two-interface-firewalld
|
||||
- dhcp-dns-dnsmasq
|
||||
- tftp-netboot-installer
|
||||
- apt-cacher
|
||||
- samba-ldap
|
Loading…
Add table
Add a link
Reference in a new issue