wip
This commit is contained in:
commit
e904e61e28
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Samba AD
|
||||||
|
|
||||||
|
### https://wiki.samba.org/index.php/Setting_up_Samba_as_an_Active_Directory_Domain_Controller
|
||||||
7
defaults/main.yml
Normal file
7
defaults/main.yml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
path: "/srv/{{ role_name }}"
|
||||||
|
|
||||||
|
samba_ad_group_override: {}
|
||||||
|
samba_ad_override: {}
|
||||||
|
samba_ad_defaults:
|
||||||
|
ad_domain: ""
|
||||||
|
dc_ip: ""
|
||||||
10
meta/main.yml
Normal file
10
meta/main.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
author: "Niklas Freese <niklas.freese@linksjugend-solid.de>"
|
||||||
|
description: Samba AD
|
||||||
|
company: "Linksjugend ['solid] e.V."
|
||||||
|
license: AGPL-3.0-or-later
|
||||||
|
min_ansible_version: 2.1
|
||||||
|
galaxy_tags: []
|
||||||
|
|
||||||
|
dependencies: []
|
||||||
54
tasks/main.yml
Normal file
54
tasks/main.yml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
|
||||||
|
- name: "set local variables from overrides and defaults"
|
||||||
|
set_fact:
|
||||||
|
samba_ad: "{{ (samba_ad_defaults | combine(samba_ad_override, recursive=True)) if samba_ad_override else samba_ad_defaults }}"
|
||||||
|
|
||||||
|
|
||||||
|
- name: disable systemd-resolve.conf
|
||||||
|
systemd:
|
||||||
|
name: systemd-resolve
|
||||||
|
enabled: false
|
||||||
|
state: stopped
|
||||||
|
|
||||||
|
- name: ensure /etc/hosts is correct
|
||||||
|
template:
|
||||||
|
src: hosts.j2
|
||||||
|
dest: /etc/hosts
|
||||||
|
|
||||||
|
- name: set hostname
|
||||||
|
copy:
|
||||||
|
content: samba_ad.hostname
|
||||||
|
dest: /etc/hostname
|
||||||
|
|
||||||
|
- name: install samba
|
||||||
|
apt:
|
||||||
|
name: samba
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: test if provisioned
|
||||||
|
stat:
|
||||||
|
path: /etc/samba/private/krb5.conf
|
||||||
|
register: kerberos_config
|
||||||
|
|
||||||
|
- name: initial provisioning
|
||||||
|
shell:
|
||||||
|
cmd: >
|
||||||
|
samba-tool domain provision \
|
||||||
|
--use-rfc2307
|
||||||
|
--realm={{ samba_ad.ad_domain }}
|
||||||
|
--domain={{ samba_ad.netbios_name }}
|
||||||
|
--server-role=dc
|
||||||
|
--dns-backend=SAMBA_INTERNAL
|
||||||
|
--adminpass={{ samba_ad.admin_password }}
|
||||||
|
when: not kerberos_config.stat.exists
|
||||||
|
|
||||||
|
- name: copy kerberos config (symlinks cause permission errors)
|
||||||
|
shell:
|
||||||
|
cmd: cp /etc/samba/private/krb5.conf /etc/krb5.conf
|
||||||
|
|
||||||
|
- name: enable and ensure samba is started
|
||||||
|
systemd:
|
||||||
|
name: samba
|
||||||
|
enabled: true
|
||||||
|
state: started
|
||||||
2
templates/hosts.j2
Normal file
2
templates/hosts.j2
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
127.0.0.1 localhost
|
||||||
|
{{ samba_ad.dc_ip }} {{ samba_ad.hostname }}.{{ samba_ad.ad_domain }} {{ samba_ad.hostname }}
|
||||||
2
templates/resolv.conf.j2
Normal file
2
templates/resolv.conf.j2
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
search {{ samba_ad.ad_domain }}
|
||||||
|
nameserver {{ samba_ad.dc_ip }}
|
||||||
Loading…
x
Reference in New Issue
Block a user