-
Notifications
You must be signed in to change notification settings - Fork 20
Add quadlet timer for foreman recurring task (reports:daily) #252
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| [Unit] | ||
| Description=Foreman recurring task: reports:daily | ||
|
|
||
| [Container] | ||
| Image={{ foreman_container_image }}:{{ foreman_container_tag }} | ||
| Exec=foreman-rake reports:daily | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will require all the secrets and configs mounted like the normal container does, otherwise it can't access the DB and stuff |
||
| User=foreman | ||
| WorkingDir=/usr/share/foreman | ||
| Volume=/etc/foreman:/etc/foreman:ro | ||
| Volume=/var/lib/foreman:/var/lib/foreman | ||
|
Comment on lines
+9
to
+10
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where do these volumes come from? |
||
| Network=host | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| [Unit] | ||
| Description=Timer for Foreman reports:daily task | ||
|
|
||
| [Timer] | ||
| OnCalendar=daily | ||
| Persistent=true | ||
|
|
||
| [Install] | ||
| WantedBy=timers.target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd have expected to define this quadlet the same way we do for regular services with
containers.podman.podman_container. Is that not possible for timers?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah so I did this way to start it with templated
.containerand.timerunits to get a working prototype quickly and to control the timer behavior directly. Since I found thatcontainers.podman.podman_containerdoesn’t create.timerunits, I had to template that part anyway.And plan is to refactor it to define the
.containerusingcontainers.podman.podman_container, which aligns with how other services are handled in foremanctl. But the.timerwill remain a small template for now, since neitherpodman_containernorpodman_generate_systemdcurrently support generating .timer units and they only handle.container(or.service) definitions.So question would you prefer that all recurring-task containers follow the same
podman_container (state: quadlet)pattern, even if each has its own.timerdefined separately? @ehelms @evgeniThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think I prefer
containers.podman.podman_containerto define quadlets, just to make it consistent.But would also like to open up the following discussion: This PR adds a timer for
foreman-rake reports:dailyand we expect more to come. A quick glance gives me:foreman:
katello:
foreman-tasks:
Now, given they all use
foreman-rake <something>, I wonder if we can create a template (container) service, and then use timer units to start different instances of this service, running different subcommands?Sort of like we do for the different
dynflowworkers today.