martins/autocluster.git
2 months agosamba-build-test: Modern FreeBSD uses Python 3.9 master
Martin Schwenke [Sun, 20 Nov 2022 21:14:07 +0000 (08:14 +1100)]
samba-build-test: Modern FreeBSD uses Python 3.9

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoansible/nodes: Increase CTDB log level to INFO
Martin Schwenke [Tue, 26 Jul 2022 23:30:56 +0000 (09:30 +1000)]
ansible/nodes: Increase CTDB log level to INFO

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoansible/node: Ensure default CTDB event scripts are enabled
Martin Schwenke [Thu, 21 Jul 2022 07:45:32 +0000 (17:45 +1000)]
ansible/node: Ensure default CTDB event scripts are enabled

These aren't enabled by default when installing from binary tarball.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoWIP ansible/node: Use ctdb.service file from binary tarball
Martin Schwenke [Wed, 20 Jul 2022 03:03:02 +0000 (13:03 +1000)]
WIP ansible/node: Use ctdb.service file from binary tarball

This also needs to remove the template.

Alternatively, this can be made conditional on the presence of
"{{ systemd_dir }}/ctdb.service".

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoansible/node: Modernise IP address filtering
Martin Schwenke [Tue, 19 Jul 2022 23:38:23 +0000 (09:38 +1000)]
ansible/node: Modernise IP address filtering

The current version no longer works with modern Ansible.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoautocluster.py: Fix typo in detection of storage nodes
Martin Schwenke [Tue, 19 Jul 2022 02:18:56 +0000 (12:18 +1000)]
autocluster.py: Fix typo in detection of storage nodes

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoansible/node: Remove Samba packages before unpacking binary tarball
Martin Schwenke [Tue, 19 Jul 2022 00:54:27 +0000 (10:54 +1000)]
ansible/node: Remove Samba packages before unpacking binary tarball

At a minimum, these can interfere with the systemd handling.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoansible/node: Fix YAML warnings in binary tarball handling
Martin Schwenke [Tue, 19 Jul 2022 00:54:03 +0000 (10:54 +1000)]
ansible/node: Fix YAML warnings in binary tarball handling

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agovagrant: Disable rsync-based syncing of vagrant/ folder
Martin Schwenke [Mon, 11 Jul 2022 08:24:32 +0000 (18:24 +1000)]
vagrant: Disable rsync-based syncing of vagrant/ folder

This seems to come for free with modern versions of vagrant.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agosamba-build-test: Install modern version of git in CentOS 7
Martin Schwenke [Mon, 11 Jul 2022 08:21:08 +0000 (18:21 +1000)]
samba-build-test: Install modern version of git in CentOS 7

Need "git worktree" support.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agosamba-build-test: Work around UNKNOWN git hash in tarball name
Martin Schwenke [Mon, 11 Jul 2022 08:20:30 +0000 (18:20 +1000)]
samba-build-test: Work around UNKNOWN git hash in tarball name

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoautocluster.py: Ensure ~/.ssh/autocluster.d/ exists
Martin Schwenke [Fri, 8 Jul 2022 07:24:45 +0000 (17:24 +1000)]
autocluster.py: Ensure ~/.ssh/autocluster.d/ exists

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoWIP temporarily drop kernel modules on Lustre
Martin Schwenke [Fri, 15 Jul 2022 05:45:35 +0000 (15:45 +1000)]
WIP temporarily drop kernel modules on Lustre

They don't exist in old release on CentOS 7.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoansible/node: Initial Lustre clusterfs and storage node support
Martin Schwenke [Wed, 6 Jul 2022 11:36:01 +0000 (21:36 +1000)]
ansible/node: Initial Lustre clusterfs and storage node support

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agotest-ctdb: Include distro in build log file name
Martin Schwenke [Wed, 6 Jul 2022 11:35:09 +0000 (21:35 +1000)]
test-ctdb: Include distro in build log file name

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoconfig: Add clusterfs.kernel_version
Martin Schwenke [Wed, 6 Jul 2022 11:34:15 +0000 (21:34 +1000)]
config: Add clusterfs.kernel_version

