fstests: Request inferred user
RFC PATCH 1/1 fstests: Request inferred user
Currently when running make fstests for bare-metal setups, the data_user 'vagrant' is set for the /data partition. This is currently set as the default data_user. We have the option to edit this in extra_vars.yml.
make linux checks for an inferred user prior to setting the uid/gid for the /data partition.
In the situation where we don't add the 'vagrant' user to the bare-metal, we get a "user does not exist" on make fstests.
In both cases we do not want to switch users between the two targets, nor do we want to necessarily ensure that the 'vagrant' user exists on the metal. Therefore, request the inferred user on make fstests.
---
Since this is essentially in two places, I figure this should be more generic and then included in other make targets like cxl. But this is to get the discussion going if this or some other generic approach is preferred.
--- playbooks/roles/fstests/tasks/main.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
playbooks/roles/fstests/tasks/main.yml +37 -0
@@ -10,6 +10,43 @@ skip: true tags: vars +- name: Get username we are using + command: + cmd: whoami + register: username_on_target + when: + - infer_uid_and_group|bool + +- name: Set target user as a fact + set_fact: + target_user: "{{ username_on_target.stdout }}" + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target user + getent: + database: passwd + key: "{{ target_user }}" + register: getent_running_user + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target group + getent: + database: group + key: "{{ target_user }}" + register: getent_on_group + when: + - infer_uid_and_group|bool + +- name: Override user and group with inferred settings if feature is enabled + set_fact: + user: "hplip" + data_user: "{{ target_user }}" + data_group: "{{ ((getent_on_group.values() | first).values() | first).keys() | first }}" + when: + - infer_uid_and_group|bool + - include_role: name: create_data_partition tags: [ 'oscheck', 'data_partition' ]
Signature · 1 line
2.34.1
Quoted 54 lines · Frederick Lawler
Currently when running make fstests for bare-metal setups, the
data_user'vagrant' is set for the /data partition. This is currently set as the defaultdata_user. We have the option to edit this in extra_vars.yml.make linux checks for an inferred user prior to setting the uid/gid for the /data partition.
In the situation where we don't add the 'vagrant' user to the bare-metal, we get a "user does not exist" on make fstests.
In both cases we do not want to switch users between the two targets, nor do we want to necessarily ensure that the 'vagrant' user exists on the metal. Therefore, request the inferred user on make fstests.
Signed-off-by Frederick Lawler <[email protected]>---
Since this is essentially in two places, I figure this should be more generic and then included in other make targets like cxl. But this is to get the discussion going if this or some other generic approach is preferred.--- playbooks/roles/fstests/tasks/main.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)playbooks/roles/fstests/tasks/main.yml +22
-0@@ -10,6 +10,43 @@ skip: true tags: vars +- name: Get username we are using + command: + cmd: whoami + register: username_on_target + when: + - infer_uid_and_group|bool + +- name: Set target user as a fact + set_fact: + target_user: "{{ username_on_target.stdout }}" + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target user + getent: + database: passwd + key: "{{ target_user }}" + register: getent_running_user + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target group
playbooks/roles/fstests/tasks/main.yml line 44
Quoted 10 lines
playbooks/roles/fstests/tasks/main.yml +10
-0+ getent: + database: group + key: "{{ target_user }}" + register: getent_on_group + when: + - infer_uid_and_group|bool + +- name: Override user and group with inferred settings if feature is enabled + set_fact: + user: "hplip"
Why "hplip" here?
Quoted 8 lines
playbooks/roles/fstests/tasks/main.yml +5
-0+ data_user: "{{ target_user }}" + data_group: "{{ ((getent_on_group.values() | first).values() | first).keys() | first }}" + when: + - infer_uid_and_group|bool + - include_role: name: create_data_partition tags: [ 'oscheck', 'data_partition' ]
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 59 lines · Jeff Layton
Quoted 58 lines · Frederick Lawler
Currently when running make fstests for bare-metal setups, the
data_user'vagrant' is set for the /data partition. This is currently set as the defaultdata_user. We have the option to edit this in extra_vars.yml.make linux checks for an inferred user prior to setting the uid/gid for the /data partition.
In the situation where we don't add the 'vagrant' user to the bare-metal, we get a "user does not exist" on make fstests.
In both cases we do not want to switch users between the two targets, nor do we want to necessarily ensure that the 'vagrant' user exists on the metal. Therefore, request the inferred user on make fstests.
Signed-off-by Frederick Lawler <[email protected]>---
Since this is essentially in two places, I figure this should be more generic and then included in other make targets like cxl. But this is to get the discussion going if this or some other generic approach is preferred.--- playbooks/roles/fstests/tasks/main.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)playbooks/roles/fstests/tasks/main.yml +26
-0@@ -10,6 +10,43 @@ skip: true tags: vars +- name: Get username we are using + command: + cmd: whoami + register: username_on_target + when: + - infer_uid_and_group|bool + +- name: Set target user as a fact + set_fact: + target_user: "{{ username_on_target.stdout }}" + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target user + getent: + database: passwd + key: "{{ target_user }}" + register: getent_running_user + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target group + getent: + database: group + key: "{{ target_user }}" + register: getent_on_group
Quoted 8 lines
playbooks/roles/fstests/tasks/main.yml line 44
Quoted 6 lines
playbooks/roles/fstests/tasks/main.yml +6
-0+ when: + - infer_uid_and_group|bool + +- name: Override user and group with inferred settings if feature is enabled + set_fact: + user: "hplip"Why "hplip" here?
This was mostly copy/pasted from ./playbooks/roles/bootlinux/tasks/main.yml. I see it was introduced in commit f10add06446b ("kdevops: remove ansible galaxy dependency") for that file, but I'm unclear the use there. I'd like to know as well.
Quoted 12 lines
Quoted 9 lines
playbooks/roles/fstests/tasks/main.yml +5
-0+ data_user: "{{ target_user }}" + data_group: "{{ ((getent_on_group.values() | first).values() | first).keys() | first }}" + when: + - infer_uid_and_group|bool + - include_role: name: create_data_partition tags: [ 'oscheck', 'data_partition' ]Signature · 1 line
Jeff Layton <[email protected]>
Fred
Quoted 69 lines · Frederick Lawler
Quoted 59 lines · Jeff Layton
Quoted 58 lines · Frederick Lawler
Currently when running make fstests for bare-metal setups, the
data_user'vagrant' is set for the /data partition. This is currently set as the defaultdata_user. We have the option to edit this in extra_vars.yml.make linux checks for an inferred user prior to setting the uid/gid for the /data partition.
In the situation where we don't add the 'vagrant' user to the bare-metal, we get a "user does not exist" on make fstests.
In both cases we do not want to switch users between the two targets, nor do we want to necessarily ensure that the 'vagrant' user exists on the metal. Therefore, request the inferred user on make fstests.
Signed-off-by Frederick Lawler <[email protected]>---
Since this is essentially in two places, I figure this should be more generic and then included in other make targets like cxl. But this is to get the discussion going if this or some other generic approach is preferred.--- playbooks/roles/fstests/tasks/main.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)playbooks/roles/fstests/tasks/main.yml +26
-0@@ -10,6 +10,43 @@ skip: true tags: vars +- name: Get username we are using + command: + cmd: whoami + register: username_on_target + when: + - infer_uid_and_group|bool + +- name: Set target user as a fact + set_fact: + target_user: "{{ username_on_target.stdout }}" + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target user + getent: + database: passwd + key: "{{ target_user }}" + register: getent_running_user + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target group + getent: + database: group + key: "{{ target_user }}" + register: getent_on_groupQuoted 8 lines
playbooks/roles/fstests/tasks/main.yml line 44
Quoted 6 lines
playbooks/roles/fstests/tasks/main.yml +6
-0+ when: + - infer_uid_and_group|bool + +- name: Override user and group with inferred settings if feature is enabled + set_fact: + user: "hplip"Why "hplip" here?
Quoted 4 lines
This was mostly copy/pasted from
./playbooks/roles/bootlinux/tasks/main.yml. I see it was introduced in commitf10add06446b("kdevops: remove ansible galaxy dependency") for that file, but I'm unclear the use there. I'd like to know as well.
I recall fstets having odd user requirements but that was just for some odd tests. I can't trace hplip down to anything so I say we just remove it for both.
Luis
Quoted 70 lines · Luis Chamberlain
Quoted 69 lines · Frederick Lawler
Quoted 67 lines · Jeff Layton
Quoted 54 lines · Frederick Lawler
Currently when running make fstests for bare-metal setups, the
data_user'vagrant' is set for the /data partition. This is currently set as the defaultdata_user. We have the option to edit this in extra_vars.yml.make linux checks for an inferred user prior to setting the uid/gid for the /data partition.
In the situation where we don't add the 'vagrant' user to the bare-metal, we get a "user does not exist" on make fstests.
In both cases we do not want to switch users between the two targets, nor do we want to necessarily ensure that the 'vagrant' user exists on the metal. Therefore, request the inferred user on make fstests.
Signed-off-by Frederick Lawler <[email protected]>---
Since this is essentially in two places, I figure this should be more generic and then included in other make targets like cxl. But this is to get the discussion going if this or some other generic approach is preferred.--- playbooks/roles/fstests/tasks/main.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)playbooks/roles/fstests/tasks/main.yml +22
-0@@ -10,6 +10,43 @@ skip: true tags: vars +- name: Get username we are using + command: + cmd: whoami + register: username_on_target + when: + - infer_uid_and_group|bool + +- name: Set target user as a fact + set_fact: + target_user: "{{ username_on_target.stdout }}" + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target user + getent: + database: passwd + key: "{{ target_user }}" + register: getent_running_user + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target groupplaybooks/roles/fstests/tasks/main.yml line 44
Quoted 10 lines
playbooks/roles/fstests/tasks/main.yml +10
-0+ getent: + database: group + key: "{{ target_user }}" + register: getent_on_group + when: + - infer_uid_and_group|bool + +- name: Override user and group with inferred settings if feature is enabled + set_fact: + user: "hplip"Why "hplip" here?
Quoted 8 lines
Quoted 4 lines
This was mostly copy/pasted from
./playbooks/roles/bootlinux/tasks/main.yml. I see it was introduced in commitf10add06446b("kdevops: remove ansible galaxy dependency") for that file, but I'm unclear the use there. I'd like to know as well.I recall fstets having odd user requirements but that was just for some odd tests. I can't trace hplip down to anything so I say we just remove it for both.
If you have an HP printer/scanner/copier then there is an "hplip" package for Fedora with some of their drivers and such.
That's why it seemed so weird here.
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 76 lines · Jeff Layton
Quoted 75 lines · Luis Chamberlain
Quoted 73 lines · Frederick Lawler
Quoted 59 lines · Jeff Layton
Quoted 58 lines · Frederick Lawler
Currently when running make fstests for bare-metal setups, the
data_user'vagrant' is set for the /data partition. This is currently set as the defaultdata_user. We have the option to edit this in extra_vars.yml.make linux checks for an inferred user prior to setting the uid/gid for the /data partition.
In the situation where we don't add the 'vagrant' user to the bare-metal, we get a "user does not exist" on make fstests.
In both cases we do not want to switch users between the two targets, nor do we want to necessarily ensure that the 'vagrant' user exists on the metal. Therefore, request the inferred user on make fstests.
Signed-off-by Frederick Lawler <[email protected]>---
Since this is essentially in two places, I figure this should be more generic and then included in other make targets like cxl. But this is to get the discussion going if this or some other generic approach is preferred.--- playbooks/roles/fstests/tasks/main.yml | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)playbooks/roles/fstests/tasks/main.yml +26
-0@@ -10,6 +10,43 @@ skip: true tags: vars +- name: Get username we are using + command: + cmd: whoami + register: username_on_target + when: + - infer_uid_and_group|bool + +- name: Set target user as a fact + set_fact: + target_user: "{{ username_on_target.stdout }}" + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target user + getent: + database: passwd + key: "{{ target_user }}" + register: getent_running_user + when: + - infer_uid_and_group|bool + +- name: Run getent against the inferred target group + getent: + database: group + key: "{{ target_user }}" + register: getent_on_groupQuoted 8 lines
playbooks/roles/fstests/tasks/main.yml line 44
Quoted 6 lines
playbooks/roles/fstests/tasks/main.yml +6
-0+ when: + - infer_uid_and_group|bool + +- name: Override user and group with inferred settings if feature is enabled + set_fact: + user: "hplip"Why "hplip" here?
This was mostly copy/pasted from
./playbooks/roles/bootlinux/tasks/main.yml. I see it was introduced in commitf10add06446b("kdevops: remove ansible galaxy dependency") for that file, but I'm unclear the use there. I'd like to know as well.
Quoted 8 lines
Quoted 3 lines
I recall fstets having odd user requirements but that was just for some odd tests. I can't trace hplip down to anything so I say we just remove it for both.
If you have an HP printer/scanner/copier then there is an "hplip" package for Fedora with some of their drivers and such.
That's why it seemed so weird here.
Indeed, super odd! Well good riddance, I nuked it.
Luis
Quoted 14 lines · Frederick Lawler
Currently when running make fstests for bare-metal setups, the
data_user'vagrant' is set for the /data partition. This is currently set as the defaultdata_user. We have the option to edit this in extra_vars.yml.make linux checks for an inferred user prior to setting the uid/gid for the /data partition.
In the situation where we don't add the 'vagrant' user to the bare-metal, we get a "user does not exist" on make fstests.
In both cases we do not want to switch users between the two targets, nor do we want to necessarily ensure that the 'vagrant' user exists on the metal. Therefore, request the inferred user on make fstests.
Quoted 6 lines
Signed-off-by Frederick Lawler <[email protected]>---
Since this is essentially in two places, I figure this should be more generic and then included in other make targets like cxl. But this is to get the discussion going if this or some other generic approach is preferred.
Looks good to me, sharing is certainly desriable so we have a bug in just one place. You can do that later.
I've applied this patch and then also removed hlip user from both places. We'll see what breaks, I can't think of anything that should depend on it.
What's your github username or gitlab? You should just get access to commit.
Luis