Cleaning up Jenkins and Prometheus roles
This commit is contained in:
parent
b80bc110c3
commit
0942a9b52c
@ -23,9 +23,9 @@ nextcloud_dbpass: password
|
|||||||
jenkins_version: lts
|
jenkins_version: lts
|
||||||
jenkins_domain: jenkins.vm.krislamo.org
|
jenkins_domain: jenkins.vm.krislamo.org
|
||||||
|
|
||||||
# prometheus
|
# prometheus (includes grafana)
|
||||||
prom_name: prometheus
|
|
||||||
prom_version: latest
|
prom_version: latest
|
||||||
prom_domain: prom.vm.krislamo.org
|
prom_domain: prom.vm.krislamo.org
|
||||||
|
grafana_version: latest
|
||||||
grafana_domain: grafana.vm.krislamo.org
|
grafana_domain: grafana.vm.krislamo.org
|
||||||
prom_targets: "['127.0.0.1', '127.0.0.1:9100']"
|
prom_targets: "['127.0.0.1', '127.0.0.1:9100']"
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
jenkins_name: jenkins
|
||||||
|
jenkins_root: "/opt/{{ jenkins_name }}/jenkins_home"
|
@ -20,21 +20,20 @@
|
|||||||
|
|
||||||
- name: Create Jenkin's directory
|
- name: Create Jenkin's directory
|
||||||
file:
|
file:
|
||||||
path: /home/{{ docker_user }}/jenkins
|
path: "{{ jenkins_root }}"
|
||||||
state: directory
|
state: directory
|
||||||
recurse: yes
|
|
||||||
owner: "1000"
|
owner: "1000"
|
||||||
group: "1000"
|
group: "1000"
|
||||||
|
|
||||||
- name: Start Jenkins Container
|
- name: Start Jenkins Container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: jenkins
|
name: "{{ jenkins_name }}"
|
||||||
image: jenkins/jenkins:{{ jenkins_version }}
|
image: jenkins/jenkins:{{ jenkins_version }}
|
||||||
state: started
|
state: started
|
||||||
restart_policy: always
|
restart_policy: always
|
||||||
ports:
|
ports:
|
||||||
- 50000:50000
|
- 50000:50000
|
||||||
volumes: "/home/{{ docker_user }}/jenkins:/var/jenkins_home"
|
volumes: "{{ jenkins_root }}:/var/jenkins_home"
|
||||||
networks_cli_compatible: true
|
networks_cli_compatible: true
|
||||||
networks:
|
networks:
|
||||||
- name: traefik
|
- name: traefik
|
||||||
|
3
roles/prometheus/defaults/main.yml
Normal file
3
roles/prometheus/defaults/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
prom_name: prometheus
|
||||||
|
grafana_name: grafana
|
||||||
|
prom_root: "/opt/{{ prom_name }}/config"
|
@ -8,15 +8,15 @@
|
|||||||
name: prometheus-node-exporter
|
name: prometheus-node-exporter
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: Create Prometheus directory
|
- name: Create Prometheus directories
|
||||||
file:
|
file:
|
||||||
path: /home/{{ docker_user }}/prometheus
|
path: "{{ prom_root }}"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: Install Prometheus configuration
|
- name: Install Prometheus configuration
|
||||||
template:
|
template:
|
||||||
src: prometheus-config.yml
|
src: prometheus.yml.j2
|
||||||
dest: /home/{{ docker_user }}/prometheus/prometheus.yml
|
dest: "{{ prom_root }}/prometheus.yml"
|
||||||
|
|
||||||
- name: Create Prometheus network
|
- name: Create Prometheus network
|
||||||
docker_network:
|
docker_network:
|
||||||
@ -28,8 +28,7 @@
|
|||||||
image: prom/prometheus:{{ prom_version }}
|
image: prom/prometheus:{{ prom_version }}
|
||||||
state: started
|
state: started
|
||||||
restart_policy: always
|
restart_policy: always
|
||||||
volumes:
|
volumes: "{{ prom_root }}:/etc/prometheus"
|
||||||
- /home/{{ docker_user }}/prometheus:/etc/prometheus
|
|
||||||
networks_cli_compatible: true
|
networks_cli_compatible: true
|
||||||
networks:
|
networks:
|
||||||
- name: "{{ prom_name }}"
|
- name: "{{ prom_name }}"
|
||||||
@ -42,8 +41,8 @@
|
|||||||
|
|
||||||
- name: Start Grafana container
|
- name: Start Grafana container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: grafana
|
name: "{{ grafana_name }}"
|
||||||
image: grafana/grafana:latest
|
image: grafana/grafana:{{ grafana_version }}
|
||||||
networks_cli_compatible: true
|
networks_cli_compatible: true
|
||||||
networks:
|
networks:
|
||||||
- name: "{{ prom_name }}"
|
- name: "{{ prom_name }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user