Ensure that the correct Lustre kernel version can be installed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoconfig: Add vagrant_box_version
Martin Schwenke [Wed, 6 Jul 2022 11:32:43 +0000 (21:32 +1000)]
config: Add vagrant_box_version

Lustre has quite strong dependencies on distributions, so allow
forcing a particular distro version.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoautocluster.py: Always specify encoding when opening text files
Martin Schwenke [Wed, 6 Jul 2022 01:45:27 +0000 (11:45 +1000)]
autocluster.py: Always specify encoding when opening text files

As per PEP-597.

Avoids pylint warnings, such as:

  Using open without explicitly specifying an encoding

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoautocluster.py: Use Python f-strings where possible
Martin Schwenke [Wed, 6 Jul 2022 01:37:32 +0000 (11:37 +1000)]
autocluster.py: Use Python f-strings where possible

Avoids pylint info level warnings, such as:

  Formatting a regular string which could be a f-string

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoautocluster.py: Cleanup exception handling
Martin Schwenke [Wed, 6 Jul 2022 01:28:24 +0000 (11:28 +1000)]
autocluster.py: Cleanup exception handling

Avoid using variable err for exception handling in functions, due to
warnings like this from pylint:

  Redefining name 'err' from outer scope (line 47)

Switch one case to only save the return code, since it is all that is
needed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 months agoautocluster.py: Use triple double-quoted docstrings, as per PEP-8
Martin Schwenke [Tue, 5 Jul 2022 23:50:15 +0000 (09:50 +1000)]
autocluster.py: Use triple double-quoted docstrings, as per PEP-8

Signed-off-by: Martin Schwenke <martin@meltin.net>
9 months agoautocluster.py: Add "storage" node type
Martin Schwenke [Tue, 5 Jul 2022 23:49:44 +0000 (09:49 +1000)]
autocluster.py: Add "storage" node type

It is mentioned in the code but is not one of the defined node types.

Signed-off-by: Martin Schwenke <martin@meltin.net>
9 months agosamba-build-test: Support Vagrant VMs for Linux distros
Martin Schwenke [Fri, 25 Feb 2022 00:21:02 +0000 (11:21 +1100)]
samba-build-test: Support Vagrant VMs for Linux distros

Useful for spinning up a single node test environment.

Signed-off-by: Martin Schwenke <martin@meltin.net>
9 months agoSQ vagrant destroy
Martin Schwenke [Fri, 25 Feb 2022 00:14:02 +0000 (11:14 +1100)]
SQ vagrant destroy

21 months agosamba-build-test: Add FreeBSD 13 support via vagrant
Martin Schwenke [Tue, 15 Feb 2022 06:03:15 +0000 (17:03 +1100)]
samba-build-test: Add FreeBSD 13 support via vagrant

Signed-off-by: Martin Schwenke <martin@meltin.net>
21 months agoautocluster-test-ctdb, ansible/node: Use samba-build-test
Martin Schwenke [Mon, 6 Dec 2021 11:12:23 +0000 (22:12 +1100)]
autocluster-test-ctdb, ansible/node: Use samba-build-test

Build binary tarballs using samba-build-test.  This is nice and
lightweight.  It also avoids building the source tarball on the host
machine.

Signed-off-by: Martin Schwenke <martin@meltin.net>
21 months agosamba-build-test: Add podman-based build/test environment
Martin Schwenke [Fri, 25 Feb 2022 00:48:05 +0000 (11:48 +1100)]
samba-build-test: Add podman-based build/test environment

This supports building Samba and CTDB, and running CTDB tests, in
podman containers.

samba-build-test-wrap.sh by Amitay Isaacs & Martin Schwenke.

This duplicates samba_version.py, for now.

Signed-off-by: Martin Schwenke <martin@meltin.net>
21 months agoansible/node, autocluster-test-ctdb: Split builds and tests by distro
Martin Schwenke [Thu, 25 Nov 2021 00:16:18 +0000 (11:16 +1100)]
ansible/node, autocluster-test-ctdb: Split builds and tests by distro

This is currently a hack to allow testing of multiple distros in
parallel.  It really needs to be cleaned up so that bootstrap_platform
can be overridden by a configuration variable and
autocluster-test-ctdb.sh can pass it in via
.test_ctdb/test-tarball.yml.  That will avoid 2 different parts of the
code constructing the same paths.

Signed-off-by: Martin Schwenke <martin@meltin.net>
21 months agoansible/host: Improve Fedora host setup
Martin Schwenke [Tue, 7 Dec 2021 03:40:19 +0000 (14:40 +1100)]
ansible/host: Improve Fedora host setup

Signed-off-by: Martin Schwenke <martin@meltin.net>
21 months agoansible/node: Use external DNS for build nodes, cluster DNS for others
Martin Schwenke [Fri, 12 Nov 2021 02:21:53 +0000 (13:21 +1100)]
ansible/node: Use external DNS for build nodes, cluster DNS for others

tbuild nodes currently fail to install packages without a proxy
configured, because their DNS is pointing at the AD node, which
probably doesn't exist at build time.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoansible/node: Fix indentation
Martin Schwenke [Fri, 12 Nov 2021 00:32:31 +0000 (11:32 +1100)]
ansible/node: Fix indentation

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoansible/node: Rename ad.dns_forwarder -> resolv_conf.forwarder
Martin Schwenke [Fri, 12 Nov 2021 00:30:58 +0000 (11:30 +1100)]
ansible/node: Rename ad.dns_forwarder -> resolv_conf.forwarder

This will also be needed by build nodes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoAdd tarball_parallel_installation option
Martin Schwenke [Thu, 26 Aug 2021 08:12:24 +0000 (18:12 +1000)]
Add tarball_parallel_installation option

This defaults to true and triggers the optimisation where the binary
tarball is unpacked and the bootstrap script is run in parallel on all
necessary nodes.  Setting it to false causes unpack and bootstrap to
occur only in parallel for each type of node.

I'm hoping that setting it to false might help to avoid this:

  error: kvm run failed Bad address
  RAX=ffffffffa066df70 RBX=ffff908301046b00 RCX=ffff908301057680 RDX=000000000000000c
  RSI=ffff90834396fb60 RDI=ffff90834396fb60 RBP=000000000000000e RSP=ffffa65e807aba10
  R8 =0000000000030386 R9 =ffff90834396e000 R10=ffff9083bffb0000 R11=0000000000030380
  R12=ffff90834396fb60 R13=000000000000000d R14=0000000000000001 R15=fffff436810e5b80
  RIP=ffffffffa066df70 RFL=00010082 [--S----] CPL=0 II=0 A20=1 SMM=0 HLT=0
  ES =0000 0000000000000000 ffffffff 00c00000
  CS =0010 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA]
  SS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS   [-WA]
  DS =0000 0000000000000000 ffffffff 00c00000
  FS =0000 00007fd9a086c740 ffffffff 00c00000
  GS =0000 ffff9083bcc00000 ffffffff 00c00000
  LDT=0000 0000000000000000 ffffffff 00c00000
  TR =0040 fffffe0000003000 00004087 00008b00 DPL=0 TSS64-busy
  GDT=     fffffe0000001000 0000007f
  IDT=     fffffe0000000000 00000fff
  CR0=80050033 CR2=00007f3980124000 CR3=0000000003f06003 CR4=00370ef0
  DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000
  DR6=00000000ffff0ff0 DR7=0000000000000400
  EFER=0000000000000d01
  Code=10 6f c8 ff 83 2b 01 75 e3 31 c0 5b c3 0f 1f 80 00 00 00 00 <48> c7 07 00 00 00 00 48 89 fa 48 8d 7f 08 31 c0 48 c7 87 30 02 00 00 00 00 00 00 48 89 d1
  2021-08-26T08:08:30.446544Z qemu-system-x86_64: terminating on signal 15 from pid 1887 (/usr/sbin/libvirtd)

It seems to be a race that is more likely to occur when the host
machine is overloaded.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoansible/node: Disable systemd-resolved on AD node
Martin Schwenke [Thu, 26 Aug 2021 06:35:51 +0000 (16:35 +1000)]
ansible/node: Disable systemd-resolved on AD node

This is necessary on Fedora 34 so that the AD server can listen on the
DNS port.

There may be a better way...

2 years agoansible/node: Install ethtool on CTDB nodes
Martin Schwenke [Thu, 26 Aug 2021 02:17:34 +0000 (12:17 +1000)]
ansible/node: Install ethtool on CTDB nodes

Not installed on Fedora 34 Vagrant image.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoansible/node: Install authselect if missing on Red Hat
Martin Schwenke [Tue, 24 Aug 2021 04:31:44 +0000 (14:31 +1000)]
ansible/node: Install authselect if missing on Red Hat

Not installed on Fedora 34 Vagrant image.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoansible/node: Only do rsyslog config when rsyslog.conf exists
Martin Schwenke [Sun, 15 Aug 2021 06:53:26 +0000 (16:53 +1000)]
ansible/node: Only do rsyslog config when rsyslog.conf exists

On such platforms where rsyslog.conf doesn't exist (e.g. Fedora 34
Vagrant image), assume that logs can be extracted using journalctl.

An alternative would be to attempt to install rsyslog but let's try
this first.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoansible/node: Don't fail when disabling not-installed firewalld
Martin Schwenke [Sun, 15 Aug 2021 00:44:57 +0000 (10:44 +1000)]
ansible/node: Don't fail when disabling not-installed firewalld

Not installed on Fedora 34 Vagrant image.

Thanks https://stackoverflow.com/a/49161109.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoAdd environment variable AUTOCLUSTER_QEMU_GROUP
Martin Schwenke [Thu, 26 Aug 2021 04:38:42 +0000 (14:38 +1000)]
Add environment variable AUTOCLUSTER_QEMU_GROUP

This is an attempt to ensure that a fake cluster filesystem (9p,
virtiofs) and build/test directories are group writable by QEMU
processes.  Set this to the group that QEMU processes are run as.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoGeneralise mounting of host share
Martin Schwenke [Mon, 16 Aug 2021 07:28:56 +0000 (17:28 +1000)]
Generalise mounting of host share

Note that sharing all of /home in the vagrant step via 9p or virtiofs
makes /home/vagrant disappear, so bad things happen.  This may need to
be generalised further to a list of mounts so accommodate more
interesting cases.

The NFS-specific part can be further generalised to non-9p/virtiofs.
That can be done later.  At the moment just avoid an error on an
unwanted NFS mount failure.

Host setup part also needs tweaking.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoansible/node: Don't fail when chcon fails
Martin Schwenke [Thu, 26 Aug 2021 02:20:00 +0000 (12:20 +1000)]
ansible/node: Don't fail when chcon fails

SELinux is in permissive mode so this doesn't cause a problem.

The semantics are interesting when the cluster filesystem is a shared
directory from the host.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoSupport fake cluster filesystem types 9p and virtiofs
Martin Schwenke [Sat, 14 Aug 2021 11:12:20 +0000 (21:12 +1000)]
Support fake cluster filesystem types 9p and virtiofs

These provide a shared directory in guests so no actual cluster
filesystem is needed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoansible/node: Use a unique variable for AD samba-tool commands
Martin Schwenke [Thu, 26 Aug 2021 02:18:30 +0000 (12:18 +1000)]
ansible/node: Use a unique variable for AD samba-tool commands

Recent versions of Ansible generate a warning when an already in-use
variable is re-used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoansible/node: Install rquota config using copy module, not file
Martin Schwenke [Wed, 25 Aug 2021 11:54:07 +0000 (21:54 +1000)]
ansible/node: Install rquota config using copy module, not file

Recent versions of Ansible generate an error when the file module is
incorrectly used here.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoautocluster.py: Remove state directory on cluster destroy
Martin Schwenke [Thu, 26 Aug 2021 04:35:43 +0000 (14:35 +1000)]
autocluster.py: Remove state directory on cluster destroy

Dealing with an out-of-date state directory is too challenging when
doing development.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoautocluster.py: Simplify creation of state directory
Martin Schwenke [Thu, 26 Aug 2021 02:26:57 +0000 (12:26 +1000)]
autocluster.py: Simplify creation of state directory

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoautocluster.py: Use filter() to find timezone in clock file
Martin Schwenke [Sun, 15 Aug 2021 10:50:17 +0000 (20:50 +1000)]
autocluster.py: Use filter() to find timezone in clock file

This avoids flake8 warning:

  E741 ambiguous variable name 'l'

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoautocluster.py: Improve INSTALL_DIR default when run from source tree
Martin Schwenke [Sat, 14 Aug 2021 11:17:13 +0000 (21:17 +1000)]
autocluster.py: Improve INSTALL_DIR default when run from source tree

This now works when run via a symbolic link.

Signed-off-by: Martin Schwenke <martin@meltin.net>
2 years agoWIP Debian guest
Martin Schwenke [Thu, 12 Aug 2021 05:48:22 +0000 (15:48 +1000)]
WIP Debian guest

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoscripts: Create "latest" link in test directory
Martin Schwenke [Sun, 23 Aug 2020 10:36:26 +0000 (20:36 +1000)]
scripts: Create "latest" link in test directory

So that bootstrap output can be put there.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Move installation bootstrap logs to test directory
Martin Schwenke [Sun, 23 Aug 2020 10:26:52 +0000 (20:26 +1000)]
ansible/node: Move installation bootstrap logs to test directory

Create a test directory and put the bootstrap logs in a "latest"
subdirectory.

autocluster-test-ctdb puts its test output in the same test directory.
The plan is for that script to ensure that "latest" is always a link
to the current test directory.  This way all output relating to a test
cluster/run will be together.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoscripts: Update script names in README
Martin Schwenke [Thu, 20 Aug 2020 07:29:11 +0000 (17:29 +1000)]
scripts: Update script names in README

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoscripts: Copy logs if test cluster creation fails
Martin Schwenke [Wed, 19 Aug 2020 00:00:33 +0000 (10:00 +1000)]
scripts: Copy logs if test cluster creation fails

If the cluster had unhealthy nodes then this will help with debugging.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoscripts: Add autocluster-test-ctdb script autocluster-2.0
Martin Schwenke [Fri, 26 Jun 2020 11:48:40 +0000 (21:48 +1000)]
scripts: Add autocluster-test-ctdb script

samba_version.py by Amitay Isaacs <amitay@ozlabs.org>

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Install extra packages for CTDB testing
Martin Schwenke [Mon, 29 Jun 2020 10:38:29 +0000 (20:38 +1000)]
ansible/node: Install extra packages for CTDB testing

These could go into a "test" role but finer granularity might make
thing harder to understand.

CTDB really should complete the migration to ss.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Add extra build dependencies for GPFS kernel module
Martin Schwenke [Fri, 19 Jun 2020 04:18:04 +0000 (14:18 +1000)]
ansible/node: Add extra build dependencies for GPFS kernel module

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Add preliminary playbook to unpack binary tarball
Martin Schwenke [Tue, 30 Jun 2020 09:05:37 +0000 (19:05 +1000)]
ansible/node: Add preliminary playbook to unpack binary tarball

This is an optimisation that allows relevant nodes to have the binary
tarball unpacked and bootstrap script run in parallel.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Conditionally use tarball install in "nas" role
Martin Schwenke [Thu, 18 Jun 2020 04:34:25 +0000 (14:34 +1000)]
ansible/node: Conditionally use tarball install in "nas" role

This uses the ctdb_config_dir fact from the "ctdb" role.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Conditionally use tarball install in "ctdb" role
Martin Schwenke [Thu, 18 Jun 2020 04:30:23 +0000 (14:30 +1000)]
ansible/node: Conditionally use tarball install in "ctdb" role

This also sets up a ctdb_config_dir fact that can also be used in the
"nas" role.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Conditionally use tarball install in "ad" role
Martin Schwenke [Tue, 16 Jun 2020 03:52:27 +0000 (13:52 +1000)]
ansible/node: Conditionally use tarball install in "ad" role

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoautocluster: Add tbuild node type
Martin Schwenke [Mon, 25 May 2020 08:17:37 +0000 (18:17 +1000)]
autocluster: Add tbuild node type

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Add tbuild node type
Martin Schwenke [Mon, 25 May 2020 08:16:01 +0000 (18:16 +1000)]
ansible/node: Add tbuild node type

This node type downloads a tarball and builds clustered Samba.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Add tarball_common role
Martin Schwenke [Tue, 16 Jun 2020 09:09:34 +0000 (19:09 +1000)]
ansible/node: Add tarball_common role

Given a source tarball:

* build a binary tarball
* install binary tarball
* setup binary install for AD node
* setup binary install for NAS node

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoconfig: Add configuration variables for building from tarball(s)
Martin Schwenke [Mon, 25 May 2020 03:30:17 +0000 (13:30 +1000)]
config: Add configuration variables for building from tarball(s)

Tarballs should be on a (e.g. NFS) filesystem accessible by the node,
so that output files can be placed in directories alongside them.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Handle new style /etc/nfs.conf autocluster-1.8
Martin Schwenke [Sun, 12 Jul 2020 09:02:12 +0000 (19:02 +1000)]
ansible/node: Handle new style /etc/nfs.conf

This also depends on CTDB's statd-callout to be fixed to get
NFS_HOSTNAME using nfsconf.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Update modern rsyslog.conf for high resolution timestamp
Martin Schwenke [Sun, 12 Jul 2020 06:50:52 +0000 (16:50 +1000)]
ansible/node: Update modern rsyslog.conf for high resolution timestamp

Bizarrely, this setting can't be changed in an include file.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agobuild: Fix Makefile
Amitay Isaacs [Thu, 2 Jul 2020 07:40:44 +0000 (17:40 +1000)]
build: Fix Makefile

Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
3 years agobuild, doc: Add COPYING, clarify license autocluster-1.7
Martin Schwenke [Wed, 24 Jun 2020 23:49:21 +0000 (09:49 +1000)]
build, doc: Add COPYING, clarify license

Autocluster has always been GPL, with the Python script tagged as
GPLv3, but this makes it obvious and removes ambiguity.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoautocluster: Add copyright message to main script
Martin Schwenke [Wed, 24 Jun 2020 23:44:41 +0000 (09:44 +1000)]
autocluster: Add copyright message to main script

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Modernise NFS service management
Martin Schwenke [Tue, 23 Jun 2020 01:58:59 +0000 (11:58 +1000)]
ansible/node: Modernise NFS service management

nfs-server and rpc-statd are available on CentOS 7, and CTDB already
knows about these service names, so changing these is safe.

In CentOS >=8 the rpc-quota service is split from the quota
package (required by nfs-utils) into a new quota-rpc package.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoautocluster: Only retry "create" and "setup" steps during "build"
Martin Schwenke [Tue, 23 Jun 2020 01:23:16 +0000 (11:23 +1000)]
autocluster: Only retry "create" and "setup" steps during "build"

"create" and "setup" are used during development when the failures are
usually programming errors rather than intermittent errors, so don't
retry when those steps are run separately.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agobuild: Improve generation of version-dependant files
Martin Schwenke [Mon, 22 Jun 2020 23:33:27 +0000 (09:33 +1000)]
build: Improve generation of version-dependant files

There seems to be no sane way of getting this right without generating
a version file.

This still isn't quite right but it is better.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agodoc: Add a small development hint to README
Martin Schwenke [Fri, 19 Jun 2020 10:00:13 +0000 (20:00 +1000)]
doc: Add a small development hint to README

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Support authselect
Martin Schwenke [Mon, 22 Jun 2020 10:37:50 +0000 (20:37 +1000)]
ansible/node: Support authselect

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Restructure "nas" role
Martin Schwenke [Thu, 18 Jun 2020 04:17:11 +0000 (14:17 +1000)]
ansible/node: Restructure "nas" role

Give tasks clearer names and split out installation of Samba packages.
There's also some redundant indirection that will allow easy addition
of authselect in future.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Restructure "ctdb" role
Martin Schwenke [Thu, 18 Jun 2020 03:35:10 +0000 (13:35 +1000)]
ansible/node: Restructure "ctdb" role

Give tasks clearer names and split out installation of the CTDB
package and supporting package(s).

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agovagrant: Fix https_proxy autocluster-1.6
Martin Schwenke [Tue, 26 May 2020 01:44:49 +0000 (11:44 +1000)]
vagrant: Fix https_proxy

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agobuild: Be more aggressive about updating ChangeLog
Martin Schwenke [Tue, 26 May 2020 00:23:02 +0000 (10:23 +1000)]
build: Be more aggressive about updating ChangeLog

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Do not disable Network Manager
Martin Schwenke [Tue, 26 May 2020 03:22:56 +0000 (13:22 +1000)]
ansible/node: Do not disable Network Manager

On modern Red Hat distros all interfaces are configured via Network
Manager.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Use mount module to mount /home
Martin Schwenke [Tue, 26 May 2020 03:17:19 +0000 (13:17 +1000)]
ansible/node: Use mount module to mount /home

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Switch group names from <type>-nodes to <type>_nodes
Martin Schwenke [Thu, 21 May 2020 07:09:10 +0000 (17:09 +1000)]
ansible/node: Switch group names from <type>-nodes to <type>_nodes

This warning:

  [DEPRECATION WARNING]: The TRANSFORM_INVALID_GROUP_CHARS settings is set to
  allow bad characters in group names by default, this will change, but still be
  user configurable on deprecation. This feature will be removed in version 2.10.
   Deprecation warnings can be disabled by setting deprecation_warnings=False in
  ansible.cfg.

According to

  https://github.com/ansible/ansible/issues/56930#issuecomment-498659628

'-' in a group name is invalid and '_' is valid.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Don't allow test join to wait for password
Martin Schwenke [Tue, 19 May 2020 04:20:01 +0000 (14:20 +1000)]
ansible/node: Don't allow test join to wait for password

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Handle both Python 2 and 3 versions of SELinux package
Martin Schwenke [Mon, 18 May 2020 05:18:35 +0000 (15:18 +1000)]
ansible/node: Handle both Python 2 and 3 versions of SELinux package

Have tried "neater" ways involving setting a fact such as rh7
containing a bool value to keep the logic compact.  However, figuring
out how to treat what ends up as a string "True" or "False" as a bool
seems insanely difficult.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoautocluster: Retry setup stage
Martin Schwenke [Thu, 21 May 2020 07:33:23 +0000 (17:33 +1000)]
autocluster: Retry setup stage

Ansible sometimes find that nodes are unreachable even though it is
possible to ssh to them manually.  Perhaps a retry will work.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoautocluster: Avoid an error if no are repositories defined
Martin Schwenke [Mon, 18 May 2020 03:21:36 +0000 (13:21 +1000)]
autocluster: Avoid an error if no are repositories defined

This allows standard distribution repositories to be used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agovagrant: Set networks to be controlled by NetworkManager
Martin Schwenke [Mon, 18 May 2020 01:28:05 +0000 (11:28 +1000)]
vagrant: Set networks to be controlled by NetworkManager

CentOS >= 8 always controls networks using Network Manager, so setting
this to "off" causes Vagrant failure.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/host: Use newer Vagrant on CentOS 7
Martin Schwenke [Tue, 26 May 2020 03:29:27 +0000 (13:29 +1000)]
ansible/host: Use newer Vagrant on CentOS 7

Also update task names so they better reflect idempotence.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/host: Ensure libvirtd is installed and running on CentOS 7
Martin Schwenke [Tue, 26 May 2020 03:28:46 +0000 (13:28 +1000)]
ansible/host: Ensure libvirtd is installed and running on CentOS 7

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/host: Use Python3 on CentOS 7
Martin Schwenke [Fri, 15 May 2020 09:45:12 +0000 (19:45 +1000)]
ansible/host: Use Python3 on CentOS 7

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoautocluster: Use Python 3
Martin Schwenke [Tue, 12 May 2020 05:44:47 +0000 (15:44 +1000)]
autocluster: Use Python 3

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/host: Add fedora32 host setup script
Martin Schwenke [Tue, 12 May 2020 05:43:59 +0000 (15:43 +1000)]
ansible/host: Add fedora32 host setup script

This is a minimally changed copy of the centos7 script.  The only
change is to install the distro vagrant package.

Signed-off-by: Martin Schwenke <martin@meltin.net>
3 years agoansible/node: Install libunwind-devel on build nodes
Martin Schwenke [Wed, 4 Mar 2020 23:34:13 +0000 (10:34 +1100)]
ansible/node: Install libunwind-devel on build nodes

This provides better backtraces if ctdbd crashes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
4 years agobuild: Improve building of RPM autocluster-1.5
Martin Schwenke [Mon, 16 Dec 2019 06:18:51 +0000 (17:18 +1100)]
build: Improve building of RPM

Signed-off-by: Martin Schwenke <martin@meltin.net>
4 years agoansible: Default to not checking GPG signatures on distro YUM repos autocluster-1.4
Martin Schwenke [Mon, 16 Dec 2019 02:41:55 +0000 (13:41 +1100)]
ansible: Default to not checking GPG signatures on distro YUM repos

The official CentOS 7 boxes not not contain the necessary public keys
so, rather than forcing this to be overridden in configuration, just
default to 'no'.

Signed-off-by: Martin Schwenke <martin@meltin.net>
4 years agoansible: build nodes must have gcc installed
Martin Schwenke [Mon, 9 Dec 2019 23:45:35 +0000 (10:45 +1100)]
ansible: build nodes must have gcc installed

Signed-off-by: Martin Schwenke <martin@meltin.net>
4 years agovagrant: Use memory size setting
Martin Schwenke [Wed, 4 Dec 2019 23:52:13 +0000 (10:52 +1100)]
vagrant: Use memory size setting

This doesn't look to have been a vagrant-libvirt bug.  It looks to
have been the use of "mem" instead of "memory" as the configuration
key.

Signed-off-by: Martin Schwenke <martin@meltin.net>
4 years agoansible: Ensure GPFS build prerequisites are installed
Martin Schwenke [Wed, 4 Dec 2019 05:00:14 +0000 (16:00 +1100)]
ansible: Ensure GPFS build prerequisites are installed

Signed-off-by: Martin Schwenke <martin@meltin.net>
4 years agoautocluster: Do not run destroy if generated config does not exist autocluster-1.3
Martin Schwenke [Tue, 8 Oct 2019 04:50:55 +0000 (15:50 +1100)]
autocluster: Do not run destroy if generated config does not exist

When build is run, skip destroy if the file doesn't exist.  This
avoids a failure on the initial run.

Error when destroy is run explicitly, since the error from Vagrant is
very vague.

Signed-off-by: Martin Schwenke <martin@meltin.net>
4 years agoautocluster: Factor out construction of generated config file name
Martin Schwenke [Tue, 8 Oct 2019 04:48:45 +0000 (15:48 +1100)]
autocluster: Factor out construction of generated config file name

Signed-off-by: Martin Schwenke <martin@meltin.net>
4 years agoautocluster: Fix typo in usage message
Martin Schwenke [Tue, 8 Oct 2019 04:47:24 +0000 (15:47 +1100)]
autocluster: Fix typo in usage message

Signed-off-by: Martin Schwenke <martin@meltin.net>