Cleaning up Jenkins and Prometheus roles

This commit is contained in:
Kris Lamoureux 2020-07-20 21:42:50 -04:00
parent b80bc110c3
commit 0942a9b52c
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
6 changed files with 17 additions and 14 deletions

View File

@ -23,9 +23,9 @@ nextcloud_dbpass: password
jenkins_version: lts
jenkins_domain: jenkins.vm.krislamo.org
# prometheus
prom_name: prometheus
# prometheus (includes grafana)
prom_version: latest
prom_domain: prom.vm.krislamo.org
grafana_version: latest
grafana_domain: grafana.vm.krislamo.org
prom_targets: "['127.0.0.1', '127.0.0.1:9100']"

View File

@ -0,0 +1,2 @@
jenkins_name: jenkins
jenkins_root: "/opt/{{ jenkins_name }}/jenkins_home"

View File

@ -20,21 +20,20 @@
- name: Create Jenkin's directory
file:
path: /home/{{ docker_user }}/jenkins
path: "{{ jenkins_root }}"
state: directory
recurse: yes
owner: "1000"
group: "1000"
- name: Start Jenkins Container
docker_container:
name: jenkins
name: "{{ jenkins_name }}"
image: jenkins/jenkins:{{ jenkins_version }}
state: started
restart_policy: always
ports:
- 50000:50000
volumes: "/home/{{ docker_user }}/jenkins:/var/jenkins_home"
volumes: "{{ jenkins_root }}:/var/jenkins_home"
networks_cli_compatible: true
networks:
- name: traefik

View File

@ -0,0 +1,3 @@
prom_name: prometheus
grafana_name: grafana
prom_root: "/opt/{{ prom_name }}/config"

View File

@ -8,15 +8,15 @@
name: prometheus-node-exporter
state: started
- name: Create Prometheus directory
- name: Create Prometheus directories
file:
path: /home/{{ docker_user }}/prometheus
path: "{{ prom_root }}"
state: directory
- name: Install Prometheus configuration
template:
src: prometheus-config.yml
dest: /home/{{ docker_user }}/prometheus/prometheus.yml
src: prometheus.yml.j2
dest: "{{ prom_root }}/prometheus.yml"
- name: Create Prometheus network
docker_network:
@ -28,8 +28,7 @@
image: prom/prometheus:{{ prom_version }}
state: started
restart_policy: always
volumes:
- /home/{{ docker_user }}/prometheus:/etc/prometheus
volumes: "{{ prom_root }}:/etc/prometheus"
networks_cli_compatible: true
networks:
- name: "{{ prom_name }}"
@ -42,8 +41,8 @@
- name: Start Grafana container
docker_container:
name: grafana
image: grafana/grafana:latest
name: "{{ grafana_name }}"
image: grafana/grafana:{{ grafana_version }}
networks_cli_compatible: true
networks:
- name: "{{ prom_name }}"