-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Xavi Hernandez <[email protected]>
- Loading branch information
1 parent
756b618
commit 46402ac
Showing
11 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
ctdb_network_private_interfaces: >- | ||
{{ | ||
config.nodes | | ||
dict2items | | ||
selectattr('value.groups', 'contains', 'cluster') | | ||
map(attribute='value.networks.private') | | ||
list | ||
}} | ||
ctdb_network_public_interfaces: >- | ||
{{ | ||
config.nodes | | ||
dict2items | | ||
selectattr('value.groups', 'contains', 'cluster') | | ||
map(attribute='value.ctdb.public') | | ||
list | ||
}} | ||
ctdb_network_public_interface_subnet_mask: "24" | ||
ctdb_network_public_interface_name: "eth2" | ||
|
||
samba_netbios_name: "GLUSTERTEST" | ||
samba_users: | ||
- { username: 'test1', password: 'x', uid: '2001' } | ||
- { username: 'test2', password: 'x', uid: '2002' } | ||
|
||
samba_shares: | ||
- { cluster_volume: "/samba", share_name: "xfs-share", device: "/dev/vdb" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: Create CTDB directory | ||
file: | ||
path: /ctdb/lock | ||
state: directory | ||
|
||
- name: SELinux - Allow CTDB to access recovery lockfile | ||
sefcontext: | ||
target: '/ctdb/lock(/.*)?' | ||
setype: ctdbd_var_lib_t | ||
state: present | ||
|
||
- name: SELinux - Apply changes | ||
command: restorecon -R /ctdb |
21 changes: 21 additions & 0 deletions
21
vagrant/ansible/roles/samba.setup/tasks/xfs/fix_share_permissions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
- name: Mount XFS | ||
mount: | ||
path: "{{ path }}" | ||
src: "{{ volume }}" | ||
fstype: xfs | ||
state: mounted | ||
|
||
- name: Set permission of volume root to 0777 | ||
file: | ||
path: "{{ path }}" | ||
mode: '0777' | ||
|
||
- name: SELinux - Allow access to mount point | ||
sefcontext: | ||
target: "{{ path }}" | ||
setype: mnt_t | ||
state: present | ||
|
||
- name: SELinux - Apply changes | ||
command: restorecon -R "{{ path }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: Install Samba | ||
yum: | ||
name: samba | ||
state: present | ||
|
||
- name: Make shares world writable | ||
include_tasks: | ||
file: "xfs/fix_share_permissions.yml" | ||
vars: | ||
path: "{{ item.cluster_volume }}" | ||
volume: "{{ item.device }}" | ||
with_items: "{{ samba_shares }}" | ||
run_once: true | ||
|
||
- name: Selinux - Allow exporting everything | ||
seboolean: | ||
name: samba_export_all_rw | ||
state: yes | ||
persistent: yes |
5 changes: 5 additions & 0 deletions
5
vagrant/ansible/roles/samba.setup/templates/xfs/smb_share.conf.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[{{ samba_share }}] | ||
comment = For samba share of volume {{ cluster_volume }} | ||
vfs objects = acl_xattr | ||
path = {{ cluster_volume }} | ||
read only = no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: Create the XFS filesystem | ||
filesystem: | ||
dev: "{{ item.device }}" | ||
force: true | ||
fstype: xfs | ||
loop: "{{ samba_shares }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
- name: Install ansible | ||
yum: | ||
name: | ||
- ansible-core | ||
- ansible-collection-ansible-posix | ||
- ansible-collection-community-general | ||
state: latest |