From: Scott Mayhew <smayhew@redhat.com>
To: kdevops@lists.linux.dev
Subject: [PATCH v2 08/10] gen_hosts/gen_nodes: clean up nfsd-related stuff
Date: Sat, 9 Mar 2024 18:36:01 -0500 [thread overview]
Message-ID: <20240309233603.1306533-9-smayhew@redhat.com> (raw)
In-Reply-To: <20240309233603.1306533-1-smayhew@redhat.com>
First, instead of checking if nfsd_threads is defined, create new
variable kdevops_nfsd_enable and use that.
Second, if nfsd is not enabled, then there shouldn't be "nfsd" and
"nfsd:vars" stanzas in the hosts file, so adjust the placement of the
conditionals in the templates accordingly.
No change in behavior.
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
playbooks/roles/gen_hosts/defaults/main.yml | 2 ++
playbooks/roles/gen_hosts/templates/fstests.j2 | 4 ++--
playbooks/roles/gen_hosts/templates/gitr.j2 | 4 ++--
playbooks/roles/gen_hosts/templates/hosts.j2 | 6 +++---
playbooks/roles/gen_nodes/defaults/main.yml | 1 +
playbooks/roles/gen_nodes/tasks/main.yml | 6 +++---
scripts/nfsd.Makefile | 1 +
7 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/playbooks/roles/gen_hosts/defaults/main.yml b/playbooks/roles/gen_hosts/defaults/main.yml
index ff1212a5..0c49cde0 100644
--- a/playbooks/roles/gen_hosts/defaults/main.yml
+++ b/playbooks/roles/gen_hosts/defaults/main.yml
@@ -30,3 +30,5 @@ is_fstests: False
fstests_fstyp: "bogus"
fs_config_role_path: "/dev/null"
fs_config_data: "[section_1]"
+
+kdevops_nfsd_enable: False
diff --git a/playbooks/roles/gen_hosts/templates/fstests.j2 b/playbooks/roles/gen_hosts/templates/fstests.j2
index 74057952..b5111ad3 100644
--- a/playbooks/roles/gen_hosts/templates/fstests.j2
+++ b/playbooks/roles/gen_hosts/templates/fstests.j2
@@ -21,9 +21,9 @@ ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
{% endif %}
[dev:vars]
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+{% if kdevops_nfsd_enable %}
[nfsd]
-{% if nfsd_threads is defined %}
{{ kdevops_hosts_prefix }}-nfsd
-{% endif %}
[nfsd:vars]
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+{% endif %}
diff --git a/playbooks/roles/gen_hosts/templates/gitr.j2 b/playbooks/roles/gen_hosts/templates/gitr.j2
index ba144bfd..d6998bd8 100644
--- a/playbooks/roles/gen_hosts/templates/gitr.j2
+++ b/playbooks/roles/gen_hosts/templates/gitr.j2
@@ -15,9 +15,9 @@ ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
{% endif %}
[dev:vars]
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+{% if kdevops_nfsd_enable %}
[nfsd]
-{% if nfsd_threads is defined %}
{{ kdevops_hosts_prefix }}-nfsd
-{% endif %}
[nfsd:vars]
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+{% endif %}
diff --git a/playbooks/roles/gen_hosts/templates/hosts.j2 b/playbooks/roles/gen_hosts/templates/hosts.j2
index 57325112..c22b2e39 100644
--- a/playbooks/roles/gen_hosts/templates/hosts.j2
+++ b/playbooks/roles/gen_hosts/templates/hosts.j2
@@ -14,7 +14,7 @@ write-your-own-template-for-your-workflow-and-task
{% if kdevops_baseline_and_dev == True %}
{{ kdevops_hosts_prefix }}-dev
{% endif %}
-{% if nfsd_threads is defined %}
+{% if kdevops_nfsd_enable %}
{{ kdevops_hosts_prefix }}-nfsd
{% endif %}
[all:vars]
@@ -29,10 +29,10 @@ ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
{% endif %}
[dev:vars]
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
+{% if kdevops_nfsd_enable %}
[nfsd]
-{% if nfsd_threads is defined %}
{{ kdevops_hosts_prefix }}-nfsd
-{% endif %}
[nfsd:vars]
ansible_python_interpreter = "{{ kdevops_python_interpreter }}"
{% endif %}
+{% endif %}
diff --git a/playbooks/roles/gen_nodes/defaults/main.yml b/playbooks/roles/gen_nodes/defaults/main.yml
index 0e41e0ad..51491d33 100644
--- a/playbooks/roles/gen_nodes/defaults/main.yml
+++ b/playbooks/roles/gen_nodes/defaults/main.yml
@@ -12,6 +12,7 @@ kdevops_workflow_enable_cxl: False
kdevops_workflow_enable_pynfs: False
kdevops_workflow_enable_gitr: False
kdevops_workflow_enable_selftests: False
+kdevops_nfsd_enable: False
virtualbox_provider: False
libvirt_provider: False
diff --git a/playbooks/roles/gen_nodes/tasks/main.yml b/playbooks/roles/gen_nodes/tasks/main.yml
index 2f5c48b6..288dbdca 100644
--- a/playbooks/roles/gen_nodes/tasks/main.yml
+++ b/playbooks/roles/gen_nodes/tasks/main.yml
@@ -47,13 +47,13 @@
set_fact:
nfsd_nodes: "{{ [ kdevops_host_prefix + '-nfsd' ] }}"
when:
- - nfsd_threads is defined
+ - kdevops_nfsd_enable|bool
- name: Add an nfs server if one was selected
set_fact:
generic_nodes: "{{ generic_nodes + nfsd_nodes }}"
when:
- - nfsd_threads is defined
+ - kdevops_nfsd_enable|bool
- name: Set fstests config file variable for {{ fstests_fstyp }}
set_fact:
@@ -215,7 +215,7 @@
fstests_enabled_nodes: "{{ fstests_enabled_nodes + nfsd_nodes }}"
when:
- is_fstests|bool
- - nfsd_threads is defined
+ - kdevops_nfsd_enable|bool
- name: Generate the fstests kdevops nodes file using {{ kdevops_nodes_template }} as jinja2 source template
tags: [ 'hosts' ]
diff --git a/scripts/nfsd.Makefile b/scripts/nfsd.Makefile
index f534f4ff..3accc879 100644
--- a/scripts/nfsd.Makefile
+++ b/scripts/nfsd.Makefile
@@ -6,6 +6,7 @@ NFSD_EXTRA_ARGS += nfsd_export_fstype='$(subst ",,$(CONFIG_NFSD_EXPORT_FSTYPE))'
NFSD_EXTRA_ARGS += nfsd_export_path='$(subst ",,$(CONFIG_NFSD_EXPORT_PATH))'
NFSD_EXTRA_ARGS += nfsd_threads=$(CONFIG_NFSD_THREADS)
NFSD_EXTRA_ARGS += nfsd_lease_time=$(CONFIG_NFSD_LEASE_TIME)
+NFSD_EXTRA_ARGS += kdevops_nfsd_enable=True
EXTRA_VAR_INPUTS += extend-extra-args-nfsd
--
2.43.0
next prev parent reply other threads:[~2024-03-09 23:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-09 23:35 [PATCH v2 00/10] add initial support for testing nfs with krb5 Scott Mayhew
2024-03-09 23:35 ` [PATCH v2 01/10] nfsd: make sure the appropriate fsprogs package is installed Scott Mayhew
2024-03-09 23:35 ` [PATCH v2 02/10] update_etc_hosts: fix up hostnames on debian guestfs hosts Scott Mayhew
2024-03-09 23:35 ` [PATCH v2 03/10] nfsd: use EXTRA_VAR_INPUTS for export options Scott Mayhew
2024-03-09 23:35 ` [PATCH v2 04/10] devconfig: set /etc/hostname earlier Scott Mayhew
2024-03-09 23:35 ` [PATCH v2 05/10] nfsd: add a pipefs-directory config to nfs.conf Scott Mayhew
2024-03-09 23:35 ` [PATCH v2 06/10] bringup: move the update_etc_hosts task to run early Scott Mayhew
2024-03-09 23:36 ` [PATCH v2 07/10] bringup: clean up the nfs-related make targets Scott Mayhew
2024-03-09 23:36 ` Scott Mayhew [this message]
2024-03-09 23:36 ` [PATCH v2 09/10] kconfigs: clean up Kconfig.bringup.goals Scott Mayhew
2024-03-09 23:36 ` [PATCH v2 10/10] fstests/nfs: add krb5 support Scott Mayhew
2024-03-11 12:57 ` [PATCH v2 00/10] add initial support for testing nfs with krb5 Jeff Layton
2024-03-11 22:05 ` Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240309233603.1306533-9-smayhew@redhat.com \
--to=smayhew@redhat.com \
--cc=kdevops@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox