Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional installation of Samba and CTDB from git sources #94

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions playbooks/ansible/roles/client.prep/tasks/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
yum:
name:
- cifs-utils
- samba-test
- samba-client
- python3-pip
- git
- make
Expand Down
4 changes: 2 additions & 2 deletions playbooks/ansible/roles/common.prep/tasks/centos8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

- name: Enable Samba nightly rpms repository
command: >-
yum-config-manager --add-repo
http://artifacts.ci.centos.org/samba/pkgs/master/centos/samba-nightly-master.repo
yum-config-manager --add-repo {{ config.install.samba.repo.url }}
when: config.install.samba.repo is defined
4 changes: 2 additions & 2 deletions playbooks/ansible/roles/common.prep/tasks/centos9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@

- name: Enable Samba nightly rpms repository
command: >-
yum-config-manager --add-repo
http://artifacts.ci.centos.org/samba/pkgs/master/centos/samba-nightly-master.repo
yum-config-manager --add-repo {{ config.install.samba.repo.url }}
when: config.install.samba.repo is defined
5 changes: 0 additions & 5 deletions playbooks/ansible/roles/ctdb.setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
msg: "Please provide these required variable: ctdb_network_public_interface_name"
when: ctdb_network_public_interface_name is undefined

- name: Add ctdb package
yum:
name: ctdb
state: present

- name: Create lock directory
file:
path: "{{ config.paths.ctdb.var_lib }}/lock"
Expand Down
70 changes: 70 additions & 0 deletions playbooks/ansible/roles/samba.install/files/bootstrap-centos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

dnf install -y \
"@Development Tools" \
avahi-devel \
bind \
bison \
cups-devel \
dbus-devel \
docbook-style-xsl \
e2fsprogs-devel \
flex \
gcc \
gawk \
glibc-gconv-extra \
gnupg2 \
gnutls-devel \
gpgme-devel \
jansson-devel \
krb5-devel \
krb5-server \
libacl-devel \
libaio-devel \
libarchive-devel \
libattr-devel \
libcap-devel \
libcmocka-devel \
libicu-devel \
libtasn1-devel \
libtasn1-tools \
libtirpc-devel \
liburing-devel \
libuuid-devel \
libxslt \
lmdb \
lmdb-devel \
make \
mingw32-gcc \
mingw64-gcc \
ncurses-devel \
openldap-devel \
pam-devel \
'perl(Archive::Tar)' \
'perl(ExtUtils::MakeMaker)' \
'perl(FindBin)' \
perl-interpreter \
'perl(Parse::Yapp)' \
'perl(Test::More)' \
perl-generators \
popt-devel \
python3-cryptography \
python3-dateutil \
python3-devel \
python3-dns \
python3-gpg \
python3-iso8601 \
python3-markdown \
python3-pyasn1 \
python3-requests \
python3-setproctitle \
python3-setuptools \
quota-devel \
readline-devel \
rpcgen \
rpcsvc-proto-devel \
systemd-devel \
systemd-rpm-macros \
xfsprogs-devel \
xz \
zlib-devel
3 changes: 3 additions & 0 deletions playbooks/ansible/roles/samba.install/tasks/git/centos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: Install common dependencies
script: bootstrap-centos.sh
37 changes: 37 additions & 0 deletions playbooks/ansible/roles/samba.install/tasks/git/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/git/"
with_first_found:
- files: "{{ [prefix] | product(config.os[site.os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file

- name: Install backend specific packages
include_role:
name: "sit.{{ config.be.name }}"
tasks_from: git/main.yml

- name: Setup git repository
git:
repo: "{{ config.install.samba.git.repo }}"
dest: "{{ config.install.samba.git.dest }}"
version: "{{ config.install.samba.git.version }}"
refspec: "{{ config.install.samba.git.refspec }}"

- name: Configure samba installation(backend specific)
include_role:
name: "sit.{{ config.be.name }}"
tasks_from: git/configure.yml

- name: Install samba and ctdb
command: make -j install
args:
chdir: "{{ config.install.samba.git.dest }}"

- name: Prepare the installation
shell: |
ldconfig
systemctl daemon-reload
restorecon -vR /etc /run /usr/bin /usr/sbin /usr/libexec /usr/lib64 /usr/share /usr/lib/systemd/system /var/lib /var/log

