bundlewrap/bundles/jenkins-ci/items.py

53 lines
1.2 KiB
Python
Raw Permalink Normal View History

2021-07-11 13:29:42 +00:00
directories = {
'/var/lib/jenkins': {
'owner': 'jenkins',
'group': 'jenkins',
'needs': {
'pkg_apt:jenkins',
},
},
'/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',
},
},
'/var/lib/jenkins/.ssh/config': {
'source': 'ssh-config',
},
'/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
}
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',
},
},
}