-numerous changes to work with Raspbian 10
-redo of some roles, particularly GUI -modifications to support working from a "Raspbian Lite" install
This commit is contained in:
@@ -1,74 +1,72 @@
|
||||
---
|
||||
- name: Install the Samba and additional packages
|
||||
apt:
|
||||
name: "{{ ubuntu_samba_packages }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: yes
|
||||
- name: Copy the Customize smb.conf file
|
||||
become: yes
|
||||
template:
|
||||
src: etc_samba_smb.conf.j2
|
||||
dest: /etc/samba/smb.conf
|
||||
backup: yes
|
||||
notify:
|
||||
- Restart Samba
|
||||
|
||||
- name: Create Samba users restricted group
|
||||
group:
|
||||
name: "{{ samba_group_name }}"
|
||||
state: present
|
||||
become: yes
|
||||
- name: Add the User(s) to Samba group
|
||||
user:
|
||||
name: "{{ item.name }}"
|
||||
groups: "{{ samba_group_name }}"
|
||||
append: yes
|
||||
become: yes
|
||||
with_items: "{{ samba_users }}"
|
||||
|
||||
- name: Create Samba Password for User(s)
|
||||
shell: "(echo {{ item.smbpasswd }}; echo {{ item.smbpasswd }}) | smbpasswd -s -a {{ item.name }}"
|
||||
with_items: "{{ samba_users }}"
|
||||
become: yes
|
||||
|
||||
- name: "Check that {{ public_share_path }} exist"
|
||||
stat:
|
||||
path: "{{ public_share_path }}"
|
||||
register: public_dir_exists
|
||||
|
||||
- name: "Create {{ public_share_path }} directory"
|
||||
become: yes
|
||||
file:
|
||||
state: directory
|
||||
path: "{{ public_share_path }}"
|
||||
owner: nobody
|
||||
group: nogroup
|
||||
mode: 0755
|
||||
recurse: yes
|
||||
when: public_dir_exists.stat.exists == False
|
||||
|
||||
- name: "Check that {{ private_share_path }} exist"
|
||||
stat:
|
||||
path: "{{ private_share_path }}"
|
||||
register: private_dir_exists
|
||||
|
||||
- name: "Create {{ private_share_path }} directory"
|
||||
become: yes
|
||||
file:
|
||||
state: directory
|
||||
path: "{{ private_share_path }}"
|
||||
owner: root
|
||||
group: "{{ samba_group_name }}"
|
||||
mode: 1770
|
||||
when: private_dir_exists.stat.exists == False
|
||||
- name: copy genfiles script
|
||||
copy:
|
||||
src: "{{ role_path }}/files/genfiles.sh"
|
||||
dest: /home/pi/scripts/genfiles.sh
|
||||
owner: pi
|
||||
group: pi
|
||||
mode: a+x
|
||||
tags: samba_genfiles
|
||||
notify:
|
||||
- Generate Samba Files
|
||||
---
|
||||
- name: Install the Samba and additional packages
|
||||
apt:
|
||||
name: "{{ ubuntu_samba_packages }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
become: yes
|
||||
- name: Copy the Customize smb.conf file
|
||||
become: yes
|
||||
template:
|
||||
src: etc_samba_smb.conf.j2
|
||||
dest: /etc/samba/smb.conf
|
||||
backup: yes
|
||||
# notify: Restart Samba
|
||||
|
||||
- name: Create Samba users restricted group
|
||||
group:
|
||||
name: "{{ samba_group_name }}"
|
||||
state: present
|
||||
become: yes
|
||||
- name: Add the User(s) to Samba group
|
||||
user:
|
||||
name: "{{ item.name }}"
|
||||
groups: "{{ samba_group_name }}"
|
||||
append: yes
|
||||
become: yes
|
||||
with_items: "{{ samba_users }}"
|
||||
|
||||
- name: Create Samba Password for User(s)
|
||||
shell: "(echo {{ item.smbpasswd }}; echo {{ item.smbpasswd }}) | smbpasswd -s -a {{ item.name }}"
|
||||
with_items: "{{ samba_users }}"
|
||||
become: yes
|
||||
|
||||
- name: "Check that {{ public_share_path }} exist"
|
||||
stat:
|
||||
path: "{{ public_share_path }}"
|
||||
register: public_dir_exists
|
||||
|
||||
- name: "Create {{ public_share_path }} directory"
|
||||
become: yes
|
||||
file:
|
||||
state: directory
|
||||
path: "{{ public_share_path }}"
|
||||
owner: nobody
|
||||
group: nogroup
|
||||
mode: 0755
|
||||
recurse: yes
|
||||
when: public_dir_exists.stat.exists == False
|
||||
|
||||
- name: "Check that {{ private_share_path }} exist"
|
||||
stat:
|
||||
path: "{{ private_share_path }}"
|
||||
register: private_dir_exists
|
||||
|
||||
- name: "Create {{ private_share_path }} directory"
|
||||
become: yes
|
||||
file:
|
||||
state: directory
|
||||
path: "{{ private_share_path }}"
|
||||
owner: root
|
||||
group: "{{ samba_group_name }}"
|
||||
mode: 1770
|
||||
when: private_dir_exists.stat.exists == False
|
||||
- name: copy genfiles script
|
||||
copy:
|
||||
src: "{{ role_path }}/files/genfiles.sh"
|
||||
dest: /home/pi/scripts/genfiles.sh
|
||||
owner: pi
|
||||
group: pi
|
||||
mode: a+x
|
||||
tags: samba_genfiles
|
||||
notify: Generate Samba Files
|
||||
|
||||
Reference in New Issue
Block a user