Check warning on line 37 in playbooks/ansible/roles/samba.install/tasks/git/main.yml

View workflow job for this annotation

GitHub Actions / yamllint

37:121 [line-length] line too long (124 > 120 characters)
8 changes: 8 additions & 0 deletions playbooks/ansible/roles/samba.install/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: Install samba and ctdb from rpm repositories
when: config.install.samba.repo is defined
include_tasks: repo/main.yml

- name: Install samba and ctdb from git sources
when: config.install.samba.git is defined
include_tasks: git/main.yml
14 changes: 14 additions & 0 deletions playbooks/ansible/roles/samba.install/tasks/repo/centos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: Install samba and ctdb
when: inventory_hostname in groups['cluster']
yum:
name:
- samba
- ctdb

- name: Install samba client/test
when: inventory_hostname in groups['clients']
yum:
name:
- samba-client
- samba-test
14 changes: 14 additions & 0 deletions playbooks/ansible/roles/samba.install/tasks/repo/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/repo/"
with_first_found:
- files: "{{ [prefix] | product(config.os[site.os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file

- name: Install backend specific packages
include_role:
name: "sit.{{ config.be.name }}"
tasks_from: repo/main.yml
5 changes: 0 additions & 5 deletions playbooks/ansible/roles/samba.setup/tasks/cephfs/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
state: yes
persistent: yes

- name: Install CephFS VFS module
yum:
name: samba-vfs-cephfs
state: present

- name: Skip check of share path
lineinfile:
path: "{{ config.paths.ctdb.etc }}/events/legacy/50.samba.options"
Expand Down
5 changes: 0 additions & 5 deletions playbooks/ansible/roles/samba.setup/tasks/glusterfs/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,3 @@
name: samba_load_libgfapi
state: yes
persistent: yes

- name: Install samba-vfs-glusterfs package
yum:
name: samba-vfs-glusterfs
state: present
5 changes: 0 additions & 5 deletions playbooks/ansible/roles/samba.setup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
---
- name: Install samba packages
yum:
name: samba
state: present

- name: Create Samba share directories
file:
path: "{{ config.paths.mount }}/{{ item.name }}"
Expand Down
21 changes: 21 additions & 0 deletions playbooks/ansible/roles/sit.cephfs/tasks/common/centos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Identify latest ceph:{{ config.data.branch }} build
uri:
url: "https://shaman.ceph.com/api/search?\
project=ceph&\
ref={{ config.data.branch }}&\
flavor=default&\
status=ready&\
distros=centos/{{ config.os[site.os].version }}/x86_64&\
sha1=latest"
return_content: true
register: ceph_shaman

- name: Create ceph repo
yum_repository:
name: "ceph-{{ config.data.branch }}-{{ ceph_shaman.json[0].sha1 }}"
baseurl: "{{ ceph_shaman.json[0].url }}/x86_64"
description: "Ceph {{ config.data.branch }} ({{ ceph_shaman.json[0].sha1 }})"
enabled: true
gpgcheck: false
state: present
8 changes: 8 additions & 0 deletions playbooks/ansible/roles/sit.cephfs/tasks/common/main.yml
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
---
- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/common/"
with_first_found:
- files: "{{ [prefix] | product(config.os[site.os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file
6 changes: 6 additions & 0 deletions playbooks/ansible/roles/sit.cephfs/tasks/git/centos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Install CephFS API development packages
yum:
name:
- libcephfs-devel
- librados-devel
32 changes: 32 additions & 0 deletions playbooks/ansible/roles/sit.cephfs/tasks/git/configure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
- name: Configure with Ceph components
command: >-
./configure --enable-debug \
--prefix=/usr \
--enable-fhs \
--sysconfdir=/etc \
--libdir=/usr/lib64 \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--with-piddir=/run \
--with-sockets-dir=/run/samba \
--with-lockdir=/var/lib/samba/lock \
--with-statedir=/var/lib/samba \
--with-cachedir=/var/lib/samba \
--disable-rpath-install \
--with-quotas \
--bundled-libraries=!zlib,!popt,talloc,pytalloc,pytalloc-util,tevent,pytevent,tdb,pytdb,ldb,pyldb,pyldb-util \

Check warning on line 18 in playbooks/ansible/roles/sit.cephfs/tasks/git/configure.yml

View workflow job for this annotation

GitHub Actions / yamllint

18:121 [line-length] line too long (126 > 120 characters)
--with-pam \
--with-pie \
--with-relro \
--without-fam \
--with-system-mitkrb5 \
--with-experimental-mit-ad-dc \
--disable-glusterfs \
--with-cluster-support \
--enable-ceph-reclock \
--with-profiling-data \
--with-systemd \
--systemd-install-services
args:
chdir: "{{ config.install.samba.git.dest }}"
9 changes: 9 additions & 0 deletions playbooks/ansible/roles/sit.cephfs/tasks/git/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/git/"
with_first_found:
- files: "{{ [prefix] | product(config.os[site.os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file
7 changes: 7 additions & 0 deletions playbooks/ansible/roles/sit.cephfs/tasks/repo/centos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Install CephFS VFS module
when: config.be.variant == 'vfs' and
inventory_hostname in groups['cluster']
yum:
name: samba-vfs-cephfs
state: present
9 changes: 9 additions & 0 deletions playbooks/ansible/roles/sit.cephfs/tasks/repo/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Process OS specific tasks
include_tasks: "{{ include_file }}"
vars:
prefix: "{{ role_path }}/tasks/repo/"
with_first_found:
- files: "{{ [prefix] | product(config.os[site.os].includes) | map('join') | list }}"
loop_control:
loop_var: include_file
30 changes: 3 additions & 27 deletions playbooks/ansible/roles/sit.cephfs/tasks/server/centos.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
---
# Note: the repo and the ceph-common package are only required to be able to
# mount the ceph volume from the host. Cephadm will download all other
# required container images independently of the repository.

- name: Identify latest ceph:{{ config.data.branch }} build
uri:
url: "https://shaman.ceph.com/api/search?\
project=ceph&\
ref={{ config.data.branch }}&\
flavor=default&\
status=ready&\
distros=centos/{{ config.os[site.os].version }}/x86_64&\
sha1=latest"
return_content: true
register: ceph_shaman

- name: Create ceph repo
yum_repository:
name: "ceph-{{ config.data.branch }}-{{ ceph_shaman.json[0].sha1 }}"
baseurl: "{{ ceph_shaman.json[0].url }}/x86_64"
description: "Ceph {{ config.data.branch }} ({{ ceph_shaman.json[0].sha1 }})"
enabled: true
gpgcheck: false
state: present

# Note: this rule can not be merged with the above rule. This depends on
# packages enabled by repo files the previous rule installs.
# Note: ceph-common package is only required to be able to mount the ceph volume
# from the host. Cephadm will download all other required container images
# independently of the repository.
- name: Install required packages
yum:
name:
Expand Down
6 changes: 6 additions & 0 deletions playbooks/ansible/roles/sit.glusterfs/tasks/git/centos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Install GlusterFS API development packages
yum:
name:
- libgfapi-devel
- libglusterfs-devel
31 changes: 31 additions & 0 deletions playbooks/ansible/roles/sit.glusterfs/tasks/git/configure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
- name: Configure with GlusterFS components
command: >-
./configure --enable-debug \
--prefix=/usr \
--enable-fhs \
--sysconfdir=/etc \
--libdir=/usr/lib64 \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--with-piddir=/run \
--with-sockets-dir=/run/samba \
--with-lockdir=/var/lib/samba/lock \
--with-statedir=/var/lib/samba
--with-cachedir=/var/lib/samba \
--disable-rpath-install \
--with-quotas \
--bundled-libraries=!zlib,!popt,talloc,pytalloc,pytalloc-util,tevent,pytevent,tdb,pytdb,ldb,pyldb,pyldb-util \

Check warning on line 18 in playbooks/ansible/roles/sit.glusterfs/tasks/git/configure.yml

View workflow job for this annotation

GitHub Actions / yamllint

18:121 [line-length] line too long (126 > 120 characters)
--with-pam \
--with-pie \
--with-relro \
--without-fam \
--with-system-mitkrb5 \
--with-experimental-mit-ad-dc \
--disable-cephfs \
--with-cluster-support \
--with-profiling-data \
--with-systemd \
--systemd-install-services
args:
chdir: "{{ config.install.samba.git.dest }}"
Loading
Loading