-
-
Notifications
You must be signed in to change notification settings - Fork 157
Allow quadlets to be referenced as units #548
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Julien Godin <[email protected]>
It does not really ? Things like activate, deactivate make no sense to a .container file , its not a unit. This is a close from me. I agree though actually this directory "https://github.com/voxpupuli/puppet-quadlets/tree/master/types/unit" is named incorrectly. |
I think we mixed up things here. |
Can you give me a puppet example of what you want to work ? To be clean .vollume will not be support in the type Systemd::Unit::Unit since its not a unit. It is supported in the type Quadlets::Quadlet_name |
Sure ! here you go :
So, I would like the volume to be mounted BEFORE the container is launched. |
Thanks for the example, I played and I now understood. quadlets::quadlet { 'openvoxservercode.volume':
ensure => present,
unit_entry => {
'Description' => 'openvoxserver Code Volume',
},
volume_entry => {
'VolumeName' => 'openvoxservercode',
'Driver' => 'local',
},
}
quadlets::quadlet{'centos.container':
ensure => present,
unit_entry => {
'Description' => 'Trivial Container that will be very lazy',
'Requires' => 'openvoxservercode.volume',
'After' => 'openvoxservercode.volume',
},
service_entry => {
'TimeoutStartSec' => '900',
},
container_entry => {
'Image' => 'quay.io/centos/centos:latest',
'Exec' => 'sh -c "sleep inf"',
'Volume' => ['openvoxservercode:/foobar:Z'],
},
install_entry => {
'WantedBy' => 'default.target'
},
active => true,
}
as you say this needs to be possible. However this patch is the wrong fix for that. We should change the type here https://github.com/voxpupuli/puppet-quadlets/blob/master/manifests/quadlet.pp#L59C3-L59C52 and create a new type In the immediate term to unstick your self
Will presumably work. @JGodin-C2C Can you create a new issue or patch in the quadlets module? |
Needs some tests but voxpupuli/puppet-quadlets#52 good hopefully. |
Pull Request (PR) description
This PR allows quadlets to be referenced as units.
As the puppet-quadlet uses systemd::unit to validate the entry , it think that is an interesting feature.
Reference here.
https://github.com/voxpupuli/puppet-quadlets/blob/master/REFERENCE.md#unit_entry
HOWEVER, i understand that systemd module should not bear this burden, I would be more than happy to implement alternative solutions.
This Pull Request (PR) is indirectly related to #540