diff --git a/playbooks/ansible/roles/client.prep/tasks/centos.yml b/playbooks/ansible/roles/client.prep/tasks/centos.yml index 0169ca1c..26cce5bd 100644 --- a/playbooks/ansible/roles/client.prep/tasks/centos.yml +++ b/playbooks/ansible/roles/client.prep/tasks/centos.yml @@ -3,8 +3,6 @@ yum: name: - cifs-utils - - samba-test - - samba-client - python3-pip - git - make diff --git a/playbooks/ansible/roles/common.prep/tasks/centos8.yml b/playbooks/ansible/roles/common.prep/tasks/centos8.yml index 2ebb8388..3c306b8e 100644 --- a/playbooks/ansible/roles/common.prep/tasks/centos8.yml +++ b/playbooks/ansible/roles/common.prep/tasks/centos8.yml @@ -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 diff --git a/playbooks/ansible/roles/common.prep/tasks/centos9.yml b/playbooks/ansible/roles/common.prep/tasks/centos9.yml index 92c2876c..c6c3a8db 100644 --- a/playbooks/ansible/roles/common.prep/tasks/centos9.yml +++ b/playbooks/ansible/roles/common.prep/tasks/centos9.yml @@ -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 diff --git a/playbooks/ansible/roles/ctdb.setup/tasks/main.yml b/playbooks/ansible/roles/ctdb.setup/tasks/main.yml index 68a6a08d..a4a33277 100644 --- a/playbooks/ansible/roles/ctdb.setup/tasks/main.yml +++ b/playbooks/ansible/roles/ctdb.setup/tasks/main.yml @@ -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" diff --git a/playbooks/ansible/roles/samba.install/files/bootstrap-centos.sh b/playbooks/ansible/roles/samba.install/files/bootstrap-centos.sh new file mode 100755 index 00000000..f1d94f83 --- /dev/null +++ b/playbooks/ansible/roles/samba.install/files/bootstrap-centos.sh @@ -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 diff --git a/playbooks/ansible/roles/samba.install/tasks/git/centos.yml b/playbooks/ansible/roles/samba.install/tasks/git/centos.yml new file mode 100644 index 00000000..90ee338a --- /dev/null +++ b/playbooks/ansible/roles/samba.install/tasks/git/centos.yml @@ -0,0 +1,3 @@ +--- +- name: Install common dependencies + script: bootstrap-centos.sh diff --git a/playbooks/ansible/roles/samba.install/tasks/git/main.yml b/playbooks/ansible/roles/samba.install/tasks/git/main.yml new file mode 100644 index 00000000..25c0c827 --- /dev/null +++ b/playbooks/ansible/roles/samba.install/tasks/git/main.yml @@ -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 diff --git a/playbooks/ansible/roles/samba.install/tasks/main.yml b/playbooks/ansible/roles/samba.install/tasks/main.yml new file mode 100644 index 00000000..bbc137ee --- /dev/null +++ b/playbooks/ansible/roles/samba.install/tasks/main.yml @@ -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 diff --git a/playbooks/ansible/roles/samba.install/tasks/repo/centos.yml b/playbooks/ansible/roles/samba.install/tasks/repo/centos.yml new file mode 100644 index 00000000..b331f8e4 --- /dev/null +++ b/playbooks/ansible/roles/samba.install/tasks/repo/centos.yml @@ -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 diff --git a/playbooks/ansible/roles/samba.install/tasks/repo/main.yml b/playbooks/ansible/roles/samba.install/tasks/repo/main.yml new file mode 100644 index 00000000..e523a93d --- /dev/null +++ b/playbooks/ansible/roles/samba.install/tasks/repo/main.yml @@ -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 diff --git a/playbooks/ansible/roles/samba.setup/tasks/cephfs/main.yml b/playbooks/ansible/roles/samba.setup/tasks/cephfs/main.yml index 3bb77be2..f178cda8 100644 --- a/playbooks/ansible/roles/samba.setup/tasks/cephfs/main.yml +++ b/playbooks/ansible/roles/samba.setup/tasks/cephfs/main.yml @@ -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" diff --git a/playbooks/ansible/roles/samba.setup/tasks/glusterfs/main.yml b/playbooks/ansible/roles/samba.setup/tasks/glusterfs/main.yml index b35095ce..d81bced7 100644 --- a/playbooks/ansible/roles/samba.setup/tasks/glusterfs/main.yml +++ b/playbooks/ansible/roles/samba.setup/tasks/glusterfs/main.yml @@ -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 diff --git a/playbooks/ansible/roles/samba.setup/tasks/main.yml b/playbooks/ansible/roles/samba.setup/tasks/main.yml index 06505861..174cf85c 100644 --- a/playbooks/ansible/roles/samba.setup/tasks/main.yml +++ b/playbooks/ansible/roles/samba.setup/tasks/main.yml @@ -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 }}" diff --git a/playbooks/ansible/roles/sit.cephfs/tasks/common/centos.yml b/playbooks/ansible/roles/sit.cephfs/tasks/common/centos.yml new file mode 100644 index 00000000..eb4d5455 --- /dev/null +++ b/playbooks/ansible/roles/sit.cephfs/tasks/common/centos.yml @@ -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 diff --git a/playbooks/ansible/roles/sit.cephfs/tasks/common/main.yml b/playbooks/ansible/roles/sit.cephfs/tasks/common/main.yml index ed97d539..7229bbef 100644 --- a/playbooks/ansible/roles/sit.cephfs/tasks/common/main.yml +++ b/playbooks/ansible/roles/sit.cephfs/tasks/common/main.yml @@ -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 diff --git a/playbooks/ansible/roles/sit.cephfs/tasks/git/centos.yml b/playbooks/ansible/roles/sit.cephfs/tasks/git/centos.yml new file mode 100644 index 00000000..592ff755 --- /dev/null +++ b/playbooks/ansible/roles/sit.cephfs/tasks/git/centos.yml @@ -0,0 +1,6 @@ +--- +- name: Install CephFS API development packages + yum: + name: + - libcephfs-devel + - librados-devel diff --git a/playbooks/ansible/roles/sit.cephfs/tasks/git/configure.yml b/playbooks/ansible/roles/sit.cephfs/tasks/git/configure.yml new file mode 100644 index 00000000..92af4224 --- /dev/null +++ b/playbooks/ansible/roles/sit.cephfs/tasks/git/configure.yml @@ -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 \ + --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 }}" diff --git a/playbooks/ansible/roles/sit.cephfs/tasks/git/main.yml b/playbooks/ansible/roles/sit.cephfs/tasks/git/main.yml new file mode 100644 index 00000000..22823dc2 --- /dev/null +++ b/playbooks/ansible/roles/sit.cephfs/tasks/git/main.yml @@ -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 diff --git a/playbooks/ansible/roles/sit.cephfs/tasks/repo/centos.yml b/playbooks/ansible/roles/sit.cephfs/tasks/repo/centos.yml new file mode 100644 index 00000000..0ec32da7 --- /dev/null +++ b/playbooks/ansible/roles/sit.cephfs/tasks/repo/centos.yml @@ -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 diff --git a/playbooks/ansible/roles/sit.cephfs/tasks/repo/main.yml b/playbooks/ansible/roles/sit.cephfs/tasks/repo/main.yml new file mode 100644 index 00000000..c5a0c6fb --- /dev/null +++ b/playbooks/ansible/roles/sit.cephfs/tasks/repo/main.yml @@ -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 diff --git a/playbooks/ansible/roles/sit.cephfs/tasks/server/centos.yml b/playbooks/ansible/roles/sit.cephfs/tasks/server/centos.yml index bc93bfa9..5d6a321f 100644 --- a/playbooks/ansible/roles/sit.cephfs/tasks/server/centos.yml +++ b/playbooks/ansible/roles/sit.cephfs/tasks/server/centos.yml @@ -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: diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/git/centos.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/git/centos.yml new file mode 100644 index 00000000..92854c53 --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/git/centos.yml @@ -0,0 +1,6 @@ +--- +- name: Install GlusterFS API development packages + yum: + name: + - libgfapi-devel + - libglusterfs-devel diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/git/configure.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/git/configure.yml new file mode 100644 index 00000000..e4abc20c --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/git/configure.yml @@ -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 \ + --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 }}" diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/git/main.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/git/main.yml new file mode 100644 index 00000000..22823dc2 --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/git/main.yml @@ -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 diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/repo/centos.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/repo/centos.yml new file mode 100644 index 00000000..73d07540 --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/repo/centos.yml @@ -0,0 +1,6 @@ +--- +- name: Install samba-vfs-glusterfs package + when: inventory_hostname in groups['cluster'] + yum: + name: samba-vfs-glusterfs + state: present diff --git a/playbooks/ansible/roles/sit.glusterfs/tasks/repo/main.yml b/playbooks/ansible/roles/sit.glusterfs/tasks/repo/main.yml new file mode 100644 index 00000000..c5a0c6fb --- /dev/null +++ b/playbooks/ansible/roles/sit.glusterfs/tasks/repo/main.yml @@ -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 diff --git a/playbooks/ansible/roles/sit.gpfs/tasks/git/configure.yml b/playbooks/ansible/roles/sit.gpfs/tasks/git/configure.yml new file mode 100644 index 00000000..3e255b2a --- /dev/null +++ b/playbooks/ansible/roles/sit.gpfs/tasks/git/configure.yml @@ -0,0 +1,32 @@ +--- +- name: Configure for standard file systems + 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 \ + --with-pam \ + --with-pie \ + --with-relro \ + --without-fam \ + --with-system-mitkrb5 \ + --with-experimental-mit-ad-dc \ + --disable-cephfs \ + --disable-glusterfs \ + --with-cluster-support \ + --with-profiling-data \ + --with-systemd \ + --systemd-install-services + args: + chdir: "{{ config.install.samba.git.dest }}" diff --git a/playbooks/ansible/roles/sit.gpfs/tasks/git/main.yml b/playbooks/ansible/roles/sit.gpfs/tasks/git/main.yml new file mode 100644 index 00000000..ed97d539 --- /dev/null +++ b/playbooks/ansible/roles/sit.gpfs/tasks/git/main.yml @@ -0,0 +1 @@ +--- diff --git a/playbooks/ansible/roles/sit.gpfs/tasks/repo/main.yml b/playbooks/ansible/roles/sit.gpfs/tasks/repo/main.yml new file mode 100644 index 00000000..ed97d539 --- /dev/null +++ b/playbooks/ansible/roles/sit.gpfs/tasks/repo/main.yml @@ -0,0 +1 @@ +--- diff --git a/playbooks/ansible/roles/sit.xfs/tasks/git/configure.yml b/playbooks/ansible/roles/sit.xfs/tasks/git/configure.yml new file mode 100644 index 00000000..3e255b2a --- /dev/null +++ b/playbooks/ansible/roles/sit.xfs/tasks/git/configure.yml @@ -0,0 +1,32 @@ +--- +- name: Configure for standard file systems + 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 \ + --with-pam \ + --with-pie \ + --with-relro \ + --without-fam \ + --with-system-mitkrb5 \ + --with-experimental-mit-ad-dc \ + --disable-cephfs \ + --disable-glusterfs \ + --with-cluster-support \ + --with-profiling-data \ + --with-systemd \ + --systemd-install-services + args: + chdir: "{{ config.install.samba.git.dest }}" diff --git a/playbooks/ansible/roles/sit.xfs/tasks/git/main.yml b/playbooks/ansible/roles/sit.xfs/tasks/git/main.yml new file mode 100644 index 00000000..ed97d539 --- /dev/null +++ b/playbooks/ansible/roles/sit.xfs/tasks/git/main.yml @@ -0,0 +1 @@ +--- diff --git a/playbooks/ansible/roles/sit.xfs/tasks/repo/main.yml b/playbooks/ansible/roles/sit.xfs/tasks/repo/main.yml new file mode 100644 index 00000000..ed97d539 --- /dev/null +++ b/playbooks/ansible/roles/sit.xfs/tasks/repo/main.yml @@ -0,0 +1 @@ +--- diff --git a/playbooks/ansible/setup-clients.yml b/playbooks/ansible/setup-clients.yml index e2cf3efa..520423f9 100644 --- a/playbooks/ansible/setup-clients.yml +++ b/playbooks/ansible/setup-clients.yml @@ -8,3 +8,4 @@ roles: - common.prep - client.prep + - samba.install diff --git a/playbooks/ansible/setup-cluster.yml b/playbooks/ansible/setup-cluster.yml index 4c77b511..d5783ce9 100644 --- a/playbooks/ansible/setup-cluster.yml +++ b/playbooks/ansible/setup-cluster.yml @@ -9,6 +9,8 @@ - common.prep - node.prep - "sit.{{ config.be.name }}" + - role: samba.install + when: config.samba - role: samba.setup when: config.samba - role: ctdb.setup diff --git a/playbooks/roles/local.defaults/templates/config.yml.j2 b/playbooks/roles/local.defaults/templates/config.yml.j2 index 8dfcefda..7ef36bc5 100644 --- a/playbooks/roles/local.defaults/templates/config.yml.j2 +++ b/playbooks/roles/local.defaults/templates/config.yml.j2 @@ -156,3 +156,24 @@ config: statedir: "{{ settings.misc.host.statedir }}/sit_statedump" configdir: "{{ settings.misc.host.configdir }}" + + install: + samba: + {%- if settings.install.samba.git is defined +%} + git: + repo: {{ settings.install.samba.git.repo | default('git://git.samba.org/samba.git') }} + dest: {{ settings.install.samba.git.dest | default('/tmp/samba.git') }} + {%- if settings.install.samba.git.mr is defined +%} + version: "mr_{{ settings.install.samba.git.mr }}" + refspec: "merge-requests/{{ settings.install.samba.git.mr }}/head:mr_{{ settings.install.samba.git.mr }}" + {%- elif settings.install.samba.git.pr is defined +%} + version: "pr_{{ settings.install.samba.git.pr }}" + refspec: "pull/{{ settings.install.samba.git.pr }}/head:pr_{{ settings.install.samba.git.pr }}" + {%- else +%} + version: {{ settings.install.samba.git.version | default('HEAD') }} + refspec: {{ settings.install.samba.git.refspec | default('HEAD') }} + {%- endif +%} + {%- else +%} + repo: + url: {{ settings.install.samba.repo.url | default('https://artifacts.ci.centos.org/samba/pkgs/master/centos/samba-nightly-master.repo') }} + {%- endif +%} diff --git a/playbooks/settings.yml b/playbooks/settings.yml index 51aff4b9..cd062159 100644 --- a/playbooks/settings.yml +++ b/playbooks/settings.yml @@ -18,6 +18,41 @@ misc: statedir: "/tmp" configdir: "/tmp/config" +# Installation of components: +# +# Here we define how the installation happens for various components involved +# using 'install' object: +# +# Specify the installation method for Samba and CTDB using 'samba' subobject. +# Each subobject can have following properties. +# +# repo: +# Indicates installation using rpms. +# +# url: (optional, default: https://artifacts.ci.centos.org/samba/pkgs/master/centos/samba-nightly-master.repo) +# Link to yum/dnf repo file holding samba rpms. +# +# git: +# Indicates installation from git repository. +# +# repo: (optional, default: git://git.samba.org/samba.git) +# Git repository url to be cloned for installation. +# +# dest: (optional, default: /tmp/samba.git) +# The path where the repository should be checked out. +# +# version: (optional, default: HEAD) +# Branch, tag or commit to be fetched. +# +# mr: (optional) +# GitLab merge request number to be fetched. +# +# pr: (optional) +# GitHub pull request number to be fetched. +# +# refspec: (optional) +# Additional refspec to specify branch or tag containing a commit. + paths: samba: etc: /etc/samba