Compare commits
9 Commits
ddafc09839
...
a02ddbb53f
Author | SHA1 | Date |
---|---|---|
|
a02ddbb53f | |
|
10d6b52460 | |
|
9d54411d52 | |
|
c95a4b7379 | |
|
52436acb48 | |
|
7766cc1d05 | |
|
cae9f2e3c2 | |
|
0500adadfa | |
|
b809d4294f |
|
@ -17,53 +17,65 @@ pipeline {
|
|||
variable: 'KEYTAB')]) {
|
||||
sh 'kinit -kt "${KEYTAB}" jenkins@PYROCUFFLINK.BLUE'
|
||||
}
|
||||
withCredentials([file(
|
||||
credentialsId: 'vault-jenkins@pyrocufflink.blue',
|
||||
variable: 'SUDO_PASS_FILE'
|
||||
)]) {
|
||||
sh 'cp "${SUDO_PASS_FILE}" group_vars/pyrocufflink/sudo-pass'
|
||||
}
|
||||
withCredentials([file(
|
||||
credentialsId: 'vault-jenkins@gw0',
|
||||
variable: 'SUDO_PASS_FILE'
|
||||
)]) {
|
||||
sh 'cp -f "${SUDO_PASS_FILE}" host_vars/gw0/sudo-pass'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Remount R/W') {
|
||||
steps {
|
||||
withCredentials([file(
|
||||
credentialsId: 'vault-jenkins@pyrocufflink.blue',
|
||||
variable: 'SUDO_PASS_FILE')]) {
|
||||
ansiblePlaybook \
|
||||
playbook: 'remount.yml',
|
||||
limit: 'zabbix',
|
||||
become: true,
|
||||
vaultCredentialsId: 'ansible-vault',
|
||||
extraVars: [
|
||||
remount_state: 'rw',
|
||||
],
|
||||
extras: '-e@"${SUDO_PASS_FILE}"'
|
||||
}
|
||||
ansiblePlaybook \
|
||||
playbook: 'remount.yml',
|
||||
limit: 'zabbix',
|
||||
become: true,
|
||||
credentialsId: 'jenkins-ssh',
|
||||
vaultCredentialsId: 'ansible-vault',
|
||||
extraVars: [
|
||||
remount_state: 'rw',
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
stage('Zabbix') {
|
||||
stage('Zabbix Server') {
|
||||
steps {
|
||||
withCredentials([file(
|
||||
credentialsId: 'vault-jenkins@pyrocufflink.blue',
|
||||
variable: 'SUDO_PASS_FILE')]) {
|
||||
ansiblePlaybook \
|
||||
playbook: 'zabbix.yml',
|
||||
become: true,
|
||||
vaultCredentialsId: 'ansible-vault',
|
||||
extras: '-e@"${SUDO_PASS_FILE}" --diff'
|
||||
}
|
||||
ansiblePlaybook \
|
||||
playbook: 'zabbix-server.yml',
|
||||
become: true,
|
||||
vaultCredentialsId: 'ansible-vault',
|
||||
extras: '--diff'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Zabbix Agent') {
|
||||
steps {
|
||||
ansiblePlaybook \
|
||||
playbook: 'zabbix-agent.yml',
|
||||
limit: '!gw0',
|
||||
become: true,
|
||||
credentialsId: 'jenkins-ssh',
|
||||
vaultCredentialsId: 'ansible-vault',
|
||||
extras: '--diff'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Remount R/O') {
|
||||
steps {
|
||||
withCredentials([file(
|
||||
credentialsId: 'vault-jenkins@pyrocufflink.blue',
|
||||
variable: 'SUDO_PASS_FILE')]) {
|
||||
ansiblePlaybook \
|
||||
playbook: 'remount.yml',
|
||||
limit: 'zabbix',
|
||||
become: true,
|
||||
vaultCredentialsId: 'ansible-vault',
|
||||
extras: '-e@"${SUDO_PASS_FILE}"'
|
||||
}
|
||||
ansiblePlaybook \
|
||||
playbook: 'remount.yml',
|
||||
limit: 'zabbix',
|
||||
become: true,
|
||||
credentialsId: 'jenkins-ssh',
|
||||
vaultCredentialsId: 'ansible-vault'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,6 +84,7 @@ pipeline {
|
|||
post {
|
||||
always {
|
||||
sh 'kdestroy'
|
||||
sh 'find . -name sudo-pass -delete'
|
||||
}
|
||||
failure {
|
||||
emailext \
|
||||
|
|
|
@ -10,3 +10,7 @@ ServerName {{ apache_server_name }}
|
|||
{% else %}
|
||||
#ServerName www.example.com:80
|
||||
{% endif %}
|
||||
{% if apache_server_tokens is defined %}
|
||||
|
||||
ServerTokens {{ apache_server_tokens }}
|
||||
{% endif %}
|
||||
|
|
|
@ -2,11 +2,16 @@
|
|||
package:
|
||||
name=certbot
|
||||
state=present
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: ensure certbot group exists
|
||||
group:
|
||||
name=certbot
|
||||
system=yes
|
||||
tags:
|
||||
- group
|
||||
- user
|
||||
- name: ensure certbot user exists
|
||||
user:
|
||||
name=certbot
|
||||
|
@ -15,6 +20,8 @@
|
|||
home=/var/lib/letsencrypt
|
||||
createhome=no
|
||||
state=present
|
||||
tags:
|
||||
- user
|
||||
|
||||
- name: ensure certbot data directory exists
|
||||
file:
|
||||
|
@ -23,6 +30,13 @@
|
|||
owner=certbot
|
||||
group=certbot
|
||||
state=directory
|
||||
- name: ensure certbot accounts directory exists
|
||||
file:
|
||||
path=/var/lib/letsencrypt/accounts
|
||||
mode=0700
|
||||
owner=certbot
|
||||
group=certbot
|
||||
state=directory
|
||||
- name: ensure certbot log directory exists
|
||||
file:
|
||||
path=/var/log/letsencrypt
|
||||
|
@ -45,7 +59,14 @@
|
|||
mode=0644
|
||||
notify: reload httpd
|
||||
|
||||
- name: ensure certbot account is registered
|
||||
- name: ensure letsencrypt account data are installed
|
||||
become: true
|
||||
become_user: certbot
|
||||
unarchive:
|
||||
src={{ item }}
|
||||
dest=/var/lib/letsencrypt/accounts/
|
||||
with_fileglob: accounts/{{ inventory_hostname }}.tar.xz
|
||||
- name: ensure letsencrypt account is registered
|
||||
become: true
|
||||
become_user: certbot
|
||||
command:
|
||||
|
|
|
@ -18,3 +18,10 @@
|
|||
dest=/etc/haproxy/70-backend-gitea.cfg
|
||||
mode=0644
|
||||
notify: reload haproxy
|
||||
|
||||
- name: ensure jenkins haproxy backend is configured
|
||||
template:
|
||||
src=backend-jenkins.haproxy.cfg.j2
|
||||
dest=/etc/haproxy/70-backend-jenkins.cfg
|
||||
mode=0644
|
||||
notify: reload haproxy
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
backend jenkins
|
||||
server jenkins jenkins.pyrocufflink.blue:80 check
|
||||
|
||||
|
||||
backend jenkins-tls
|
||||
mode tcp
|
||||
server jenkins jenkins.pyrocufflink.blue:443 check
|
|
@ -3,6 +3,8 @@ frontend main
|
|||
|
||||
use_backend gitea if { hdr(host) -i git.pyrocufflink.blue }
|
||||
use_backend gitea if { hdr(host) -i git.pyrocufflink.net }
|
||||
use_backend jenkins if { hdr(host) -i jenkins.pyrocufflink.blue }
|
||||
use_backend jenkins if { hdr(host) -i jenkins.pyrocufflink.net }
|
||||
default_backend myala
|
||||
|
||||
|
||||
|
@ -16,4 +18,6 @@ frontend main-tls
|
|||
|
||||
use_backend gitea-tls if { req_ssl_sni -i git.pyrocufflink.blue }
|
||||
use_backend gitea-tls if { req_ssl_sni -i git.pyrocufflink.net }
|
||||
use_backend jenkins-tls if { req_ssl_sni -i jenkins.pyrocufflink.blue }
|
||||
use_backend jenkins-tls if { req_ssl_sni -i jenkins.pyrocufflink.net }
|
||||
default_backend myala-tls
|
||||
|
|
|
@ -11,6 +11,10 @@ server role = {{ samba_server_role }}
|
|||
{% else %}
|
||||
security = {{ samba_security }}
|
||||
{% endif %}
|
||||
{% if samba_interfaces is defined %}
|
||||
|
||||
interfaces = {{ samba_interfaces|join(' ') }}
|
||||
{% endif %}
|
||||
{% if samba_options is defined %}
|
||||
|
||||
{% for option in samba_options %}
|
||||
|
|
Loading…
Reference in New Issue