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

Extend the 'per-device serviceinfo configuration' feature with files and commands #617

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

RZandvoort
Copy link

@RZandvoort RZandvoort commented Feb 9, 2024

Implemented the files and commands part of the per-device serviceinfo configuration feature:

Configration example

Current example yml

initial_user:
  username: username_per_device
  sshkeys:
  - "testkeyperdevice"
files: null
commands: null
diskencryption_clevis: null
additional_serviceinfo: null
after_onboarding_reboot: false

New example yml

initial_user:
  username: username_per_device
  sshkeys:
  - "testkeyperdevice"
files:
- path: /var/lib/fdo/service-info-api/files/hosts
  permissions: 644
  source_path: /server/local/etc/hosts
commands:
- command: ls
  args:
  - /etc/hosts
  return_stdout: true
  return_stderr: true
- command: ls
  args:
  - /etc/doesnotexist/whatever.foo
  may_fail: true
  return_stdout: true
  return_stderr: true
- command: touch
  args:
  - /etc/command-testfile
diskencryption_clevis: null
additional_serviceinfo: null
after_onboarding_reboot: false

Per defices files:
It will write both base and per-device configured files.
If duplicate files are defined, it will choose the per-device file over the base file.

Per device commands:
Additional per device commands will be executed after the base commands

@nullr0ute
Copy link
Contributor

nullr0ute commented Feb 12, 2024

Can we please have a description in PR, it's useful for justification etc.

Also note we're moving to DB backends so I think this would be a better fit in the DB from a layout and performance PoV.

I think also the commits could have better explanations rather than just "Update fileX". I'm going to set this to a draft.

@nullr0ute nullr0ute marked this pull request as draft February 12, 2024 10:51
@RZandvoort RZandvoort changed the title Add per device files configuration implementation Extend the 'per-device serviceinfo configuration' feature with files Feb 14, 2024
@RZandvoort
Copy link
Author

Can we please have a description in PR, it's useful for justification etc.

Also note we're moving to DB backends so I think this would be a better fit in the DB from a layout and performance PoV.

I think also the commits could have better explanations rather than just "Update fileX". I'm going to set this to a draft.

This pull request was supposed to be for trying stuff out, but then I accidentally clicked on the big green 'create PR' button. If we eventually could squash commit, it will look like nothing happend 🤐

@RZandvoort RZandvoort marked this pull request as ready for review February 14, 2024 12:21
@nullr0ute
Copy link
Contributor

The DB support has now landed so it will need to be part of that. I am going to convert this to a draft, once there is DB support and everything is squashed feel free to convert it back to ready then.

@nullr0ute nullr0ute marked this pull request as draft February 21, 2024 09:00
@RZandvoort RZandvoort force-pushed the Add-per-device-files-configuration-implementation branch from 0abfa80 to 38a1dd4 Compare March 24, 2024 17:05
@RZandvoort RZandvoort force-pushed the Add-per-device-files-configuration-implementation branch from 38a1dd4 to 6dbdee6 Compare March 24, 2024 17:05
@RZandvoort RZandvoort changed the title Extend the 'per-device serviceinfo configuration' feature with files Extend the 'per-device serviceinfo configuration' feature with files and commands Oct 2, 2024
@RZandvoort RZandvoort marked this pull request as ready for review October 2, 2024 09:06
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.

3 participants