Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BEE44EB34 for ; Sat, 9 Mar 2024 23:36:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710027369; cv=none; b=JUBx2fAoUF8f0OkOgedyOzXb6MlVVWkMBD/gRH/axm6lgqsN5UR7txnKOWpv2o3XCEXlgr7R2C0p72Fbh2kaVNoQSQWV1wqsfGfTCHGpPC46KHmwyTm5bqCmCn3ILbUJp5qJiUdDYJw1f5NE9C7EnUymvGjfIpLGSiG3zBRqQy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710027369; c=relaxed/simple; bh=P+TqxQy9UNg2wlDJSPb2AqCDlHiMUT72ymITw5OizQw=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JbtsCdbknWhdcnokjEhEIVRNYGv5HPguSmTilBjXwCMSYH3yHwjR5gq6z2a3zfQJRahnpHXtJHA/8iX9Y/jicJT577jffL24ommUkWjxEe6KtAhVVmwrJQXb5Z3PxmgnmeLew/x08QtHfFBatWnjGjZV2Tbf1WP9L23uvVHuIug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JFXK2tfz; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JFXK2tfz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710027366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V8OfQViuzC2TI3EIx67Jw2PdTig/5nN9dGalvpIYqXs=; b=JFXK2tfz8d5JzVtMZaHhvgwT2OrevOZS3brWziMBj3BLKrxCXVkz61xBI3GJ17ILDbaKhH XiDiYXFt1zXEbLLaWuuiwoAzXKGmBt96tT6ACPZTy02OaZ+rsr396TsJku6P6ctwghgFOF oB6nZeVjOOMz+IJVV0jLvI5yrTZytSc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-361-TElycKJeOMeDp1to4J6IeA-1; Sat, 09 Mar 2024 18:36:04 -0500 X-MC-Unique: TElycKJeOMeDp1to4J6IeA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 41B37185A783 for ; Sat, 9 Mar 2024 23:36:04 +0000 (UTC) Received: from aion.redhat.com (unknown [10.22.16.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D46FC15772 for ; Sat, 9 Mar 2024 23:36:04 +0000 (UTC) Received: from aion.redhat.com (localhost [IPv6:::1]) by aion.redhat.com (Postfix) with ESMTP id B83A412D1F7 for ; Sat, 9 Mar 2024 18:36:03 -0500 (EST) From: Scott Mayhew To: kdevops@lists.linux.dev Subject: [PATCH v2 00/10] add initial support for testing nfs with krb5 Date: Sat, 9 Mar 2024 18:35:53 -0500 Message-ID: <20240309233603.1306533-1-smayhew@redhat.com> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true These patches add support for running fstests on NFS with krb5. There are numerous other fixes and cleanups, but the bulk of the work is in patch 10. There are a handful of new Kconfig options (KDEVOPS_SETUP_KRB5, KRB5_REALM, KRB5_ADMIN_PW, and FSTESTS_NFS_AUTH_FLAVOR) as well as some new Makefile targets ("kdc" and "krb5", both of which get executed automatically). During "make bringup", a KDC is spun up automatically, and all the necessary package dependencies are installed, keys are generated, and the keytabs are updated on the NFS client and server VMs. Right now you can only use krb5 with the fstests workflow, but it should be straightforward to add it to the other NFS-related workflows. -Scott Changes since v1: - Added a pipefs-directory config in nfs.conf to fix a debian issue. - Moved update_etc_hosts target to run as an early bringup dependency. - Cleaned up the top level Makefile and bringup.Makefile by moving some directives into lower level makefiles for nfsd, ktls, siw, and krb5. - Added a kdevops_nfsd_enable variable and use that instead of checking if nfsd_threads is defined in several places. - Cleaned up the hosts file by making sure "nfsd" and "nfsd:vars" stanzas do not get created if nfsd isn't enabled. - Cleaned up the hosts file by making sure "krb5", "krb5:vars", "kdc", and "kdc:vars" stanzas do not get created if krb5 isn't enabled. - Cleaned up Kconfig.bringup.goals by moving some directives into lower level kconfigs for nfsd and krb5. - Added a kdevops_krb5_enable variable and use that instead of checking if krb5_realm is defined in several places. - Folded the kdc.Makefile into the krb5.Makefile (there's no reason for them to have two separate makefiles). - Added some default vars settings for the KDC. - Got rid of some unnecessary tasks in the krb5 role that check to see if a principal existed before creating it, and also before adding it to the keytab (in reality these checks were just triggering errors that needed to be ignored). - Forced the restart rpc.gssd task in the krb5 role to only run on the nfsd server (because rpc.gssd isn't installed on the clients yet at the point when the krb5 role is executed). - Made the krb5 target to run automatically as a late bringup dependency. Scott Mayhew (10): nfsd: make sure the appropriate fsprogs package is installed update_etc_hosts: fix up hostnames on debian guestfs hosts nfsd: use EXTRA_VAR_INPUTS for export options devconfig: set /etc/hostname earlier nfsd: add a pipefs-directory config to nfs.conf bringup: move the update_etc_hosts task to run early bringup: clean up the nfs-related make targets gen_hosts/gen_nodes: clean up nfsd-related stuff kconfigs: clean up Kconfig.bringup.goals fstests/nfs: add krb5 support Makefile | 10 +- kconfigs/Kconfig.bringup.goals | 13 +- kconfigs/Kconfig.krb5 | 25 ++++ kconfigs/Kconfig.nfsd | 16 +++ playbooks/kdc.yml | 4 + playbooks/krb5.yml | 4 + playbooks/roles/devconfig/tasks/main.yml | 21 ++-- .../fstests/tasks/install-deps/suse/main.yml | 10 ++ playbooks/roles/fstests/tasks/main.yml | 41 ++++++ .../roles/fstests/templates/nfs/nfsmount.conf | 2 + playbooks/roles/gen_hosts/defaults/main.yml | 3 + .../roles/gen_hosts/templates/fstests.j2 | 19 ++- playbooks/roles/gen_hosts/templates/gitr.j2 | 4 +- playbooks/roles/gen_hosts/templates/hosts.j2 | 6 +- playbooks/roles/gen_nodes/defaults/main.yml | 2 + playbooks/roles/gen_nodes/tasks/main.yml | 25 +++- .../kdc/tasks/install-deps/debian/main.yml | 11 ++ .../roles/kdc/tasks/install-deps/main.yml | 12 ++ .../kdc/tasks/install-deps/redhat/main.yml | 16 +++ .../kdc/tasks/install-deps/suse/main.yml | 10 ++ playbooks/roles/kdc/tasks/main.yml | 119 ++++++++++++++++++ playbooks/roles/kdc/templates/kadm5.acl.j2 | 1 + playbooks/roles/kdc/templates/kdc.conf.j2 | 15 +++ playbooks/roles/kdc/templates/krb5.conf.j2 | 29 +++++ playbooks/roles/kdc/vars/Debian.yml | 7 ++ playbooks/roles/kdc/vars/RedHat.yml | 7 ++ playbooks/roles/kdc/vars/Suse.yml | 7 ++ playbooks/roles/kdc/vars/default.yml | 7 ++ playbooks/roles/kdc/vars/main.yml | 1 + .../krb5/tasks/install-deps/debian/main.yml | 9 ++ .../roles/krb5/tasks/install-deps/main.yml | 12 ++ .../krb5/tasks/install-deps/redhat/main.yml | 15 +++ .../krb5/tasks/install-deps/suse/main.yml | 16 +++ playbooks/roles/krb5/tasks/main.yml | 52 ++++++++ playbooks/roles/krb5/templates/krb5.conf.j2 | 31 +++++ .../nfsd/tasks/install-deps/debian/main.yml | 33 ++++- .../nfsd/tasks/install-deps/redhat/main.yml | 31 +++-- .../nfsd/tasks/install-deps/suse/main.yml | 32 ++++- playbooks/roles/nfsd/templates/nfs.conf.j2 | 3 + playbooks/roles/nfsd/vars/Debian.yml | 13 ++ playbooks/roles/nfsd/vars/RedHat.yml | 14 +++ playbooks/roles/nfsd/vars/Suse.yml | 12 ++ .../roles/update_etc_hosts/tasks/main.yml | 26 +++- playbooks/update_etc_hosts.yml | 1 + scripts/bringup.Makefile | 19 +-- scripts/krb5.Makefile | 22 ++++ scripts/ktls.Makefile | 7 ++ scripts/nfsd.Makefile | 17 ++- scripts/siw.Makefile | 6 + scripts/update_etc_hosts.Makefile | 7 ++ workflows/fstests/nfs/Kconfig | 29 +++++ workflows/fstests/nfs/Makefile | 4 + 52 files changed, 778 insertions(+), 80 deletions(-) create mode 100644 kconfigs/Kconfig.krb5 create mode 100644 playbooks/kdc.yml create mode 100644 playbooks/krb5.yml create mode 100644 playbooks/roles/fstests/templates/nfs/nfsmount.conf create mode 100644 playbooks/roles/kdc/tasks/install-deps/debian/main.yml create mode 100644 playbooks/roles/kdc/tasks/install-deps/main.yml create mode 100644 playbooks/roles/kdc/tasks/install-deps/redhat/main.yml create mode 100644 playbooks/roles/kdc/tasks/install-deps/suse/main.yml create mode 100644 playbooks/roles/kdc/tasks/main.yml create mode 100644 playbooks/roles/kdc/templates/kadm5.acl.j2 create mode 100644 playbooks/roles/kdc/templates/kdc.conf.j2 create mode 100644 playbooks/roles/kdc/templates/krb5.conf.j2 create mode 100644 playbooks/roles/kdc/vars/Debian.yml create mode 100644 playbooks/roles/kdc/vars/RedHat.yml create mode 100644 playbooks/roles/kdc/vars/Suse.yml create mode 100644 playbooks/roles/kdc/vars/default.yml create mode 100644 playbooks/roles/kdc/vars/main.yml create mode 100644 playbooks/roles/krb5/tasks/install-deps/debian/main.yml create mode 100644 playbooks/roles/krb5/tasks/install-deps/main.yml create mode 100644 playbooks/roles/krb5/tasks/install-deps/redhat/main.yml create mode 100644 playbooks/roles/krb5/tasks/install-deps/suse/main.yml create mode 100644 playbooks/roles/krb5/tasks/main.yml create mode 100644 playbooks/roles/krb5/templates/krb5.conf.j2 create mode 100644 playbooks/roles/nfsd/vars/Debian.yml create mode 100644 playbooks/roles/nfsd/vars/RedHat.yml create mode 100644 playbooks/roles/nfsd/vars/Suse.yml create mode 100644 scripts/krb5.Makefile create mode 100644 scripts/update_etc_hosts.Makefile -- 2.43.0