MythicSalt/states/jenkins/init.sls

72 lines
1.6 KiB
Plaintext

jenkins_repo:
pkgrepo.managed:
- name: deb https://pkg.jenkins.io/debian binary/
- key_url: https://pkg.jenkins.io/debian/jenkins.io.key
- file: /etc/apt/sources.list.d/jenkins.list
java:
pkg.installed:
- name: openjdk-17-jre
jenkins_user:
user.present:
- name: jenkins
- usergroup: true
- home: /srv/jenkins
- system: true
- fullname: Jenkins CI
jenkins_group:
group.present:
- name: mercurial
- system: true
- addusers:
- jenkins
- require:
- sls: mercurial
jenkins:
pkg.installed:
- name: jenkins
- require:
- java
jenkins_defaults_directory:
file.directory:
- name: /etc/systemd/system/jenkins.service.d
- makedirs: true
jenkins_tag_project:
file.managed:
- name: /usr/local/bin/hg-tag-project
- source: salt://jenkins/hg-tag-project
- mode: 0755
jenkins_defaults:
file.managed:
- name: /etc/systemd/system/jenkins.service.d/override.conf
- source: salt://jenkins/jenkins-systemd-override.conf
service.running:
- name: jenkins
- restart: true
- watch:
- file: /etc/systemd/system/jenkins.service.d/override.conf
jenkins_web:
file.managed:
- require:
- sls: apache
- sls: certificates
- names:
- /etc/apache2/sites-available/jenkins.lunch.org.uk.conf:
- source: salt://jenkins/jenkins.lunch.org.uk.conf
apache_site.enabled:
- require:
- file: /etc/apache2/sites-available/jenkins.lunch.org.uk.conf
- name: jenkins.lunch.org.uk
service.running:
- name: apache2
- reload: true
- watch:
- file: /etc/apache2/sites-available/jenkins.lunch.org.uk.conf