Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for ostree systems #124

Merged
merged 1 commit into from
Nov 16, 2023
Merged

Conversation

richm
Copy link
Contributor

@richm richm commented Nov 14, 2023

Feature: Allow running and testing the role with ostree managed nodes.

Reason: We have users who want to use the role to manage ostree
systems.

Result: Users can use the role to manage ostree managed nodes.
Signed-off-by: Rich Megginson [email protected]

@richm richm requested a review from Jakuje as a code owner November 14, 2023 17:52
@richm
Copy link
Contributor Author

richm commented Nov 14, 2023

[citest]

@richm
Copy link
Contributor Author

richm commented Nov 14, 2023

[citest]

@@ -0,0 +1 @@
openssh-ldap
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not clear to me where did these files come from and why these packages are needed. AFAIK the openssh-ldap is used only on the server to provide support for loading public authorized_keys from LDAP and do not have any use in the ssh client role.

So in the mean of keeping the role simple, I would propose to drop this. The same for the keycat, which is only useful for the server side of the OpenSSH.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The weekly CI job that runs all integration tests - #119
uses an Ansible callback plugin - https://github.com/linux-system-roles/ssh/pull/119/files that comes from https://github.com/linux-system-roles/auto-maintenance/blob/main/callback_plugins/dump_packages.py
that intercepts all calls to the package:, yum:, and dnf: modules and prints the packages passed to the module - https://dl.fedoraproject.org/pub/alt/linuxsystemroles/logs/lsr-citool_ssh-119-e861b60_CentOS-7-latest_20231113-115435/artifacts/tests_additional_packages-PASSED.log

TASK [fedora.linux_system_roles.ssh : Ensure required packages are installed] ***
task path: /WORKDIR/git-weekly-ci7pusbkan/.collection/ansible_collections/fedora/linux_system_roles/roles/ssh/tasks/main.yml:5
Monday 13 November 2023  11:53:39 +0000 (0:00:00.029)       0:00:01.151 ******* 
changed: [sut] => {
    "changed": true,
    "changes": {
        "installed": [
            "openssh-ldap"
        ]
    },
    "rc": 0,
    "results": [
        "openssh-7.4p1-23.el7_9.x86_64 providing openssh is already installed",
        "openssh-clients-7.4p1-23.el7_9.x86_64 providing openssh-clients is already installed",
        "Loaded plugins: fastestmirror\nLoading mirror speeds from cached hostfile\n * base: download.cf.centos.org\n * extras: download.cf.centos.org\n * updates: download.cf.centos.org\nResolving Dependencies\n--> Running transaction check\n---> Package openssh-ldap.x86_64 0:7.4p1-23.el7_9 will be installed\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n================================================================================\n Package             Arch          Version                 Repository      Size\n================================================================================\nInstalling:\n openssh-ldap        x86_64        7.4p1-23.el7_9          updates        113 k\n\nTransaction Summary\n================================================================================\nInstall  1 Package\n\nTotal download size: 113 k\nInstalled size: 92 k\nDownloading packages:\nRunning transaction check\nRunning transaction test\nTransaction test succeeded\nRunning transaction\n  Installing : openssh-ldap-7.4p1-23.el7_9.x86_64                           1/1 \n  Verifying  : openssh-ldap-7.4p1-23.el7_9.x86_64                           1/1 \n\nInstalled:\n  openssh-ldap.x86_64 0:7.4p1-23.el7_9                                          \n\nComplete!\n"
    ]
}
lsrpackages: openssh openssh-clients openssh-ldap

Then, I use the script https://github.com/linux-system-roles/auto-maintenance/blob/main/check-logs-for-packages.sh to scrape the logs for the list of runtime and testing packages and generate the files in the .ostree/ directory.

If running on an rpm-ostree system, the call to package: will fail if these packages are not present.

Some alternatives:

  • rewrite the test to omit the openssh-ldap package if using ostree
  • skip the test if using ostree

@richm
Copy link
Contributor Author

richm commented Nov 15, 2023

and it looks like the logic in check-logs does not handle the case where a package is declared in a test but installed in the main role code. I'll move those packages to testing.

Feature: Allow running and testing the role with ostree managed nodes.

Reason: We have users who want to use the role to manage ostree
systems.

Result: Users can use the role to manage ostree managed nodes.
Signed-off-by: Rich Megginson <[email protected]>
@richm
Copy link
Contributor Author

richm commented Nov 15, 2023

[citest]

@richm richm merged commit b91af7f into linux-system-roles:main Nov 16, 2023
28 checks passed
@richm richm deleted the ostree branch November 16, 2023 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants