-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix 187: make sure 'jenkins-agent' is allowed to use cron #189
Fix 187: make sure 'jenkins-agent' is allowed to use cron #189
Conversation
I only added this to the |
The agent profile manifest (the file modified by this PR) is included in all three buildfarm roles: master, repo, and agent, with different configurations. This will be included in new hosts of all three roles. It is interesting that you hit this and I didn't. On the buildfarm master and repo hosts there is no file The agents are periodically rebuilt based on newer Ubuntu base AMIs so I wonder if they're affected by this. Given that there are some Ubuntu xenial installations (i.e. mine 😀 ) that don't have this file. I'm slightly apprehensive about creating it in all cases. But I also don't off the top of my head know how to only add the file_line if the file exists. There's no |
I was surprised as well. I'm running the following:
Could you check the output of |
@nuclearsandwich wrote:
I agree, but shouldn't |
Reading the man page better, it seems if That would make this PR unnecessary. Now to figure out who/what put that |
yes, this is a problem. If But if it isn't there, we shouldn't create it. |
If this is something we need to manage there's already modules for this sort of thing: https://github.com/voxpupuli/puppet-cron Though if it's only injected on non-standard installations then I'd advocate for documenting that it's required but not having it in the default config to keep things as simple as possible. And users with a more complicated setup will need to configure cron appropriately or inject the correct module settings. |
I've looked at I think documentation would probably be the better approach here, although checking for the file's existence and then adding the user to it doesn't seem too complex and makes deployment that much smoother. |
Skipping if it already exists won't help here since when it doesn't exist, that is the desired state. When it does exist, the desired state is that the While it would be nicer if puppet had the necessary knobs for us to do this by the book, it's a pretty easy thing to write an exec resource for with a guard command. So I think we can still allow handling of both cases. Another option would be to enforce that |
@nuclearsandwich wrote:
yes, I was thinking of that as well. Something similar to: buildfarm_deployment/modules/profile/manifests/jenkins/master.pp Lines 243 to 247 in 93b40cf
|
That's a PR I'd review and accept. As I mentioned there's some Melodic bootstrapping work that's taken precedence and I'm not sanguine I'll have time to contribute or test any buildfarm deployments until Friday at the earliest. |
This fixes #187 for me.
If the
/etc/cron.allow
file does not exist, it is created. On all my hosts that isn't necessary, but I thought it'd be good to check and create the file.Tested on Ubuntu Server 16.04,
amd64
against 93b40cf.