2021-07-11 13:29:42 +00:00
|
|
|
directories = {
|
|
|
|
'/var/lib/jenkins': {
|
|
|
|
'owner': 'jenkins',
|
|
|
|
'group': 'jenkins',
|
|
|
|
'needs': {
|
|
|
|
'pkg_apt:jenkins',
|
|
|
|
},
|
|
|
|
},
|
2021-07-11 13:47:45 +00:00
|
|
|
'/var/lib/jenkins/.ssh': {
|
|
|
|
'mode': '0755',
|
|
|
|
'owner': 'git',
|
|
|
|
'group': 'git',
|
|
|
|
},
|
2021-07-11 13:29:42 +00:00
|
|
|
}
|
|
|
|
|
2020-05-09 11:08:34 +00:00
|
|
|
files = {
|
|
|
|
'/etc/default/jenkins': {
|
|
|
|
'triggers': {
|
|
|
|
'svc_systemd:jenkins:restart',
|
|
|
|
},
|
|
|
|
},
|
2021-07-11 13:47:45 +00:00
|
|
|
'/var/lib/jenkins/.ssh/config': {
|
|
|
|
'source': 'ssh-config',
|
|
|
|
},
|
2022-02-19 17:53:49 +00:00
|
|
|
'/etc/systemd/system/jenkins.service': {
|
|
|
|
'content_type': 'mako',
|
|
|
|
'context': {
|
|
|
|
'read_write_paths': node.metadata.get('jenkins-ci/writeable_paths'),
|
|
|
|
},
|
|
|
|
'triggers': {
|
|
|
|
'action:systemd-reload',
|
|
|
|
'svc_systemd:jenkins:restart',
|
|
|
|
},
|
|
|
|
}
|
2020-05-09 11:08:34 +00:00
|
|
|
}
|
|
|
|
|
2021-07-11 13:47:45 +00:00
|
|
|
if node.metadata.get('jenkins-ci/install_ssh_key', False):
|
|
|
|
files['/var/lib/jenkins/.ssh/id_ed25519'] = {
|
|
|
|
'content': repo.vault.decrypt_file(f'jenkins-ci/files/ssh-keys/{node.name}.key.vault'),
|
|
|
|
'mode': '0600',
|
|
|
|
'owner': 'jenkins',
|
|
|
|
'group': 'jenkins',
|
|
|
|
}
|
|
|
|
|
2020-05-09 11:08:34 +00:00
|
|
|
svc_systemd = {
|
|
|
|
'jenkins': {
|
|
|
|
'needs': {
|
2021-07-11 13:29:42 +00:00
|
|
|
'directory:/var/lib/jenkins',
|
2020-05-09 11:08:34 +00:00
|
|
|
'pkg_apt:jenkins',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|