Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
f90f251763 | |||
8c6dd29da3 | |||
9cd6777a7c | |||
33d86b9ebb |
12
.drone.yml
Normal file
12
.drone.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
name: playbook
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: lint
|
||||||
|
image: alpine:latest
|
||||||
|
commands:
|
||||||
|
- apk add git ansible ansible-lint
|
||||||
|
- ansible-lint -x305,403,701
|
3
roles/acertmgr/defaults/main.yml
Normal file
3
roles/acertmgr/defaults/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
acertmgr_version: "{{ lookup('url', 'https://raw.githubusercontent.com/moepman/acertmgr/master/version.txt') | trim }}"
|
@ -8,16 +8,9 @@
|
|||||||
- python3-yaml
|
- python3-yaml
|
||||||
- python3-pkg-resources
|
- python3-pkg-resources
|
||||||
|
|
||||||
- name: Find current acertmgr version
|
|
||||||
get_url:
|
|
||||||
url: "https://raw.githubusercontent.com/moepman/acertmgr/master/version.txt"
|
|
||||||
dest: /tmp/acertmgr.version
|
|
||||||
vars:
|
|
||||||
ansible_connection: local
|
|
||||||
|
|
||||||
- name: Install acertmgr
|
- name: Install acertmgr
|
||||||
apt:
|
apt:
|
||||||
deb: "https://github.com/moepman/acertmgr/releases/download/{{ lookup('file', '/tmp/acertmgr.version') }}/python3-acertmgr_{{ lookup('file', '/tmp/acertmgr.version') }}-1_all.deb"
|
deb: "https://github.com/moepman/acertmgr/releases/download/{{ acertmgr_version }}/python3-acertmgr_{{ acertmgr_version }}-1_all.deb"
|
||||||
|
|
||||||
- name: Create config directories
|
- name: Create config directories
|
||||||
file:
|
file:
|
||||||
|
4
roles/common-handlers/handlers/main.yml
Normal file
4
roles/common-handlers/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: 'Reload systemd'
|
||||||
|
systemd: daemon_reload=yes
|
@ -1,7 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Reload systemd
|
|
||||||
command: systemctl daemon-reload
|
|
||||||
|
|
||||||
- name: Restart fastd-exporter
|
- name: Restart fastd-exporter
|
||||||
service: name=fastd-exporter state=restarted
|
service: name=fastd-exporter state=restarted
|
||||||
|
4
roles/fastd-exporter/meta/main.yml
Normal file
4
roles/fastd-exporter/meta/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- { role: common-handlers }
|
@ -3,6 +3,3 @@
|
|||||||
- name: Restart fastd
|
- name: Restart fastd
|
||||||
service: name=fastd@{{ site_code }}{{ item }} state=restarted
|
service: name=fastd@{{ site_code }}{{ item }} state=restarted
|
||||||
with_sequence: start=0 count={{ fastd_instances }}
|
with_sequence: start=0 count={{ fastd_instances }}
|
||||||
|
|
||||||
- name: Reload systemd
|
|
||||||
command: systemctl daemon-reload
|
|
||||||
|
4
roles/fastd/meta/main.yml
Normal file
4
roles/fastd/meta/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- { role: common-handlers }
|
@ -2,6 +2,3 @@
|
|||||||
|
|
||||||
- name: Reload interfaces
|
- name: Reload interfaces
|
||||||
command: /sbin/ifreload -a
|
command: /sbin/ifreload -a
|
||||||
|
|
||||||
- name: Reload systemd
|
|
||||||
command: systemctl daemon-reload
|
|
||||||
|
4
roles/mesh-interfaces/meta/main.yml
Normal file
4
roles/mesh-interfaces/meta/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- { role: common-handlers }
|
@ -8,7 +8,13 @@
|
|||||||
when: nginx_ssl
|
when: nginx_ssl
|
||||||
|
|
||||||
- name: Ensure certificates are available
|
- name: Ensure certificates are available
|
||||||
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key -out /etc/nginx/ssl/{{ ansible_fqdn }}.crt -days 730 -subj "/CN={{ ansible_fqdn }}" creates=/etc/nginx/ssl/{{ ansible_fqdn }}.crt
|
command:
|
||||||
|
cmd: >
|
||||||
|
openssl req -x509 -nodes -newkey rsa:2048
|
||||||
|
-keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key
|
||||||
|
-out /etc/nginx/ssl/{{ ansible_fqdn }}.crt
|
||||||
|
-days 730 -subj "/CN={{ ansible_fqdn }}"
|
||||||
|
creates: /etc/nginx/ssl/{{ ansible_fqdn }}.crt
|
||||||
when: nginx_ssl
|
when: nginx_ssl
|
||||||
notify: Restart nginx
|
notify: Restart nginx
|
||||||
|
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Reload systemd
|
|
||||||
command: systemctl daemon-reload
|
|
||||||
|
|
||||||
- name: Restart node_exporter
|
- name: Restart node_exporter
|
||||||
service: name=node_exporter state=restarted
|
service: name=node_exporter state=restarted
|
||||||
|
4
roles/node_exporter/meta/main.yml
Normal file
4
roles/node_exporter/meta/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- { role: common-handlers }
|
@ -1,8 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Reload systemd
|
|
||||||
command: systemctl daemon-reload
|
|
||||||
|
|
||||||
- name: Restart prometheus
|
- name: Restart prometheus
|
||||||
service: name=prometheus state=restarted
|
service: name=prometheus state=restarted
|
||||||
|
|
||||||
|
4
roles/prometheus/meta/main.yml
Normal file
4
roles/prometheus/meta/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- { role: common-handlers }
|
@ -1,7 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Reload systemd
|
|
||||||
command: systemctl daemon-reload
|
|
||||||
|
|
||||||
- name: Restart respondd
|
- name: Restart respondd
|
||||||
service: name=respondd state=restarted
|
service: name=respondd state=restarted
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
- { role: common-handlers }
|
||||||
- { role: git }
|
- { role: git }
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Ensure certificates are available
|
- name: Ensure certificates are available
|
||||||
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key -out /etc/nginx/ssl/{{ ansible_fqdn }}.crt -days 730 -subj "/CN={{ ansible_fqdn }}" creates=/etc/nginx/ssl/{{ ansible_fqdn }}.crt
|
command:
|
||||||
|
cmd: >
|
||||||
|
openssl req -x509 -nodes -newkey rsa:2048
|
||||||
|
-keyout /etc/nginx/ssl/{{ ansible_fqdn }}.key
|
||||||
|
-out /etc/nginx/ssl/{{ ansible_fqdn }}.crt
|
||||||
|
-days 730 -subj "/CN={{ ansible_fqdn }}"
|
||||||
|
creates: /etc/nginx/ssl/{{ ansible_fqdn }}.crt
|
||||||
notify: Restart nginx
|
notify: Restart nginx
|
||||||
|
|
||||||
- name: Create web content directory
|
- name: Create web content directory
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Ensure certificates are available
|
- name: Ensure certificates are available
|
||||||
command: openssl req -x509 -nodes -newkey rsa:2048 -keyout /etc/nginx/ssl/{{ domain }}.key -out /etc/nginx/ssl/{{ domain }}.crt -days 730 -subj "/CN={{ domain }}" creates=/etc/nginx/ssl/{{ domain }}.crt
|
command:
|
||||||
|
cmd: >
|
||||||
|
openssl req -x509 -nodes -newkey rsa:2048
|
||||||
|
-keyout /etc/nginx/ssl/{{ domain }}.key
|
||||||
|
-out /etc/nginx/ssl/{{ domain }}.crt
|
||||||
|
-days 730 -subj "/CN={{ domain }}"
|
||||||
|
creates: /etc/nginx/ssl/{{ domain }}.crt
|
||||||
notify: Restart nginx
|
notify: Restart nginx
|
||||||
|
|
||||||
- name: Configure certificate manager
|
- name: Configure certificate manager
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Reload systemd
|
|
||||||
command: systemctl daemon-reload
|
|
||||||
|
|
||||||
- name: Restart yanic
|
- name: Restart yanic
|
||||||
service: name=yanic state=restarted
|
service: name=yanic state=restarted
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
- { role: common-handlers }
|
||||||
- { role: go }
|
- { role: go }
|
||||||
|
Loading…
Reference in New Issue
Block a user