Archiv entfernt (#31)
Archiv entfernt Co-authored-by: Michael Grote <michael.grote@posteo.de> Reviewed-on: mg/ansible#31 Co-Authored-By: mg <mg@noreply.git.mgrote.net> Co-Committed-By: mg <mg@noreply.git.mgrote.net>
This commit is contained in:
parent
6e7f7dde4f
commit
251cc84113
140 changed files with 0 additions and 6840 deletions
|
@ -1,24 +0,0 @@
|
|||
## mgrote.miniflux
|
||||
|
||||
### Beschreibung
|
||||
Installiert miniflux.
|
||||
Und konfiguriert es.
|
||||
Es wird ein Nutzer(Linux, PosGreSQL und miniflux) angelegt: "admin:hallowelt"
|
||||
### Funktioniert auf
|
||||
- [x] Ubuntu (>=18.04)
|
||||
|
||||
### Variablen + Defaults
|
||||
##### Linux Nutzer für miniflux
|
||||
miniflux_linux_user: miniflux
|
||||
##### Datenbanknutzer für ...
|
||||
miniflux_db_user_name: miniflux_db_user
|
||||
##### Datenbanknutzerpasswort für ...
|
||||
miniflux_db_user_password: qqqqqqqqqqqqq
|
||||
##### Datenbank für ...
|
||||
miniflux_db: miniflux_db
|
||||
##### Nutzername für den Administrator
|
||||
miniflux_admin_name: admin
|
||||
##### Passwort für den Administrator
|
||||
miniflux_admin_passwort: hallowelt
|
||||
##### Port auf dem Miniflux erreichbar sein soll
|
||||
miniflux_port: 8080
|
|
@ -1,11 +0,0 @@
|
|||
---
|
||||
- name: start_miniflux.service
|
||||
become: yes
|
||||
systemd:
|
||||
name: miniflux
|
||||
state: restarted
|
||||
enabled: yes
|
||||
# wait 15 seconds(for systemd)
|
||||
- name: miniflux_wait
|
||||
wait_for:
|
||||
timeout: 15
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
dependencies:
|
||||
- role: mgrote.postgresql
|
||||
galaxy_info:
|
||||
author: mgrote
|
||||
description: installs miniflux
|
||||
min_ansible_version: 2.0
|
||||
license: GPLv3
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- all
|
||||
galaxy_tags:
|
||||
- system
|
|
@ -1,43 +0,0 @@
|
|||
- name: add Apt-key for miniflux-repo
|
||||
become: yes
|
||||
apt_key:
|
||||
url: https://apt.miniflux.app/KEY.gpg
|
||||
state: present
|
||||
|
||||
- name: add miniflux-repo
|
||||
become: yes
|
||||
apt_repository:
|
||||
repo: 'deb https://apt.miniflux.app/ /' # Der einzelne "/" muss vorhanden sein, sonst ist die Sytax ungültig!
|
||||
state: present
|
||||
filename: miniflux_repo
|
||||
update_cache: yes
|
||||
|
||||
- name: install miniflux
|
||||
become: yes
|
||||
apt:
|
||||
name: miniflux
|
||||
state: present
|
||||
|
||||
- name: add miniflux linux_user
|
||||
become: yes
|
||||
user:
|
||||
name: "{{ miniflux_linux_user }}"
|
||||
home: "/var/empty"
|
||||
create_home: "no"
|
||||
system: "yes"
|
||||
shell: "/bin/false"
|
||||
|
||||
- name: create directory "/etc/miniflux.d"
|
||||
become: yes
|
||||
file:
|
||||
path: /etc/miniflux.d
|
||||
state: directory
|
||||
|
||||
- name: copy miniflux.conf
|
||||
become: yes
|
||||
template:
|
||||
src: "miniflux.conf"
|
||||
dest: "/etc/miniflux.conf"
|
||||
notify:
|
||||
- start_miniflux.service
|
||||
- miniflux_wait
|
|
@ -1,18 +0,0 @@
|
|||
# See https://docs.miniflux.app/
|
||||
|
||||
LISTEN_ADDR=0.0.0.0:{{ miniflux_port }}
|
||||
DATABASE_URL=user={{ miniflux_db_user_name }} password={{ miniflux_db_user_password }} dbname={{ miniflux_db }} sslmode=disable
|
||||
|
||||
POLLING_FREQUENCY=15
|
||||
PROXY_IMAGES=http-only
|
||||
|
||||
# Run SQL migrations automatically:
|
||||
RUN_MIGRATIONS=1
|
||||
|
||||
CREATE_ADMIN=1
|
||||
ADMIN_USERNAME={{ miniflux_admin_name }}
|
||||
ADMIN_PASSWORD={{ miniflux_admin_passwort }}
|
||||
|
||||
POLLING_FREQUENCY=10
|
||||
|
||||
# Options: https://miniflux.app/miniflux.1.html
|
|
@ -1,22 +0,0 @@
|
|||
## mgrote.postgresql
|
||||
|
||||
### Beschreibung
|
||||
Installiert postgresql.
|
||||
Legt eine Datenbank an und gibt einem Nutzer darauf die vollen ZUgriffsrechte.
|
||||
|
||||
### Funktioniert auf
|
||||
- [x] Ubuntu (>=18.04)
|
||||
|
||||
### Variablen + Defaults
|
||||
##### Name der Datenbank
|
||||
name_db: 'miniflux_db'
|
||||
##### Name des Datenbanknutzers
|
||||
name_db_user: 'miniflux_db_user'
|
||||
##### Passwort des Datenbanknutzers
|
||||
password_db_user: 'geheim'
|
||||
|
||||
```
|
||||
postgres_user_and_db:
|
||||
- { name_db: 'miniflux_db', name_db_user: 'miniflux_db_user', password_db_user: 'geheim' }
|
||||
- { name_db: 'telegraf_db', name_db_user: 'telegraf_db_user', password_db_user: 'geheim' }
|
||||
```
|
|
@ -1,12 +0,0 @@
|
|||
---
|
||||
postgres_programme:
|
||||
- postgresql
|
||||
- libpq5
|
||||
- postgresql-12
|
||||
- postgresql-client-12
|
||||
- postgresql-client-common
|
||||
- postgresql-contrib
|
||||
- curl
|
||||
- gnupg
|
||||
- libpq-dev
|
||||
- python3-psycopg2
|
|
@ -1,32 +0,0 @@
|
|||
- name: install "postgres"
|
||||
become: yes
|
||||
apt:
|
||||
name: "{{ postgres_programme }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
cache_valid_time: 1800 #https://stackoverflow.com/questions/41535838/how-to-run-apt-update-and-upgrade-via-ansible-shell
|
||||
|
||||
- name: install "setfacl support"
|
||||
become: yes
|
||||
apt:
|
||||
name: acl
|
||||
|
||||
- name: Create database
|
||||
become: true
|
||||
become_user: postgres
|
||||
postgresql_db:
|
||||
name: "{{ item.name_db }}"
|
||||
loop: "{{ postgres_user_and_db }}"
|
||||
no_log: true
|
||||
|
||||
- name: Connect to database, create users and grant access to database
|
||||
become: true
|
||||
become_user: postgres
|
||||
postgresql_user:
|
||||
db: "{{ item.name_db }}"
|
||||
name: "{{ item.name_db_user }}"
|
||||
password: "{{ item.password_db_user }}"
|
||||
priv: "ALL"
|
||||
role_attr_flags: SUPERUSER
|
||||
no_log: true
|
||||
loop: "{{ postgres_user_and_db }}"
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
- hosts: miniflux
|
||||
roles:
|
||||
- { role: mgrote.postgresql, tags: "postgres" }
|
||||
- { role: mgrote.miniflux, tags: "miniflux" }
|
||||
|
||||
###################################################################################################################
|
||||
# Danach cname einrichten: http://dokuwiki2.grote.lan/artikel/technik/reverseproxy?s[]=cname
|
||||
# und dann "nginx_reverse_proxy" anpassen und ausführen
|
||||
###################################################################################################################
|
|
@ -1,23 +0,0 @@
|
|||
---
|
||||
### mgrote.postgresql
|
||||
# Variable für Lookup
|
||||
lookup_var_postgres_user_and_db: "{{ lookup('keepass', 'postgres_user_and_db', 'password') }}"
|
||||
postgres_user_and_db:
|
||||
- { name_db: 'miniflux_db', name_db_user: 'miniflux_db_user', password_db_user: "{{ lookup_var_postgres_user_and_db }}" }
|
||||
### mgrote.miniflux
|
||||
miniflux_linux_user: miniflux
|
||||
miniflux_db_user_name: miniflux_db_user
|
||||
miniflux_db_user_password: "{{ lookup('keepass', 'miniflux_db_user_password', 'password') }}"
|
||||
miniflux_db: miniflux_db
|
||||
miniflux_admin_name: admin
|
||||
miniflux_admin_passwort: "{{ lookup('keepass', 'miniflux_admin_passwort', 'password') }}"
|
||||
miniflux_port: 8080
|
||||
### oefenweb.ufw
|
||||
ufw_rules:
|
||||
- rule: allow
|
||||
to_port: 22
|
||||
protocol: tcp
|
||||
comment: 'ssh'
|
||||
- rule: allow
|
||||
to_port: 8080
|
||||
comment: 'miniflux'
|
|
@ -1,50 +0,0 @@
|
|||
---
|
||||
language: python
|
||||
python: "2.7"
|
||||
|
||||
# Use the new container infrastructure
|
||||
sudo: required
|
||||
|
||||
# Install ansible
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- python-pip
|
||||
|
||||
install:
|
||||
# Install ansible
|
||||
- pip install ansible
|
||||
|
||||
# Check ansible version
|
||||
- ansible --version
|
||||
|
||||
# Create ansible.cfg with correct roles_path
|
||||
- printf '[defaults]\nroles_path=../' >ansible.cfg
|
||||
|
||||
# Install dependendies roles
|
||||
- ansible-galaxy install hispanico.nginx-revproxy
|
||||
|
||||
script:
|
||||
# Basic role syntax check
|
||||
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
|
||||
|
||||
# Run the role/playbook with ansible-playbook
|
||||
- ansible-playbook tests/test.yml -i tests/inventory --connection=local --become
|
||||
|
||||
# Run the role/playbook again, checking to make sure it's idempotent
|
||||
- >
|
||||
ansible-playbook tests/test.yml -i tests/inventory --connection=local --become
|
||||
| grep -q 'changed=0.*failed=0'
|
||||
&& (echo 'Idempotence test: pass' && exit 0)
|
||||
|| (echo 'Idempotence test: fail' && exit 1)
|
||||
|
||||
# Check for role is done
|
||||
- sudo service nginx status
|
||||
- sudo netstat -ntulp |grep nginx
|
||||
- sudo ls /etc/nginx/sites-enabled/
|
||||
- for i in $(sudo ls /etc/nginx/sites-enabled/); do echo $i;echo "------------------------------"; sudo cat /etc/nginx/sites-enabled/$i; echo "------------------------------";echo ""; done
|
||||
- sudo ls -l /usr/bin/certbot-auto
|
||||
- sudo crontab -l
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
@ -1,77 +0,0 @@
|
|||
ansible-letsencrypt-nginx-revproxy
|
||||
=========
|
||||
[![Build Status](https://img.shields.io/travis/hispanico/ansible-letsencrypt-nginx-revproxy.svg?style=flat-square)](https://travis-ci.org/hispanico/ansible-letsencrypt-nginx-revproxy)
|
||||
[![Galaxy](https://img.shields.io/badge/galaxy-hispanico.letsencrypt--nginx--revproxy-blue.svg?style=flat-square)](https://galaxy.ansible.com/hispanico/letsencrypt-nginx-revproxy/)
|
||||
|
||||
Configures Nginx as reverse proxy for multiple website with Let's Encrypt certificate.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
This role requires Ansible 1.9 or higher.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
Default values:
|
||||
|
||||
```yaml
|
||||
nginx_revproxy_sites: # List of sites to reverse proxy
|
||||
example.com: # Domain name
|
||||
domains: # List of server_name aliases
|
||||
- example.com
|
||||
- www.example.com
|
||||
upstreams: # List of Upstreams
|
||||
- { backend_address: 192.168.0.100, backend_port: 80 }
|
||||
- { backend_address: 192.168.0.101, backend_port: 8080 }
|
||||
letsencrypt: true # Set to True if you are using hispanico.letsencrypt-nginx-revproxy role
|
||||
letsencrypt_email: 'contatti@ninux.org'
|
||||
```
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
* [hispanico.nginx-revproxy](https://galaxy.ansible.com/hispanico/nginx-revproxy)
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
This esample configure nginx as reverse proxy for the following sites:
|
||||
* example.org with selfsign ssl certificate
|
||||
* example.com ssl certificate generate via let's encrypt ACME protocol.
|
||||
|
||||
```yaml
|
||||
- hosts: all
|
||||
roles:
|
||||
- ansible-nginx-revproxy
|
||||
- ansible-letsencrypt-nginx-revproxy
|
||||
vars:
|
||||
nginx_revproxy_sites:
|
||||
example.org:
|
||||
domains:
|
||||
- example.org
|
||||
- www.example.org
|
||||
upstreams:
|
||||
- { backend_address: 192.168.0.200, backend_port: 80 }
|
||||
- { backend_address: 192.168.0.201, backend_port: 80 }
|
||||
letsencrypt: false
|
||||
|
||||
example.com:
|
||||
domains:
|
||||
- example.com
|
||||
- www.example.com
|
||||
upstreams:
|
||||
- { backend_address: 192.168.0.100, backend_port: 80 }
|
||||
- { backend_address: 192.168.0.101, backend_port: 80 }
|
||||
letsencrypt: true
|
||||
```
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Licensed under the GPLv3 License. See the LICENSE file for details.
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
Hispanico
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
|
||||
nginx_revproxy_sites: # List of sites to reverse proxy
|
||||
example.com: # Domain name
|
||||
domains: # List of server_name aliases
|
||||
- example.com
|
||||
- www.example.com
|
||||
upstreams: # List of Upstreams
|
||||
- { backend_address: 192.168.0.100, backend_port: 80 }
|
||||
- { backend_address: 192.168.0.101, backend_port: 8080 }
|
||||
ssl: false # Set to True if you want to redirect http to https
|
||||
hsts_max_age: 63072000 # Set HSTS header with max-age defined
|
||||
letsencrypt: false # Set to True if you are using hispanico.letsencrypt-nginx-revproxy role
|
||||
letsencrypt_email: 'info@example.com'
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
- name: Start Nginx
|
||||
service: name=nginx state=started
|
||||
|
||||
- name: Reload Nginx
|
||||
service: name=nginx state=reloaded
|
|
@ -1 +0,0 @@
|
|||
{install_date: 'Sun Mar 29 15:01:58 2020', version: master}
|
|
@ -1,21 +0,0 @@
|
|||
galaxy_info:
|
||||
author: Hispanico
|
||||
description: Manage Nginx as Reverse Proxy
|
||||
license: GPLv3
|
||||
|
||||
min_ansible_version: 1.2
|
||||
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- trusty
|
||||
- xenial
|
||||
|
||||
galaxy_tags:
|
||||
- system
|
||||
- nginx
|
||||
- reverseproxy
|
||||
- letsencrypt
|
||||
|
||||
dependencies:
|
||||
- hispanico.nginx-revproxy
|
|
@ -1,39 +0,0 @@
|
|||
---
|
||||
- name: Install certbot
|
||||
get_url:
|
||||
url: https://dl.eff.org/certbot-auto
|
||||
dest: /usr/bin/certbot-auto
|
||||
mode: "a+x"
|
||||
tags:
|
||||
- letsencrypt
|
||||
|
||||
- name: Generate certs (first time)
|
||||
command: certbot-auto certonly --webroot -w /var/www/{{ item.key }} -d {{ item.value.domains | join(' -d ') }} --email {{ item.value.letsencrypt_email }} --non-interactive --agree-tos creates=/etc/letsencrypt/live/{{ item.key }}/fullchain.pem
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
when: item.value.letsencrypt | default(False)
|
||||
tags:
|
||||
- letsencrypt
|
||||
|
||||
- name: Update Site Config
|
||||
template:
|
||||
src=reverseproxy_ssl.conf.j2
|
||||
dest=/etc/nginx/sites-available/{{ item.key }}.conf
|
||||
owner=root
|
||||
group=root
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
when:
|
||||
- item.value.letsencrypt | default(False)
|
||||
notify:
|
||||
- Reload Nginx
|
||||
tags:
|
||||
- letsencrypt
|
||||
|
||||
- name: Insert cert-bot renew in crontab
|
||||
cron:
|
||||
name: "cert-bot renew"
|
||||
minute: 30
|
||||
hour: 3
|
||||
weekday: 1
|
||||
job: 'certbot-auto renew --post-hook "systemctl reload nginx" >> /var/log/letsencrypt/letsencrypt-update.log 2>&1'
|
||||
tags:
|
||||
- letsencrypt
|
|
@ -1,67 +0,0 @@
|
|||
################################################################################
|
||||
# This file was generated by Ansible for {{ansible_fqdn}}
|
||||
# Do NOT modify this file by hand!
|
||||
################################################################################
|
||||
|
||||
upstream {{ item.key }}_backend {
|
||||
{% for upstream in item.value.upstreams %}
|
||||
server {{upstream.backend_address}}:{{upstream.backend_port}};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
location / {
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
location /.well-known {
|
||||
alias /var/www/{{ item.key }}/.well-known;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
|
||||
{% if item.value.hsts_max_age is defined %}
|
||||
add_header Strict-Transport-Security "max-age={{ item.value.hsts_max_age }}; includeSubDomains; preload" always;
|
||||
{% endif %}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/letsencrypt/live/{{ item.key }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ item.key }}/privkey.pem;
|
||||
ssl_session_timeout 5m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
|
||||
location /.well-known {
|
||||
alias /var/www/{{ item.key }}/.well-known;
|
||||
}
|
||||
|
||||
location / {
|
||||
gzip off;
|
||||
proxy_set_header X-Forwarded-Ssl on;
|
||||
client_max_body_size {{ item.value.client_max_body_size | default('50M') }};
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
proxy_pass http://{{ item.key }}_backend;
|
||||
}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
################################################################################
|
||||
# This file was generated by Ansible for {{ansible_fqdn}}
|
||||
# Do NOT modify this file by hand!
|
||||
################################################################################
|
||||
|
||||
upstream {{ item.key }}_backend {
|
||||
{% for upstream in item.value.upstreams %}
|
||||
server {{upstream.backend_address}}:{{upstream.backend_port}};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
location / {
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
location /.well-known {
|
||||
alias /var/www/{{ item.key }}/.well-known;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen [::]:443 ssl;
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
|
||||
{% if item.value.hsts_max_age is defined %}
|
||||
add_header Strict-Transport-Security "max-age={{ item.value.hsts_max_age }}; includeSubDomains; preload" always;
|
||||
{% endif %}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/letsencrypt/live/{{ item.key }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ item.key }}/privkey.pem;
|
||||
ssl_session_timeout 5m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
|
||||
location /.well-known {
|
||||
alias /var/www/{{ item.key }}/.well-known;
|
||||
}
|
||||
|
||||
location / {
|
||||
gzip off;
|
||||
proxy_set_header X-Forwarded-Ssl on;
|
||||
client_max_body_size {{ item.value.client_max_body_size | default('50M') }};
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
proxy_pass http://{{ item.key }}_backend;
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
localhost
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
|
||||
roles:
|
||||
- {role: hispanico.nginx-revproxy}
|
||||
- {role: ansible-letsencrypt-nginx-revproxy}
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
# vars file for roles/letsencrypt
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
os: linux
|
||||
language: python
|
||||
services: docker
|
||||
|
||||
env:
|
||||
global:
|
||||
- ROLE_NAME: nginx-revproxy
|
||||
jobs:
|
||||
# - MOLECULE_DISTRO: centos7
|
||||
- MOLECULE_DISTRO: ubuntu1604
|
||||
- MOLECULE_DISTRO: ubuntu1804
|
||||
- MOLECULE_DISTRO: debian9
|
||||
- MOLECULE_DISTRO: debian10
|
||||
|
||||
install:
|
||||
# Install test dependencies.
|
||||
- pip install molecule docker
|
||||
|
||||
before_script:
|
||||
# Use actual Ansible Galaxy role name for the project directory.
|
||||
- cd ../
|
||||
- mv ansible-$ROLE_NAME hispanico.$ROLE_NAME
|
||||
- cd hispanico.$ROLE_NAME
|
||||
|
||||
script:
|
||||
# Run tests.
|
||||
- molecule test
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
@ -1,674 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
ansible-nginx-revproxy
|
||||
Copyright (C) 2017 Hispanico
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
ansible-nginx-revproxy Copyright (C) 2017 Hispanico
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
@ -1,90 +0,0 @@
|
|||
ansible-nginx-revproxy
|
||||
=========
|
||||
|
||||
[![Build Status](https://img.shields.io/travis/hispanico/ansible-nginx-revproxy.svg?style=flat-square)](https://travis-ci.org/hispanico/ansible-nginx-revproxy)
|
||||
[![Galaxy](https://img.shields.io/badge/galaxy-hispanico.nginx--revproxy-blue.svg?style=flat-square)](https://galaxy.ansible.com/hispanico/nginx-revproxy/)
|
||||
|
||||
Install and configures Nginx as reverse proxy for multiple website.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
This role requires Ansible 2.4 or higher.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
Default values:
|
||||
|
||||
```yaml
|
||||
nginx_revproxy_sites: # List of sites to reverse proxy
|
||||
default: # Set defualt site to return 444 (Connection Closed Without Response)
|
||||
ssl: false # Set to True if you want to redirect http to https
|
||||
letsencrypt: false
|
||||
|
||||
example.com: # Domain name
|
||||
domains: # List of server_name aliases
|
||||
- example.com
|
||||
- www.example.com
|
||||
upstreams: # List of Upstreams
|
||||
- { backend_address: 192.168.0.100, backend_port: 80 }
|
||||
- { backend_address: 192.168.0.101, backend_port: 8080 }
|
||||
auth: # Define this block for a single HTTP user/password, or leave undefined for unauthenticated vhosts
|
||||
login: myusername
|
||||
password: mysecretpassword
|
||||
listen: 9000 # Specify which port you want to listen to with clear HTTP, or leave undefined for 80
|
||||
ssl: false # Set to True if you want to redirect http to https
|
||||
letsencrypt: false # Set to True if you are using hispanico.letsencrypt-nginx-revproxy role
|
||||
|
||||
example.org: # Domain name
|
||||
domains: # List of server_name aliases
|
||||
- example.org
|
||||
- www.example.org
|
||||
upstreams: # List of Upstreams
|
||||
- { backend_address: 192.168.0.200, backend_port: 80 }
|
||||
- { backend_address: 192.168.0.201, backend_port: 8080 }
|
||||
listen: 9000 # Specify which port you want to listen to with clear HTTP, or leave undefined for 80
|
||||
listen_ssl: 9001 # Specify which port you want to listen to with HTTPS, or leave undefined for 443
|
||||
ssl: true # Set to True if you want to redirect http to https
|
||||
letsencrypt: false # Set to True if you want use letsencrypt
|
||||
letsencrypt_email: "" # Set email for letencrypt cert
|
||||
```
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
None.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
```yaml
|
||||
- hosts: all
|
||||
roles:
|
||||
- ansible-nginx-revproxy
|
||||
vars:
|
||||
nginx_revproxy_sites:
|
||||
default:
|
||||
ssl: false
|
||||
letsencrypt: false
|
||||
|
||||
example.com:
|
||||
domains:
|
||||
- example.com
|
||||
- www.example.com
|
||||
upstreams:
|
||||
- { backend_address: 192.168.0.100, backend_port: 80 }
|
||||
- { backend_address: 192.168.0.101, backend_port: 80 }
|
||||
ssl: true
|
||||
letsencrypt: false
|
||||
```
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Licensed under the GPLv3 License. See the LICENSE file for details.
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
Hispanico
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
|
||||
nginx_revproxy_sites: # List of sites to reverse proxy
|
||||
example.com: # Domain name
|
||||
domains: # List of server_name aliases
|
||||
- example.com
|
||||
- www.example.com
|
||||
upstreams: # List of Upstreams
|
||||
- {backend_address: 192.168.0.100, backend_port: 80}
|
||||
- {backend_address: 192.168.0.101, backend_port: 8080}
|
||||
ssl: true # Set to True if you want to redirect http to https
|
||||
hsts_max_age: 63072000 # Set HSTS header with max-age defined
|
||||
letsencrypt: false # Set to True if you want use letsencrypt
|
||||
letsencrypt_email: "" # Set email for letencrypt cert
|
|
@ -1,15 +0,0 @@
|
|||
---
|
||||
- name: Start Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: started
|
||||
|
||||
- name: Reload Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
|
||||
- name: Restart Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: restarted
|
|
@ -1 +0,0 @@
|
|||
{install_date: 'Sun Mar 29 15:02:01 2020', version: v1.1.5}
|
|
@ -1,29 +0,0 @@
|
|||
---
|
||||
|
||||
galaxy_info:
|
||||
author: Hispanico
|
||||
description: Manage Nginx as Reverse Proxy
|
||||
license: GPLv3
|
||||
|
||||
min_ansible_version: 2.4
|
||||
|
||||
platforms:
|
||||
- name: Debian
|
||||
versions:
|
||||
- stretch
|
||||
- buster
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- xenial
|
||||
- bionic
|
||||
|
||||
galaxy_tags:
|
||||
- development
|
||||
- web
|
||||
- nginx
|
||||
- reverse
|
||||
- proxy
|
||||
- load
|
||||
- balancer
|
||||
|
||||
dependencies: []
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
lint:
|
||||
name: yamllint
|
||||
options:
|
||||
config-file: molecule/default/yaml-lint.yml
|
||||
enabled: true
|
||||
platforms:
|
||||
- name: "${ROLE_NAME}-${MOLECULE_DISTRO:-centos7}"
|
||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
- /var/lib/docker
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
provisioner:
|
||||
name: ansible
|
||||
lint:
|
||||
name: ansible-lint
|
||||
playbooks:
|
||||
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
|
||||
scenario:
|
||||
name: default
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
name: flake8
|
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
pre_tasks:
|
||||
- name: Install cron (RedHat).
|
||||
yum:
|
||||
name: cronie
|
||||
state: present
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Install cron (Debian).
|
||||
apt:
|
||||
name: cron
|
||||
state: present
|
||||
when: ansible_distribution == 'Debian'
|
||||
|
||||
- name: Update apt cache.
|
||||
apt:
|
||||
update_cache: true
|
||||
cache_valid_time: 600
|
||||
when: ansible_distribution == 'Ubuntu'
|
||||
|
||||
roles:
|
||||
- role: hispanico.nginx-revproxy
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
extends: default
|
||||
rules:
|
||||
line-length:
|
||||
max: 150
|
||||
level: warning
|
|
@ -1,98 +0,0 @@
|
|||
---
|
||||
|
||||
- name: Install certbot
|
||||
get_url:
|
||||
url: https://dl.eff.org/certbot-auto
|
||||
dest: /usr/bin/certbot-auto
|
||||
mode: "a+x"
|
||||
tags:
|
||||
- lesencrypt
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Get Active Sites
|
||||
command: ls -1 /etc/nginx/sites-enabled/
|
||||
changed_when: "active.stdout_lines != nginx_revproxy_sites.keys()|sort()"
|
||||
check_mode: false
|
||||
register: active
|
||||
tags:
|
||||
- lesencrypt
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Enable sites for ACME protocol
|
||||
block:
|
||||
- name: Add Https Site Config
|
||||
template:
|
||||
src: reverseproxy_ssl.conf.j2
|
||||
dest: /etc/nginx/sites-available/{{ item.key }}.conf
|
||||
owner: root
|
||||
group: root
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
register: siteconfig
|
||||
when:
|
||||
- item.value.letsencrypt | default(False)
|
||||
- item.key not in active.stdout_lines
|
||||
|
||||
- name: Enable Site Config
|
||||
file:
|
||||
src: /etc/nginx/sites-available/{{ item.key }}.conf
|
||||
dest: /etc/nginx/sites-enabled/{{ item.key }}
|
||||
state: link
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
register: site_enabled
|
||||
when:
|
||||
- siteconfig is success
|
||||
- not ansible_check_mode
|
||||
- item.value.letsencrypt | default(False)
|
||||
- item.key not in active.stdout_lines
|
||||
|
||||
- name: Reload Nginx
|
||||
service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
when:
|
||||
- site_enabled is success
|
||||
when:
|
||||
- active.changed
|
||||
- nginxinstalled is success
|
||||
tags:
|
||||
- lesencrypt
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Generate certs (first time)
|
||||
command: |
|
||||
certbot-auto certonly
|
||||
--webroot -w /var/www/{{ item.key }}
|
||||
-d {{ item.value.domains | join(' -d ') }}
|
||||
--email {{ item.value.letsencrypt_email }}
|
||||
--non-interactive --cert-name {{ item.key }}
|
||||
--agree-tos creates=/etc/letsencrypt/live/{{ item.key }}/fullchain.pem
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
when: item.value.letsencrypt | default(False)
|
||||
tags:
|
||||
- lesencrypt
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Update Site Config
|
||||
template:
|
||||
src: reverseproxy_ssl_letsencrypt.conf.j2
|
||||
dest: /etc/nginx/sites-available/{{ item.key }}.conf
|
||||
owner: root
|
||||
group: root
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
notify: Reload Nginx
|
||||
when:
|
||||
- item.value.letsencrypt | default(False)
|
||||
tags:
|
||||
- lesencrypt
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Insert cert-bot renew in crontab
|
||||
cron:
|
||||
name: "cert-bot renew"
|
||||
job: 'certbot-auto renew --post-hook "systemctl reload nginx" >> /var/log/letsencrypt/letsencrypt-update.log 2>&1'
|
||||
hour: "3"
|
||||
minute: "30"
|
||||
weekday: "1"
|
||||
tags:
|
||||
- lesencrypt
|
||||
- nginxrevproxy
|
|
@ -1,190 +0,0 @@
|
|||
---
|
||||
|
||||
- name: Install Nginx and ssl-cert
|
||||
apt:
|
||||
name:
|
||||
- nginx
|
||||
- ssl-cert
|
||||
state: present
|
||||
register:
|
||||
nginxinstalled
|
||||
delay: 10
|
||||
retries: 12
|
||||
until: nginxinstalled is successful
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
- packages
|
||||
|
||||
- name: Install python-passlib for Python 3 hosts
|
||||
apt:
|
||||
name:
|
||||
- "python3-passlib"
|
||||
state: present
|
||||
register:
|
||||
result
|
||||
delay: 10
|
||||
retries: 12
|
||||
until: result is successful
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
- packages
|
||||
when:
|
||||
- ansible_python['version']['major'] == 3
|
||||
|
||||
- name: Install python-passlib for Python 2 hosts
|
||||
apt:
|
||||
name:
|
||||
- "python-passlib"
|
||||
state: present
|
||||
register:
|
||||
result
|
||||
delay: 10
|
||||
retries: 12
|
||||
until: result is successful
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
- packages
|
||||
when:
|
||||
- ansible_python['version']['major'] == 2
|
||||
|
||||
- name: Set up nginx directories
|
||||
file:
|
||||
path: "/etc/nginx/{{ item }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
with_items:
|
||||
- sites-available
|
||||
- sites-enabled
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Add authentication
|
||||
htpasswd:
|
||||
path: "/etc/nginx/{{ item.key }}_htpasswd"
|
||||
name: "{{ item.value.auth.login }}"
|
||||
password: "{{ item.value.auth.password }}"
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
when:
|
||||
- nginxinstalled is success
|
||||
- item.value.auth is defined
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Add Site Config
|
||||
template:
|
||||
src: reverseproxy.conf.j2
|
||||
dest: /etc/nginx/sites-available/{{ item.key }}.conf
|
||||
owner: root
|
||||
group: root
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
register:
|
||||
siteconfig
|
||||
when:
|
||||
- nginxinstalled is success
|
||||
- not item.value.ssl | default(True)
|
||||
- not item.value.letsencrypt | default(True)
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Add Https Site Config
|
||||
template:
|
||||
src: reverseproxy_ssl.conf.j2
|
||||
dest: /etc/nginx/sites-available/{{ item.key }}.conf
|
||||
owner: root
|
||||
group: root
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
register:
|
||||
siteconfig
|
||||
when:
|
||||
- nginxinstalled is success
|
||||
- item.value.ssl | default(False)
|
||||
- not item.value.letsencrypt | default(True)
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Get Active Sites
|
||||
command: ls -1 /etc/nginx/sites-enabled/
|
||||
changed_when: "active.stdout_lines != nginx_revproxy_sites.keys()|sort()"
|
||||
check_mode: false
|
||||
register: active
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: De-activate Sites
|
||||
file:
|
||||
path: /etc/nginx/sites-enabled/{{ item }}
|
||||
state: absent
|
||||
with_items: "{{ active.stdout_lines }}"
|
||||
notify: Reload Nginx
|
||||
when:
|
||||
- item not in nginx_revproxy_sites
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Enable Site Config
|
||||
file:
|
||||
src: /etc/nginx/sites-available/{{ item.key }}.conf
|
||||
dest: /etc/nginx/sites-enabled/{{ item.key }}
|
||||
state: link
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
notify: Reload Nginx
|
||||
when:
|
||||
- siteconfig is success
|
||||
- not item.value.letsencrypt | default(True)
|
||||
- not ansible_check_mode
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Create WebRoot sites
|
||||
file:
|
||||
dest: /var/www/{{ item.key }}/.well-known
|
||||
mode: 0775
|
||||
state: directory
|
||||
owner: www-data
|
||||
group: www-data
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
notify: Reload Nginx
|
||||
when:
|
||||
- nginxinstalled is success
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: WebRoot Permissions Sites
|
||||
file:
|
||||
dest: /var/www/{{ item.key }}
|
||||
mode: 0775
|
||||
state: directory
|
||||
owner: www-data
|
||||
group: www-data
|
||||
recurse: true
|
||||
with_dict: "{{ nginx_revproxy_sites }}"
|
||||
notify: Reload Nginx
|
||||
when:
|
||||
- nginxinstalled is success
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Get WebRoot Sites
|
||||
command: ls -1 /var/www/
|
||||
changed_when: "webroot.stdout_lines != nginx_revproxy_sites.keys()|sort()"
|
||||
check_mode: false
|
||||
register: webroot
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- name: Remove WebRoot Sites
|
||||
file:
|
||||
path: /var/www/{{ item }}/
|
||||
state: absent
|
||||
with_items: "{{ webroot.stdout_lines }}"
|
||||
notify: Reload Nginx
|
||||
when:
|
||||
- item not in nginx_revproxy_sites
|
||||
tags:
|
||||
- nginxrevproxy
|
||||
|
||||
- include_tasks: letsencrypt.yml
|
||||
tags:
|
||||
- lesencrypt
|
||||
- nginxrevproxy
|
|
@ -1,56 +0,0 @@
|
|||
################################################################################
|
||||
# This file was generated by Ansible for {{ansible_fqdn}}
|
||||
# Do NOT modify this file by hand!
|
||||
################################################################################
|
||||
|
||||
{% if item.key == "default" %}
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }} default_server;
|
||||
listen [::]:{{ item.value.listen | default(80) }} default_server;
|
||||
server_name _;
|
||||
return 444;
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
{% else %}
|
||||
upstream {{ item.key }}_backend {
|
||||
{% for upstream in item.value.upstreams %}
|
||||
server {{upstream.backend_address}}:{{upstream.backend_port}};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }};
|
||||
listen [::]:{{ item.value.listen | default(80) }};
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
|
||||
location / {
|
||||
gzip off;
|
||||
proxy_set_header X-Forwarded-Ssl on;
|
||||
client_max_body_size {{ item.value.client_max_body_size | default('50M') }};
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
proxy_pass http://{{ item.key }}_backend;
|
||||
{% if item.value.auth is defined %}
|
||||
auth_basic "Restricted Content";
|
||||
auth_basic_user_file /etc/nginx/{{ item.key }}_htpasswd;
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
location /.well-known {
|
||||
alias /var/www/{{ item.key }}/.well-known;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
{% endif %}
|
|
@ -1,104 +0,0 @@
|
|||
################################################################################
|
||||
# This file was generated by Ansible for {{ansible_fqdn}}
|
||||
# Do NOT modify this file by hand!
|
||||
################################################################################
|
||||
|
||||
{% if item.key == "default" %}
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }} default_server;
|
||||
listen [::]:{{ item.value.listen | default(80) }} default_server;
|
||||
server_name _;
|
||||
return 444;
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen_ssl | default(443) }} ssl http2 default_server;
|
||||
listen [::]:{{ item.value.listen_ssl | default(443) }} ssl http2 default_server;
|
||||
server_name _;
|
||||
return 444;
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
||||
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
||||
ssl_session_timeout 5m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
}
|
||||
|
||||
{% else %}
|
||||
upstream {{ item.key }}_backend {
|
||||
{% for upstream in item.value.upstreams %}
|
||||
server {{upstream.backend_address}}:{{upstream.backend_port}};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }};
|
||||
listen [::]:{{ item.value.listen | default(80) }};
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
location / {
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
location /.well-known/acme-challenge {
|
||||
alias /var/www/{{ item.key }}/.well-known/acme-challenge;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen_ssl | default(443) }} ssl http2;
|
||||
listen [::]:{{ item.value.listen_ssl | default(443) }} ssl http2;
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
|
||||
{% if item.value.hsts_max_age is defined %}
|
||||
add_header Strict-Transport-Security "max-age={{ item.value.hsts_max_age }}; includeSubDomains; preload" always;
|
||||
{% endif %}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
||||
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
||||
ssl_session_timeout 5m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
|
||||
location /.well-known/acme-challenge {
|
||||
alias /var/www/{{ item.key }}/.well-known/acme-challenge;
|
||||
}
|
||||
|
||||
location / {
|
||||
gzip off;
|
||||
proxy_set_header X-Forwarded-Ssl on;
|
||||
client_max_body_size {{ item.value.client_max_body_size | default('50M') }};
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
proxy_pass {{ item.value.backend_protocol | default('http') }}://{{ item.key }}_backend;
|
||||
{% if item.value.auth is defined %}
|
||||
auth_basic "Restricted Content";
|
||||
auth_basic_user_file /etc/nginx/{{ item.key }}_htpasswd;
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
{% endif %}
|
|
@ -1,71 +0,0 @@
|
|||
################################################################################
|
||||
# This file was generated by Ansible for {{ansible_fqdn}}
|
||||
# Do NOT modify this file by hand!
|
||||
################################################################################
|
||||
|
||||
upstream {{ item.key }}_backend {
|
||||
{% for upstream in item.value.upstreams %}
|
||||
server {{upstream.backend_address}}:{{upstream.backend_port}};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }};
|
||||
listen [::]:{{ item.value.listen | default(80) }};
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
location / {
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
location /.well-known/acme-challenge {
|
||||
alias /var/www/{{ item.key }}/.well-known/acme-challenge;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen_ssl | default(443) }} ssl http2;
|
||||
listen [::]:{{ item.value.listen_ssl | default(443) }} ssl http2;
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
|
||||
{% if item.value.hsts_max_age is defined %}
|
||||
add_header Strict-Transport-Security "max-age={{ item.value.hsts_max_age }}; includeSubDomains; preload" always;
|
||||
{% endif %}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/letsencrypt/live/{{ item.key }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ item.key }}/privkey.pem;
|
||||
ssl_session_timeout 5m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
|
||||
location /.well-known/acme-challenge {
|
||||
alias /var/www/{{ item.key }}/.well-known/acme-challenge;
|
||||
}
|
||||
|
||||
location / {
|
||||
gzip off;
|
||||
proxy_set_header X-Forwarded-Ssl on;
|
||||
client_max_body_size {{ item.value.client_max_body_size | default('50M') }};
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
proxy_pass {{ item.value.backend_protocol | default('http') }}://{{ item.key }}_backend;
|
||||
{% if item.value.auth is defined %}
|
||||
auth_basic "Restricted Content";
|
||||
auth_basic_user_file /etc/nginx/{{ item.key }}_htpasswd;
|
||||
{% endif %}
|
||||
}
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
################################################################################
|
||||
# This file was generated by Ansible for {{ansible_fqdn}}
|
||||
# Do NOT modify this file by hand!
|
||||
################################################################################
|
||||
|
||||
{% if item.key == "default" %}
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }} default_server;
|
||||
listen [::]:{{ item.value.listen | default(80) }} default_server;
|
||||
server_name _;
|
||||
return 444;
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
{% else %}
|
||||
upstream {{ item.key }}_backend {
|
||||
{% for upstream in item.value.upstreams %}
|
||||
server {{upstream.backend_address}}:{{upstream.backend_port}};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }};
|
||||
listen [::]:{{ item.value.listen | default(80) }};
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
|
||||
location / {
|
||||
gzip off;
|
||||
proxy_set_header X-Forwarded-Ssl on;
|
||||
client_max_body_size {{ item.value.client_max_body_size | default('50M') }};
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
proxy_pass http://{{ item.key }}_backend;
|
||||
{% if item.value.auth is defined %}
|
||||
auth_basic "Restricted Content";
|
||||
auth_basic_user_file /etc/nginx/{{ item.key }}_htpasswd;
|
||||
{% endif %}
|
||||
}
|
||||
|
||||
location /.well-known {
|
||||
alias /var/www/{{ item.key }}/.well-known;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
{% endif %}
|
|
@ -1,104 +0,0 @@
|
|||
################################################################################
|
||||
# This file was generated by Ansible for {{ansible_fqdn}}
|
||||
# Do NOT modify this file by hand!
|
||||
################################################################################
|
||||
|
||||
{% if item.key == "default" %}
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }} default_server;
|
||||
listen [::]:{{ item.value.listen | default(80) }} default_server;
|
||||
server_name _;
|
||||
return 444;
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen_ssl | default(443) }} ssl http2 default_server;
|
||||
listen [::]:{{ item.value.listen_ssl | default(443) }} ssl http2 default_server;
|
||||
server_name _;
|
||||
return 444;
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
||||
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
||||
ssl_session_timeout 5m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
}
|
||||
|
||||
{% else %}
|
||||
upstream {{ item.key }}_backend {
|
||||
{% for upstream in item.value.upstreams %}
|
||||
server {{upstream.backend_address}}:{{upstream.backend_port}};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }};
|
||||
listen [::]:{{ item.value.listen | default(80) }};
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
location / {
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
location /.well-known/acme-challenge {
|
||||
alias /var/www/{{ item.key }}/.well-known/acme-challenge;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen_ssl | default(443) }} ssl http2;
|
||||
listen [::]:{{ item.value.listen_ssl | default(443) }} ssl http2;
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
|
||||
{% if item.value.hsts_max_age is defined %}
|
||||
add_header Strict-Transport-Security "max-age={{ item.value.hsts_max_age }}; includeSubDomains; preload" always;
|
||||
{% endif %}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
||||
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
||||
ssl_session_timeout 5m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
|
||||
location /.well-known/acme-challenge {
|
||||
alias /var/www/{{ item.key }}/.well-known/acme-challenge;
|
||||
}
|
||||
|
||||
location / {
|
||||
gzip off;
|
||||
proxy_set_header X-Forwarded-Ssl on;
|
||||
client_max_body_size {{ item.value.client_max_body_size | default('50M') }};
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
proxy_pass {{ item.value.backend_protocol | default('http') }}://{{ item.key }}_backend;
|
||||
{% if item.value.auth is defined %}
|
||||
auth_basic "Restricted Content";
|
||||
auth_basic_user_file /etc/nginx/{{ item.key }}_htpasswd;
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
{% endif %}
|
|
@ -1,71 +0,0 @@
|
|||
################################################################################
|
||||
# This file was generated by Ansible for {{ansible_fqdn}}
|
||||
# Do NOT modify this file by hand!
|
||||
################################################################################
|
||||
|
||||
upstream {{ item.key }}_backend {
|
||||
{% for upstream in item.value.upstreams %}
|
||||
server {{upstream.backend_address}}:{{upstream.backend_port}};
|
||||
{% endfor %}
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen | default(80) }};
|
||||
listen [::]:{{ item.value.listen | default(80) }};
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
location / {
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
|
||||
location /.well-known/acme-challenge {
|
||||
alias /var/www/{{ item.key }}/.well-known/acme-challenge;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen {{ item.value.listen_ssl | default(443) }} ssl http2;
|
||||
listen [::]:{{ item.value.listen_ssl | default(443) }} ssl http2;
|
||||
server_name {{ item.value.domains | join(' ') }};
|
||||
|
||||
{% if item.value.hsts_max_age is defined %}
|
||||
add_header Strict-Transport-Security "max-age={{ item.value.hsts_max_age }}; includeSubDomains; preload" always;
|
||||
{% endif %}
|
||||
|
||||
access_log /var/log/nginx/{{ item.key }}_access.log;
|
||||
error_log /var/log/nginx/{{ item.key }}_error.log error;
|
||||
|
||||
ssl on;
|
||||
ssl_certificate /etc/letsencrypt/live/{{ item.key }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ item.key }}/privkey.pem;
|
||||
ssl_session_timeout 5m;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
|
||||
location /.well-known/acme-challenge {
|
||||
alias /var/www/{{ item.key }}/.well-known/acme-challenge;
|
||||
}
|
||||
|
||||
location / {
|
||||
gzip off;
|
||||
proxy_set_header X-Forwarded-Ssl on;
|
||||
client_max_body_size {{ item.value.client_max_body_size | default('50M') }};
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Frame-Options SAMEORIGIN;
|
||||
proxy_pass {{ item.value.backend_protocol | default('http') }}://{{ item.key }}_backend;
|
||||
{% if item.value.auth is defined %}
|
||||
auth_basic "Restricted Content";
|
||||
auth_basic_user_file /etc/nginx/{{ item.key }}_htpasswd;
|
||||
{% endif %}
|
||||
}
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
# vars file for roles/ansible-nginx-revproxy
|
|
@ -1,45 +0,0 @@
|
|||
---
|
||||
- hosts: reverseproxy
|
||||
tasks:
|
||||
- name: certbot installieren
|
||||
become: yes
|
||||
apt:
|
||||
name:
|
||||
- certbot
|
||||
- python3-certbot-nginx
|
||||
state: present
|
||||
# sudo certbot --nginx
|
||||
# https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx
|
||||
roles:
|
||||
- { role: hispanico.letsencrypt-nginx-revproxy, tags: "letsencrypt-nginx-revproxy", become: true }
|
||||
# Variablen liegen unter roles/ansible-nginx-revproxy/vars/main.yml
|
||||
vars:
|
||||
nginx_revproxy_sites:
|
||||
#vhost fuer dokuwiki + der normale-domainname + letsencrypt-Zertifikat
|
||||
dokuwiki.mgrote.net:
|
||||
domains:
|
||||
- dokuwiki.mgrote.net
|
||||
- www.mgrote.net
|
||||
- mgrote.net
|
||||
upstreams:
|
||||
- { backend_address: dokuwiki2.grote.lan, backend_port: 80 }
|
||||
letsencrypt: true
|
||||
letsencrypt_email: "michael.grote@posteo.de"
|
||||
#vhost fuer miniflux + letsencrypt-Zertifikat
|
||||
miniflux.mgrote.net:
|
||||
domains:
|
||||
- miniflux.mgrote.net
|
||||
upstreams:
|
||||
- { backend_address: miniflux.grote.lan, backend_port: 8080 }
|
||||
letsencrypt: true
|
||||
letsencrypt_email: "michael.grote@posteo.de"
|
||||
telegraf_x509_domains: # im template wird die variable mit "|to_json}}" verwertet da sonst am anfang 'u und []' stehen
|
||||
- "https://mgrote.net:443" #port muss mit angegeben werden
|
||||
- "https://dokuwiki.mgrote.net:443"
|
||||
- "https://miniflux.mgrote.net:443"
|
||||
- "https://miniflux-staging.mgrote.net:443"
|
||||
telegraf_x509_metrics: true
|
||||
|
||||
##################################################
|
||||
# der CNAME muss vorher eingerichtet werden! #
|
||||
##################################################
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
### oefenweb.ufw
|
||||
ufw_rules:
|
||||
- rule: allow
|
||||
to_port: 22
|
||||
protocol: tcp
|
||||
comment: 'ssh'
|
||||
- rule: allow
|
||||
to_port: 443
|
||||
comment: 'https'
|
||||
- rule: allow
|
||||
to_port: 80
|
||||
comment: 'http'
|
0
Archiv/gitlab/.gitmodules
vendored
0
Archiv/gitlab/.gitmodules
vendored
|
@ -1,3 +0,0 @@
|
|||
skip_list:
|
||||
- '106'
|
||||
- '403'
|
|
@ -1,4 +0,0 @@
|
|||
# These are supported funding model platforms
|
||||
---
|
||||
github: geerlingguy
|
||||
patreon: geerlingguy
|
|
@ -1,56 +0,0 @@
|
|||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 90
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
daysUntilClose: 30
|
||||
|
||||
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
|
||||
onlyLabels: []
|
||||
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
- planned
|
||||
|
||||
# Set to true to ignore issues in a project (defaults to false)
|
||||
exemptProjects: false
|
||||
|
||||
# Set to true to ignore issues in a milestone (defaults to false)
|
||||
exemptMilestones: false
|
||||
|
||||
# Set to true to ignore issues with an assignee (defaults to false)
|
||||
exemptAssignees: false
|
||||
|
||||
# Label to use when marking as stale
|
||||
staleLabel: stale
|
||||
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 30
|
||||
|
||||
pulls:
|
||||
markComment: |-
|
||||
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
|
||||
|
||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
|
||||
|
||||
unmarkComment: >-
|
||||
This pull request is no longer marked for closure.
|
||||
|
||||
closeComment: >-
|
||||
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
|
||||
|
||||
issues:
|
||||
markComment: |-
|
||||
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
|
||||
|
||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
|
||||
|
||||
unmarkComment: >-
|
||||
This issue is no longer marked for closure.
|
||||
|
||||
closeComment: >-
|
||||
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
|
|
@ -1,76 +0,0 @@
|
|||
---
|
||||
name: CI
|
||||
'on':
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: "0 7 * * 1"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: 'geerlingguy.gitlab'
|
||||
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: 'geerlingguy.gitlab'
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install yamllint ansible-lint
|
||||
|
||||
- name: Lint code.
|
||||
run: |
|
||||
yamllint .
|
||||
ansible-lint
|
||||
|
||||
molecule:
|
||||
name: Molecule
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distro: centos7
|
||||
playbook: converge.yml
|
||||
- distro: ubuntu1804
|
||||
playbook: converge.yml
|
||||
- distro: debian9
|
||||
playbook: converge.yml
|
||||
- distro: centos7
|
||||
playbook: version.yml
|
||||
- distro: ubuntu1804
|
||||
playbook: version.yml
|
||||
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: 'geerlingguy.gitlab'
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install ansible molecule[docker] docker
|
||||
|
||||
- name: Run Molecule tests.
|
||||
run: molecule test
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
|
|
@ -1,38 +0,0 @@
|
|||
---
|
||||
# This workflow requires a GALAXY_API_KEY secret present in the GitHub
|
||||
# repository or organization.
|
||||
#
|
||||
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
|
||||
# See: https://github.com/ansible/galaxy/issues/46
|
||||
|
||||
name: Release
|
||||
'on':
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: 'geerlingguy.gitlab'
|
||||
|
||||
jobs:
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: 'geerlingguy.gitlab'
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install Ansible.
|
||||
run: pip3 install ansible-base
|
||||
|
||||
- name: Trigger a new import on Galaxy.
|
||||
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
|
3
Archiv/gitlab/geerlingguy.gitlab/.gitignore
vendored
3
Archiv/gitlab/geerlingguy.gitlab/.gitignore
vendored
|
@ -1,3 +0,0 @@
|
|||
*.retry
|
||||
*/__pycache__
|
||||
*.pyc
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
line-length:
|
||||
max: 180
|
||||
level: warning
|
||||
|
||||
ignore: |
|
||||
.github/stale.yml
|
|
@ -1,20 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Jeff Geerling
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,179 +0,0 @@
|
|||
# Ansible Role: GitLab
|
||||
|
||||
[![CI](https://github.com/geerlingguy/ansible-role-gitlab/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-gitlab/actions?query=workflow%3ACI)
|
||||
|
||||
Installs GitLab, a Ruby-based front-end to Git, on any RedHat/CentOS or Debian/Ubuntu linux system.
|
||||
|
||||
GitLab's default administrator account details are below; be sure to login immediately after installation and change these credentials!
|
||||
|
||||
root
|
||||
5iveL!fe
|
||||
|
||||
## Requirements
|
||||
|
||||
None.
|
||||
|
||||
## Role Variables
|
||||
|
||||
Available variables are listed below, along with default values (see `defaults/main.yml`):
|
||||
|
||||
gitlab_domain: gitlab
|
||||
gitlab_external_url: "https://{{ gitlab_domain }}/"
|
||||
|
||||
The domain and URL at which the GitLab instance will be accessible. This is set as the `external_url` configuration setting in `gitlab.rb`, and if you want to run GitLab on a different port (besides 80/443), you can specify the port here (e.g. `https://gitlab:8443/` for port 8443).
|
||||
|
||||
gitlab_git_data_dir: "/var/opt/gitlab/git-data"
|
||||
|
||||
The `gitlab_git_data_dir` is the location where all the Git repositories will be stored. You can use a shared drive or any path on the system.
|
||||
|
||||
gitlab_backup_path: "/var/opt/gitlab/backups"
|
||||
|
||||
The `gitlab_backup_path` is the location where Gitlab backups will be stored.
|
||||
|
||||
gitlab_edition: "gitlab-ce"
|
||||
|
||||
The edition of GitLab to install. Usually either `gitlab-ce` (Community Edition) or `gitlab-ee` (Enterprise Edition).
|
||||
|
||||
gitlab_version: ''
|
||||
|
||||
If you'd like to install a specific version, set the version here (e.g. `11.4.0-ce.0` for Debian/Ubuntu, or `11.4.0-ce.0.el7` for RedHat/CentOS).
|
||||
|
||||
gitlab_config_template: "gitlab.rb.j2"
|
||||
|
||||
The `gitlab.rb.j2` template packaged with this role is meant to be very generic and serve a variety of use cases. However, many people would like to have a much more customized version, and so you can override this role's default template with your own, adding any additional customizations you need. To do this:
|
||||
|
||||
- Create a `templates` directory at the same level as your playbook.
|
||||
- Create a `templates\mygitlab.rb.j2` file (just choose a different name from the default template).
|
||||
- Set the variable like: `gitlab_config_template: mygitlab.rb.j2` (with the name of your custom template).
|
||||
|
||||
### SSL Configuration.
|
||||
|
||||
gitlab_redirect_http_to_https: "true"
|
||||
gitlab_ssl_certificate: "/etc/gitlab/ssl/{{ gitlab_domain }}.crt"
|
||||
gitlab_ssl_certificate_key: "/etc/gitlab/ssl/{{ gitlab_domain }}.key"
|
||||
|
||||
GitLab SSL configuration; tells GitLab to redirect normal http requests to https, and the path to the certificate and key (the default values will work for automatic self-signed certificate creation, if set to `true` in the variable below).
|
||||
|
||||
# SSL Self-signed Certificate Configuration.
|
||||
gitlab_create_self_signed_cert: "true"
|
||||
gitlab_self_signed_cert_subj: "/C=US/ST=Missouri/L=Saint Louis/O=IT/CN={{ gitlab_domain }}"
|
||||
|
||||
Whether to create a self-signed certificate for serving GitLab over a secure connection. Set `gitlab_self_signed_cert_subj` according to your locality and organization.
|
||||
|
||||
# LDAP Configuration.
|
||||
gitlab_ldap_enabled: "false"
|
||||
gitlab_ldap_host: "example.com"
|
||||
gitlab_ldap_port: "389"
|
||||
gitlab_ldap_uid: "sAMAccountName"
|
||||
gitlab_ldap_method: "plain"
|
||||
gitlab_ldap_bind_dn: "CN=Username,CN=Users,DC=example,DC=com"
|
||||
gitlab_ldap_password: "password"
|
||||
gitlab_ldap_base: "DC=example,DC=com"
|
||||
|
||||
GitLab LDAP configuration; if `gitlab_ldap_enabled` is `true`, the rest of the configuration will tell GitLab how to connect to an LDAP server for centralized authentication.
|
||||
|
||||
gitlab_dependencies:
|
||||
- openssh-server
|
||||
- postfix
|
||||
- curl
|
||||
- openssl
|
||||
- tzdata
|
||||
|
||||
Dependencies required by GitLab for certain functionality, like timezone support or email. You may change this list in your own playbook if, for example, you would like to install `exim` instead of `postfix`.
|
||||
|
||||
gitlab_time_zone: "UTC"
|
||||
|
||||
Gitlab timezone.
|
||||
|
||||
gitlab_backup_keep_time: "604800"
|
||||
|
||||
How long to keep local backups (useful if you don't want backups to fill up your drive!).
|
||||
|
||||
gitlab_download_validate_certs: true
|
||||
|
||||
Controls whether to validate certificates when downloading the GitLab installation repository install script.
|
||||
|
||||
# Email configuration.
|
||||
gitlab_email_enabled: "false"
|
||||
gitlab_email_from: "gitlab@example.com"
|
||||
gitlab_email_display_name: "Gitlab"
|
||||
gitlab_email_reply_to: "gitlab@example.com"
|
||||
|
||||
Gitlab system mail configuration. Disabled by default; set `gitlab_email_enabled` to `true` to enable, and make sure you enter valid from/reply-to values.
|
||||
|
||||
# SMTP Configuration
|
||||
gitlab_smtp_enable: "false"
|
||||
gitlab_smtp_address: "smtp.server"
|
||||
gitlab_smtp_port: "465"
|
||||
gitlab_smtp_user_name: "smtp user"
|
||||
gitlab_smtp_password: "smtp password"
|
||||
gitlab_smtp_domain: "example.com"
|
||||
gitlab_smtp_authentication: "login"
|
||||
gitlab_smtp_enable_starttls_auto: "true"
|
||||
gitlab_smtp_tls: "false"
|
||||
gitlab_smtp_openssl_verify_mode: "none"
|
||||
gitlab_smtp_ca_path: "/etc/ssl/certs"
|
||||
gitlab_smtp_ca_file: "/etc/ssl/certs/ca-certificates.crt"
|
||||
|
||||
Gitlab SMTP configuration; of `gitlab_smtp_enable` is `true`, the rest of the configuration will tell GitLab how to send mails using an smtp server.
|
||||
|
||||
gitlab_nginx_listen_port: 8080
|
||||
|
||||
If you are running GitLab behind a reverse proxy, you may want to override the listen port to something else.
|
||||
|
||||
gitlab_nginx_listen_https: "false"
|
||||
|
||||
If you are running GitLab behind a reverse proxy, you may wish to terminate SSL at another proxy server or load balancer
|
||||
|
||||
gitlab_nginx_ssl_verify_client: ""
|
||||
gitlab_nginx_ssl_client_certificate: ""
|
||||
|
||||
If you want to enable [2-way SSL Client Authentication](https://docs.gitlab.com/omnibus/settings/nginx.html#enable-2-way-ssl-client-authentication), set `gitlab_nginx_ssl_verify_client` and add a path to the client certificate in `gitlab_nginx_ssl_client_certificate`.
|
||||
|
||||
gitlab_default_theme: 2
|
||||
|
||||
GitLab includes a number of themes, and you can set the default for all users with this variable. See [the included GitLab themes to choose a default](https://github.com/gitlabhq/gitlabhq/blob/master/config/gitlab.yml.example#L79-L85).
|
||||
|
||||
gitlab_extra_settings:
|
||||
- gitlab_rails:
|
||||
- key: "trusted_proxies"
|
||||
value: "['foo', 'bar']"
|
||||
- key: "env"
|
||||
type: "plain"
|
||||
value: |
|
||||
{
|
||||
"http_proxy" => "https://my_http_proxy.company.com:3128",
|
||||
"https_proxy" => "https://my_http_proxy.company.com:3128",
|
||||
"no_proxy" => "localhost, 127.0.0.1, company.com"
|
||||
}
|
||||
- unicorn:
|
||||
- key: "worker_processes"
|
||||
value: 5
|
||||
- key: "pidfile"
|
||||
value: "/opt/gitlab/var/unicorn/unicorn.pid"
|
||||
|
||||
Gitlab have many other settings ([see official documentation](https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template)), and you can add them with this special variable `gitlab_extra_settings` with the concerned setting and the `key` and `value` keywords.
|
||||
|
||||
## Dependencies
|
||||
|
||||
None.
|
||||
|
||||
## Example Playbook
|
||||
|
||||
- hosts: servers
|
||||
vars_files:
|
||||
- vars/main.yml
|
||||
roles:
|
||||
- { role: geerlingguy.gitlab }
|
||||
|
||||
*Inside `vars/main.yml`*:
|
||||
|
||||
gitlab_external_url: "https://gitlab.example.com/"
|
||||
|
||||
## License
|
||||
|
||||
MIT / BSD
|
||||
|
||||
## Author Information
|
||||
|
||||
This role was created in 2014 by [Jeff Geerling](http://jeffgeerling.com/), author of [Ansible for DevOps](http://ansiblefordevops.com/).
|
|
@ -1,75 +0,0 @@
|
|||
---
|
||||
# General config.
|
||||
gitlab_domain: gitlab
|
||||
gitlab_external_url: "https://{{ gitlab_domain }}/"
|
||||
gitlab_git_data_dir: "/var/opt/gitlab/git-data"
|
||||
gitlab_edition: "gitlab-ce"
|
||||
gitlab_version: ''
|
||||
gitlab_backup_path: "/var/opt/gitlab/backups"
|
||||
gitlab_config_template: "gitlab.rb.j2"
|
||||
|
||||
# SSL Configuration.
|
||||
gitlab_redirect_http_to_https: "true"
|
||||
gitlab_ssl_certificate: "/etc/gitlab/ssl/{{ gitlab_domain }}.crt"
|
||||
gitlab_ssl_certificate_key: "/etc/gitlab/ssl/{{ gitlab_domain }}.key"
|
||||
|
||||
# SSL Self-signed Certificate Configuration.
|
||||
gitlab_create_self_signed_cert: "true"
|
||||
gitlab_self_signed_cert_subj: "/C=US/ST=Missouri/L=Saint Louis/O=IT/CN={{ gitlab_domain }}"
|
||||
|
||||
# LDAP Configuration.
|
||||
gitlab_ldap_enabled: "false"
|
||||
gitlab_ldap_host: "example.com"
|
||||
gitlab_ldap_port: "389"
|
||||
gitlab_ldap_uid: "sAMAccountName"
|
||||
gitlab_ldap_method: "plain"
|
||||
gitlab_ldap_bind_dn: "CN=Username,CN=Users,DC=example,DC=com"
|
||||
gitlab_ldap_password: "password"
|
||||
gitlab_ldap_base: "DC=example,DC=com"
|
||||
|
||||
# SMTP Configuration
|
||||
gitlab_smtp_enable: "false"
|
||||
gitlab_smtp_address: "smtp.server"
|
||||
gitlab_smtp_port: "465"
|
||||
gitlab_smtp_user_name: "smtp user"
|
||||
gitlab_smtp_password: "smtp password"
|
||||
gitlab_smtp_domain: "example.com"
|
||||
gitlab_smtp_authentication: "login"
|
||||
gitlab_smtp_enable_starttls_auto: "true"
|
||||
gitlab_smtp_tls: "false"
|
||||
gitlab_smtp_openssl_verify_mode: "none"
|
||||
gitlab_smtp_ca_path: "/etc/ssl/certs"
|
||||
gitlab_smtp_ca_file: "/etc/ssl/certs/ca-certificates.crt"
|
||||
|
||||
# 2-way SSL Client Authentication support.
|
||||
gitlab_nginx_ssl_verify_client: ""
|
||||
gitlab_nginx_ssl_client_certificate: ""
|
||||
|
||||
# Probably best to leave this as the default, unless doing testing.
|
||||
gitlab_restart_handler_failed_when: 'gitlab_restart.rc != 0'
|
||||
|
||||
# Dependencies.
|
||||
gitlab_dependencies:
|
||||
- openssh-server
|
||||
- postfix
|
||||
- curl
|
||||
- openssl
|
||||
- tzdata
|
||||
|
||||
# Optional settings.
|
||||
gitlab_time_zone: "UTC"
|
||||
gitlab_backup_keep_time: "604800"
|
||||
gitlab_download_validate_certs: true
|
||||
gitlab_default_theme: '2'
|
||||
|
||||
# Email configuration.
|
||||
gitlab_email_enabled: "false"
|
||||
gitlab_email_from: "gitlab@example.com"
|
||||
gitlab_email_display_name: "Gitlab"
|
||||
gitlab_email_reply_to: "gitlab@example.com"
|
||||
|
||||
# Registry configuration.
|
||||
gitlab_registry_enable: "false"
|
||||
gitlab_registry_external_url: "https://gitlab.example.com:4567"
|
||||
gitlab_registry_nginx_ssl_certificate: "/etc/gitlab/ssl/gitlab.crt"
|
||||
gitlab_registry_nginx_ssl_certificate_key: "/etc/gitlab/ssl/gitlab.key"
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
- name: restart gitlab
|
||||
command: gitlab-ctl reconfigure
|
||||
register: gitlab_restart
|
||||
failed_when: gitlab_restart_handler_failed_when | bool
|
|
@ -1,29 +0,0 @@
|
|||
---
|
||||
dependencies: []
|
||||
|
||||
galaxy_info:
|
||||
role_name: gitlab
|
||||
author: geerlingguy
|
||||
description: GitLab Git web interface
|
||||
company: "Midwestern Mac, LLC"
|
||||
license: "license (BSD, MIT)"
|
||||
min_ansible_version: 2.0
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 7
|
||||
- 8
|
||||
- name: Debian
|
||||
versions:
|
||||
- all
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- all
|
||||
galaxy_tags:
|
||||
- development
|
||||
- web
|
||||
- gitlab
|
||||
- git
|
||||
- repository
|
||||
- ci
|
||||
- integration
|
|
@ -1,21 +0,0 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
gitlab_restart_handler_failed_when: false
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=true cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
changed_when: false
|
||||
|
||||
- name: Remove the .dockerenv file so GitLab Omnibus doesn't get confused.
|
||||
file:
|
||||
path: /.dockerenv
|
||||
state: absent
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.gitlab
|
|
@ -1,17 +0,0 @@
|
|||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: instance
|
||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
provisioner:
|
||||
name: ansible
|
||||
playbooks:
|
||||
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
|
@ -1,31 +0,0 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
gitlab_restart_handler_failed_when: false
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=true cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
changed_when: false
|
||||
|
||||
- name: Remove the .dockerenv file so GitLab Omnibus doesn't get confused.
|
||||
file:
|
||||
path: /.dockerenv
|
||||
state: absent
|
||||
|
||||
- name: Set the test GitLab version number for Debian.
|
||||
set_fact:
|
||||
gitlab_version: '11.4.0-ce.0'
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Set the test GitLab version number for RedHat.
|
||||
set_fact:
|
||||
gitlab_version: '11.4.0-ce.0.el7'
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.gitlab
|
|
@ -1,81 +0,0 @@
|
|||
---
|
||||
- name: Include OS-specific variables.
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: Check if GitLab configuration file already exists.
|
||||
stat: path=/etc/gitlab/gitlab.rb
|
||||
register: gitlab_config_file
|
||||
|
||||
- name: Check if GitLab is already installed.
|
||||
stat: path=/usr/bin/gitlab-ctl
|
||||
register: gitlab_file
|
||||
|
||||
# Install GitLab and its dependencies.
|
||||
- name: Install GitLab dependencies.
|
||||
package:
|
||||
name: "{{ gitlab_dependencies }}"
|
||||
state: present
|
||||
|
||||
- name: Install GitLab dependencies (Debian).
|
||||
apt:
|
||||
name: gnupg2
|
||||
state: present
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Download GitLab repository installation script.
|
||||
get_url:
|
||||
url: "{{ gitlab_repository_installation_script_url }}"
|
||||
dest: /tmp/gitlab_install_repository.sh
|
||||
validate_certs: "{{ gitlab_download_validate_certs }}"
|
||||
when: not gitlab_file.stat.exists
|
||||
|
||||
- name: Install GitLab repository.
|
||||
command: bash /tmp/gitlab_install_repository.sh
|
||||
register: output
|
||||
when: not gitlab_file.stat.exists
|
||||
|
||||
- name: Define the Gitlab package name.
|
||||
set_fact:
|
||||
gitlab_package_name: "{{ gitlab_edition }}{{ gitlab_package_version_separator }}{{ gitlab_version }}"
|
||||
when: gitlab_version | default(false)
|
||||
|
||||
- name: Install GitLab
|
||||
package:
|
||||
name: "{{ gitlab_package_name | default(gitlab_edition) }}"
|
||||
state: present
|
||||
async: 300
|
||||
poll: 5
|
||||
when: not gitlab_file.stat.exists
|
||||
|
||||
# Start and configure GitLab. Sometimes the first run fails, but after that,
|
||||
# restarts fix problems, so ignore failures on this run.
|
||||
- name: Reconfigure GitLab (first run).
|
||||
command: >
|
||||
gitlab-ctl reconfigure
|
||||
creates=/var/opt/gitlab/bootstrapped
|
||||
failed_when: false
|
||||
|
||||
- name: Create GitLab SSL configuration folder.
|
||||
file:
|
||||
path: /etc/gitlab/ssl
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0700
|
||||
when: gitlab_create_self_signed_cert
|
||||
|
||||
- name: Create self-signed certificate.
|
||||
command: >
|
||||
openssl req -new -nodes -x509 -subj "{{ gitlab_self_signed_cert_subj }}"
|
||||
-days 3650 -keyout {{ gitlab_ssl_certificate_key }} -out {{ gitlab_ssl_certificate }} -extensions v3_ca
|
||||
creates={{ gitlab_ssl_certificate }}
|
||||
when: gitlab_create_self_signed_cert
|
||||
|
||||
- name: Copy GitLab configuration file.
|
||||
template:
|
||||
src: "{{ gitlab_config_template }}"
|
||||
dest: /etc/gitlab/gitlab.rb
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0600
|
||||
notify: restart gitlab
|
|
@ -1,108 +0,0 @@
|
|||
# The URL through which GitLab will be accessed.
|
||||
external_url "{{ gitlab_external_url }}"
|
||||
|
||||
# gitlab.yml configuration
|
||||
gitlab_rails['time_zone'] = "{{ gitlab_time_zone }}"
|
||||
gitlab_rails['backup_keep_time'] = {{ gitlab_backup_keep_time }}
|
||||
gitlab_rails['gitlab_email_enabled'] = {{ gitlab_email_enabled }}
|
||||
{% if gitlab_email_enabled == "true" %}
|
||||
gitlab_rails['gitlab_email_from'] = "{{ gitlab_email_from }}"
|
||||
gitlab_rails['gitlab_email_display_name'] = "{{ gitlab_email_display_name }}"
|
||||
gitlab_rails['gitlab_email_reply_to'] = "{{ gitlab_email_reply_to }}"
|
||||
{% endif %}
|
||||
|
||||
# Default Theme
|
||||
gitlab_rails['gitlab_default_theme'] = "{{ gitlab_default_theme }}"
|
||||
|
||||
# Whether to redirect http to https.
|
||||
nginx['redirect_http_to_https'] = {{ gitlab_redirect_http_to_https }}
|
||||
nginx['ssl_certificate'] = "{{ gitlab_ssl_certificate }}"
|
||||
nginx['ssl_certificate_key'] = "{{ gitlab_ssl_certificate_key }}"
|
||||
|
||||
# The directory where Git repositories will be stored.
|
||||
git_data_dirs({"default" => {"path" => "{{ gitlab_git_data_dir }}"} })
|
||||
|
||||
# The directory where Gitlab backups will be stored
|
||||
gitlab_rails['backup_path'] = "{{ gitlab_backup_path }}"
|
||||
|
||||
# These settings are documented in more detail at
|
||||
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example#L118
|
||||
gitlab_rails['ldap_enabled'] = {{ gitlab_ldap_enabled }}
|
||||
{% if gitlab_ldap_enabled == "true" %}
|
||||
gitlab_rails['ldap_host'] = '{{ gitlab_ldap_host }}'
|
||||
gitlab_rails['ldap_port'] = {{ gitlab_ldap_port }}
|
||||
gitlab_rails['ldap_uid'] = '{{ gitlab_ldap_uid }}'
|
||||
gitlab_rails['ldap_method'] = '{{ gitlab_ldap_method}}' # 'ssl' or 'plain'
|
||||
gitlab_rails['ldap_bind_dn'] = '{{ gitlab_ldap_bind_dn }}'
|
||||
gitlab_rails['ldap_password'] = '{{ gitlab_ldap_password }}'
|
||||
gitlab_rails['ldap_allow_username_or_email_login'] = true
|
||||
gitlab_rails['ldap_base'] = '{{ gitlab_ldap_base }}'
|
||||
{% endif %}
|
||||
|
||||
# GitLab Nginx
|
||||
## See https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/nginx.md
|
||||
{% if gitlab_nginx_listen_port is defined %}
|
||||
nginx['listen_port'] = "{{ gitlab_nginx_listen_port }}"
|
||||
{% endif %}
|
||||
{% if gitlab_nginx_listen_https is defined %}
|
||||
nginx['listen_https'] = {{ gitlab_nginx_listen_https }}
|
||||
{% endif %}
|
||||
|
||||
# Use smtp instead of sendmail/postfix
|
||||
# More details and example configuration at
|
||||
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/doc/settings/smtp.md
|
||||
gitlab_rails['smtp_enable'] = {{ gitlab_smtp_enable }}
|
||||
{% if gitlab_smtp_enable == "true" %}
|
||||
gitlab_rails['smtp_address'] = '{{ gitlab_smtp_address }}'
|
||||
gitlab_rails['smtp_port'] = {{ gitlab_smtp_port }}
|
||||
{% if gitlab_smtp_user_name %}
|
||||
gitlab_rails['smtp_user_name'] = '{{ gitlab_smtp_user_name }}'
|
||||
{% endif %}
|
||||
{% if gitlab_smtp_password %}
|
||||
gitlab_rails['smtp_password'] = '{{ gitlab_smtp_password }}'
|
||||
{% endif %}
|
||||
gitlab_rails['smtp_domain'] = '{{ gitlab_smtp_domain }}'
|
||||
{% if gitlab_smtp_authentication %}
|
||||
gitlab_rails['smtp_authentication'] = '{{ gitlab_smtp_authentication }}'
|
||||
{% endif %}
|
||||
gitlab_rails['smtp_enable_starttls_auto'] = {{ gitlab_smtp_enable_starttls_auto }}
|
||||
gitlab_rails['smtp_tls'] = {{ gitlab_smtp_tls }}
|
||||
gitlab_rails['smtp_openssl_verify_mode'] = '{{ gitlab_smtp_openssl_verify_mode }}'
|
||||
gitlab_rails['smtp_ca_path'] = '{{ gitlab_smtp_ca_path }}'
|
||||
gitlab_rails['smtp_ca_file'] = '{{ gitlab_smtp_ca_file }}'
|
||||
{% endif %}
|
||||
|
||||
# 2-way SSL Client Authentication.
|
||||
{% if gitlab_nginx_ssl_verify_client %}
|
||||
nginx['ssl_verify_client'] = "{{ gitlab_nginx_ssl_verify_client }}"
|
||||
{% endif %}
|
||||
{% if gitlab_nginx_ssl_client_certificate %}
|
||||
nginx['ssl_client_certificate'] = "{{ gitlab_nginx_ssl_client_certificate }}"
|
||||
{% endif %}
|
||||
|
||||
# GitLab registry.
|
||||
registry['enable'] = {{ gitlab_registry_enable }}
|
||||
{% if gitlab_registry_enable == "true" %}
|
||||
registry_external_url "{{ gitlab_registry_external_url }}"
|
||||
registry_nginx['ssl_certificate'] = "{{ gitlab_registry_nginx_ssl_certificate }}"
|
||||
registry_nginx['ssl_certificate_key'] = "{{ gitlab_registry_nginx_ssl_certificate_key }}"
|
||||
{% endif %}
|
||||
|
||||
{% if gitlab_extra_settings is defined %}
|
||||
# Extra configuration
|
||||
{% for extra in gitlab_extra_settings %}
|
||||
{% for setting in extra %}
|
||||
{% for kv in extra[setting] %}
|
||||
{% if (kv.type is defined and kv.type == 'plain') or (kv.value is not string) %}
|
||||
{{ setting }}['{{ kv.key }}'] = {{ kv.value }}
|
||||
{% else %}
|
||||
{{ setting }}['{{ kv.key }}'] = '{{ kv.value }}'
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
# To change other settings, see:
|
||||
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#changing-gitlab-yml-settings
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
gitlab_package_version_separator: '='
|
||||
gitlab_repository_installation_script_url: "https://packages.gitlab.com/install/repositories/gitlab/{{ gitlab_edition }}/script.deb.sh"
|
|
@ -1,3 +0,0 @@
|
|||
---
|
||||
gitlab_package_version_separator: '-'
|
||||
gitlab_repository_installation_script_url: "https://packages.gitlab.com/install/repositories/gitlab/{{ gitlab_edition }}/script.rpm.sh"
|
|
@ -1,51 +0,0 @@
|
|||
---
|
||||
### geerlingguy.gitlab
|
||||
# nicht alle gitlab Einstellungen lassen sich als Variable festlegen! siehe unten:
|
||||
# Einstellungen
|
||||
### General
|
||||
# * sign up disabled
|
||||
# * Require all users to set up Two-factor authentication
|
||||
# * Gravatar enabled --> off
|
||||
### Network
|
||||
# * Enable unauthenticated request rate limit
|
||||
|
||||
gitlab_domain: gitlab.grote.lan
|
||||
gitlab_external_url: "http://git.mgrote.net"
|
||||
gitlab_edition: "gitlab-ce"
|
||||
gitlab_nginx_listen_https: "false"
|
||||
gitlab_redirect_http_to_https: "false"
|
||||
gitlab_create_self_signed_cert: "false"
|
||||
gitlab_smtp_enable: "true"
|
||||
gitlab_smtp_address: "smtp.strato.de"
|
||||
gitlab_smtp_port: "465"
|
||||
gitlab_smtp_user_name: "info@mgrote.net"
|
||||
gitlab_smtp_password: "{{ lookup('keepass', 'postfix_absender_passwort', 'password') }}"
|
||||
gitlab_smtp_domain: "mgrote.net"
|
||||
gitlab_smtp_authentication: "login"
|
||||
gitlab_smtp_enable_starttls_auto: "false"
|
||||
gitlab_smtp_tls: "true"
|
||||
gitlab_email_enabled: "true"
|
||||
gitlab_email_from: "noreply@mgrote.net"
|
||||
gitlab_email_display_name: "Gitlab"
|
||||
gitlab_email_reply_to: "noreply@mgrote.net"
|
||||
# gitlab_extra_settings:
|
||||
# - gitlab_rails:
|
||||
# - key: "trusted_proxies"
|
||||
# value: "['foo']"
|
||||
|
||||
### oefenweb.ufw
|
||||
ufw_rules:
|
||||
- rule: allow
|
||||
to_port: 22
|
||||
protocol: tcp
|
||||
comment: 'ssh'
|
||||
from_ip: 192.168.2.0/24
|
||||
- rule: allow
|
||||
to_port: 80
|
||||
protocol: tcp
|
||||
comment: 'gitlab'
|
||||
from_ip: 192.168.2.0/24
|
||||
|
||||
### mgrote.restic
|
||||
restic_folders_to_backup: "/usr/local /etc /root /var/lib /home /var/opt/gitlab"
|
||||
restic_cron_hours: "*/2"
|
|
@ -1,33 +0,0 @@
|
|||
---
|
||||
### geerlingguy.docker
|
||||
docker_users:
|
||||
- mg
|
||||
- root
|
||||
- ansible-user
|
||||
- git
|
||||
- gitlab-runner
|
||||
### geerlingguy.pip
|
||||
pip_package: python3-pip
|
||||
pip_install_packages:
|
||||
- name: python-gitlab
|
||||
### riemers.gitlab-runner
|
||||
gitlab_runner_coordinator_url: https://git.mgrote.net
|
||||
gitlab_runner_registration_token: "{{ lookup('keepass', 'gitlab_runner_production_registration_token', 'password') }}"
|
||||
gitlab_runner_runners:
|
||||
- name: "{{ ansible_hostname }}-docker"
|
||||
executor: docker
|
||||
tags:
|
||||
- ansible
|
||||
- hadolint
|
||||
- name: "{{ ansible_hostname }}-shell"
|
||||
executor: shell
|
||||
tags:
|
||||
- docker-build
|
||||
# Wenn Änderungen nicht übernommen werden, Runner löschen und neu anlegen.
|
||||
|
||||
### oefenweb.ufw
|
||||
ufw_rules: #from: ... ist nicht vorhanden da aus dem Docker-Netzwerk darauf zugegriffen werden soll
|
||||
- rule: allow
|
||||
to_port: 22
|
||||
protocol: tcp
|
||||
comment: 'ssh'
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
- hosts: gitlabrunner
|
||||
roles:
|
||||
- { role: geerlingguy.pip, tags: "pip", become: true }
|
||||
- { role: geerlingguy.docker, tags: "docker", become: true }
|
||||
- { role: gantsign.ctop, tags: "ctop", become: true }
|
||||
- { role: riemers.gitlab-runner, tags: "gitlab-runner", become: true }
|
|
@ -1,4 +0,0 @@
|
|||
---
|
||||
- hosts: gitlab
|
||||
roles:
|
||||
- { role: geerlingguy.gitlab, tags: "gitlab", become: true }
|
|
@ -1,2 +0,0 @@
|
|||
skip_list:
|
||||
- '106'
|
|
@ -1,4 +0,0 @@
|
|||
# These are supported funding model platforms
|
||||
---
|
||||
github: geerlingguy
|
||||
patreon: geerlingguy
|
|
@ -1,56 +0,0 @@
|
|||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
daysUntilStale: 90
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
|
||||
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
|
||||
daysUntilClose: 30
|
||||
|
||||
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
|
||||
onlyLabels: []
|
||||
|
||||
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
|
||||
exemptLabels:
|
||||
- pinned
|
||||
- security
|
||||
- planned
|
||||
|
||||
# Set to true to ignore issues in a project (defaults to false)
|
||||
exemptProjects: false
|
||||
|
||||
# Set to true to ignore issues in a milestone (defaults to false)
|
||||
exemptMilestones: false
|
||||
|
||||
# Set to true to ignore issues with an assignee (defaults to false)
|
||||
exemptAssignees: false
|
||||
|
||||
# Label to use when marking as stale
|
||||
staleLabel: stale
|
||||
|
||||
# Limit the number of actions per hour, from 1-30. Default is 30
|
||||
limitPerRun: 30
|
||||
|
||||
pulls:
|
||||
markComment: |-
|
||||
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution!
|
||||
|
||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark pull requests as stale.
|
||||
|
||||
unmarkComment: >-
|
||||
This pull request is no longer marked for closure.
|
||||
|
||||
closeComment: >-
|
||||
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details.
|
||||
|
||||
issues:
|
||||
markComment: |-
|
||||
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!
|
||||
|
||||
Please read [this blog post](https://www.jeffgeerling.com/blog/2020/enabling-stale-issue-bot-on-my-github-repositories) to see the reasons why I mark issues as stale.
|
||||
|
||||
unmarkComment: >-
|
||||
This issue is no longer marked for closure.
|
||||
|
||||
closeComment: >-
|
||||
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.
|
|
@ -1,82 +0,0 @@
|
|||
---
|
||||
name: CI
|
||||
'on':
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: "30 7 * * 2"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: 'geerlingguy.jenkins'
|
||||
|
||||
jobs:
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: 'geerlingguy.jenkins'
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install yamllint ansible-lint
|
||||
|
||||
- name: Lint code.
|
||||
run: |
|
||||
yamllint .
|
||||
ansible-lint
|
||||
|
||||
molecule:
|
||||
name: Molecule
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distro: centos8
|
||||
playbook: converge.yml
|
||||
- distro: ubuntu1804
|
||||
playbook: converge.yml
|
||||
- distro: debian10
|
||||
playbook: converge.yml
|
||||
|
||||
# Test other role features.
|
||||
- distro: ubuntu1804
|
||||
playbook: http-port.yml
|
||||
- distro: ubuntu1804
|
||||
playbook: prefix.yml
|
||||
- distro: ubuntu1804
|
||||
playbook: plugins-with-home.yml
|
||||
- distro: centos7
|
||||
playbook: jenkins-version.yml
|
||||
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: 'geerlingguy.jenkins'
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install test dependencies.
|
||||
run: pip3 install ansible molecule[docker] docker
|
||||
|
||||
- name: Run Molecule tests.
|
||||
run: molecule test
|
||||
env:
|
||||
PY_COLORS: '1'
|
||||
ANSIBLE_FORCE_COLOR: '1'
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
|
|
@ -1,38 +0,0 @@
|
|||
---
|
||||
# This workflow requires a GALAXY_API_KEY secret present in the GitHub
|
||||
# repository or organization.
|
||||
#
|
||||
# See: https://github.com/marketplace/actions/publish-ansible-role-to-galaxy
|
||||
# See: https://github.com/ansible/galaxy/issues/46
|
||||
|
||||
name: Release
|
||||
'on':
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: 'geerlingguy.jenkins'
|
||||
|
||||
jobs:
|
||||
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the codebase.
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: 'geerlingguy.jenkins'
|
||||
|
||||
- name: Set up Python 3.
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install Ansible.
|
||||
run: pip3 install ansible-base
|
||||
|
||||
- name: Trigger a new import on Galaxy.
|
||||
run: ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }} $(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
|
|
@ -1,3 +0,0 @@
|
|||
*.retry
|
||||
*/__pycache__
|
||||
*.pyc
|
|
@ -1,11 +0,0 @@
|
|||
---
|
||||
extends: default
|
||||
|
||||
rules:
|
||||
line-length:
|
||||
max: 150
|
||||
level: warning
|
||||
|
||||
ignore: |
|
||||
.github/stale.yml
|
||||
.travis.yml
|
|
@ -1,20 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Jeff Geerling
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1,149 +0,0 @@
|
|||
# Ansible Role: Jenkins CI
|
||||
|
||||
[![CI](https://github.com/geerlingguy/ansible-role-jenkins/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-jenkins/actions?query=workflow%3ACI)
|
||||
|
||||
Installs Jenkins CI on RHEL/CentOS and Debian/Ubuntu servers.
|
||||
|
||||
## Requirements
|
||||
|
||||
Requires `curl` to be installed on the server. Also, newer versions of Jenkins require Java 8+ (see the test playbooks inside the `molecule/default` directory for an example of how to use newer versions of Java for your OS).
|
||||
|
||||
## Role Variables
|
||||
|
||||
Available variables are listed below, along with default values (see `defaults/main.yml`):
|
||||
|
||||
jenkins_package_state: present
|
||||
|
||||
The state of the `jenkins` package install. By default this role installs Jenkins but will not upgrade Jenkins (when using package-based installs). If you want to always update to the latest version, change this to `latest`.
|
||||
|
||||
jenkins_hostname: localhost
|
||||
|
||||
The system hostname; usually `localhost` works fine. This will be used during setup to communicate with the running Jenkins instance via HTTP requests.
|
||||
|
||||
jenkins_home: /var/lib/jenkins
|
||||
|
||||
The Jenkins home directory which, amongst others, is being used for storing artifacts, workspaces and plugins. This variable allows you to override the default `/var/lib/jenkins` location.
|
||||
|
||||
jenkins_http_port: 8080
|
||||
|
||||
The HTTP port for Jenkins' web interface.
|
||||
|
||||
jenkins_admin_username: admin
|
||||
jenkins_admin_password: admin
|
||||
|
||||
Default admin account credentials which will be created the first time Jenkins is installed.
|
||||
|
||||
jenkins_admin_password_file: ""
|
||||
|
||||
Default admin password file which will be created the first time Jenkins is installed as /var/lib/jenkins/secrets/initialAdminPassword
|
||||
|
||||
jenkins_jar_location: /opt/jenkins-cli.jar
|
||||
|
||||
The location at which the `jenkins-cli.jar` jarfile will be kept. This is used for communicating with Jenkins via the CLI.
|
||||
|
||||
jenkins_plugins:
|
||||
- blueocean
|
||||
- name: influxdb
|
||||
version: "1.12.1"
|
||||
|
||||
Jenkins plugins to be installed automatically during provisioning. Defaults to empty list (`[]`). Items can use name or dictionary with `name` and `version` keys to pin specific version of a plugin.
|
||||
|
||||
jenkins_plugins_install_dependencies: true
|
||||
|
||||
Whether Jenkins plugins to be installed should also install any plugin dependencies.
|
||||
|
||||
jenkins_plugins_state: present
|
||||
|
||||
Use `latest` to ensure all plugins are running the most up-to-date version. For any plugin that has a specific version set in `jenkins_plugins` list, state `present` will be used instead of `jenkins_plugins_state` value.
|
||||
|
||||
jenkins_plugin_updates_expiration: 86400
|
||||
|
||||
Number of seconds after which a new copy of the update-center.json file is downloaded. Set it to 0 if no cache file should be used.
|
||||
|
||||
jenkins_updates_url: "https://updates.jenkins.io"
|
||||
|
||||
The URL to use for Jenkins plugin updates and update-center information.
|
||||
|
||||
jenkins_plugin_timeout: 30
|
||||
|
||||
The server connection timeout, in seconds, when installing Jenkins plugins.
|
||||
|
||||
jenkins_version: "2.220"
|
||||
jenkins_pkg_url: "http://www.example.com"
|
||||
|
||||
(Optional) Then Jenkins version can be pinned to any version available on `http://pkg.jenkins-ci.org/debian/` (Debian/Ubuntu) or `http://pkg.jenkins-ci.org/redhat/` (RHEL/CentOS). If the Jenkins version you need is not available in the default package URLs, you can override the URL with your own; set `jenkins_pkg_url` (_Note_: the role depends on the same naming convention that `http://pkg.jenkins-ci.org/` uses).
|
||||
|
||||
jenkins_url_prefix: ""
|
||||
|
||||
Used for setting a URL prefix for your Jenkins installation. The option is added as `--prefix={{ jenkins_url_prefix }}` to the Jenkins initialization `java` invocation, so you can access the installation at a path like `http://www.example.com{{ jenkins_url_prefix }}`. Make sure you start the prefix with a `/` (e.g. `/jenkins`).
|
||||
|
||||
jenkins_connection_delay: 5
|
||||
jenkins_connection_retries: 60
|
||||
|
||||
Amount of time and number of times to wait when connecting to Jenkins after initial startup, to verify that Jenkins is running. Total time to wait = `delay` * `retries`, so by default this role will wait up to 300 seconds before timing out.
|
||||
|
||||
jenkins_prefer_lts: false
|
||||
|
||||
By default, this role will install the latest version of Jenkins using the official repositories according to the platform. You can install the current LTS version instead by setting this to `false`.
|
||||
|
||||
The default repositories (listed below) can be overridden as well.
|
||||
|
||||
# For RedHat/CentOS:
|
||||
jenkins_repo_url: https://pkg.jenkins.io/redhat{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.repo
|
||||
jenkins_repo_key_url: https://pkg.jenkins.io/redhat{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.io.key
|
||||
|
||||
# For Debian/Ubuntu:
|
||||
jenkins_repo_url: deb https://pkg.jenkins.io/debian{{ '-stable' if (jenkins_prefer_lts | bool) else '' }} binary/
|
||||
jenkins_repo_key_url: https://pkg.jenkins.io/debian{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.io.key
|
||||
|
||||
It is also possible to prevent the repo file from being added by setting `jenkins_repo_url: ''`. This is useful if, for example, you sign your own packages or run internal package management (e.g. Spacewalk).
|
||||
|
||||
jenkins_java_options: "-Djenkins.install.runSetupWizard=false"
|
||||
|
||||
Extra Java options for the Jenkins launch command configured in the init file can be set with the var `jenkins_java_options`. For example, if you want to configure the timezone Jenkins uses, add `-Dorg.apache.commons.jelly.tags.fmt.timeZone=America/New_York`. By default, the option to disable the Jenkins 2.0 setup wizard is added.
|
||||
|
||||
jenkins_init_changes:
|
||||
- option: "JENKINS_ARGS"
|
||||
value: "--prefix={{ jenkins_url_prefix }}"
|
||||
- option: "JENKINS_JAVA_OPTIONS"
|
||||
value: "{{ jenkins_java_options }}"
|
||||
|
||||
Changes made to the Jenkins init script; the default set of changes set the configured URL prefix and add in configured Java options for Jenkins' startup. You can add other option/value pairs if you need to set other options for the Jenkins init file.
|
||||
|
||||
jenkins_proxy_host: ""
|
||||
jenkins_proxy_port: ""
|
||||
jenkins_proxy_noproxy:
|
||||
- "127.0.0.1"
|
||||
- "localhost"
|
||||
|
||||
If you are running Jenkins behind a proxy server, configure these options appropriately. Otherwise Jenkins will be configured with a direct Internet connection.
|
||||
|
||||
## Dependencies
|
||||
|
||||
None.
|
||||
|
||||
## Example Playbook
|
||||
|
||||
```yaml
|
||||
- hosts: jenkins
|
||||
become: true
|
||||
|
||||
vars:
|
||||
jenkins_hostname: jenkins.example.com
|
||||
java_packages:
|
||||
- openjdk-8-jdk
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.java
|
||||
- role: geerlingguy.jenkins
|
||||
```
|
||||
|
||||
Note that `java_packages` may need different versions depending on your distro (e.g. `openjdk-11-jdk` for Debian 10, or `java-1.8.0-openjdk` for RHEL 7 or 8).
|
||||
|
||||
## License
|
||||
|
||||
MIT (Expat) / BSD
|
||||
|
||||
## Author Information
|
||||
|
||||
This role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).
|
|
@ -1,51 +0,0 @@
|
|||
---
|
||||
# Optional method of pinning a specific version of Jenkins and/or overriding the
|
||||
# default Jenkins packaging URL.
|
||||
# jenkins_version: "1.644"
|
||||
# jenkins_pkg_url: "https://www.example.com"
|
||||
|
||||
# Change this to `latest` to update Jenkins if a newer version is available.
|
||||
jenkins_package_state: present
|
||||
|
||||
jenkins_prefer_lts: false
|
||||
|
||||
jenkins_connection_delay: 5
|
||||
jenkins_connection_retries: 60
|
||||
jenkins_home: /var/lib/jenkins
|
||||
jenkins_hostname: localhost
|
||||
jenkins_http_port: 8080
|
||||
jenkins_jar_location: /opt/jenkins-cli.jar
|
||||
jenkins_url_prefix: ""
|
||||
jenkins_java_options: "-Djenkins.install.runSetupWizard=false"
|
||||
|
||||
# Plugin list can use the plugin name, or a name/version dict.
|
||||
jenkins_plugins: []
|
||||
# - blueocean
|
||||
# - name: influxdb
|
||||
# version: "1.12.1"
|
||||
|
||||
jenkins_plugins_state: present
|
||||
jenkins_plugin_updates_expiration: 86400
|
||||
jenkins_plugin_timeout: 30
|
||||
jenkins_plugins_install_dependencies: true
|
||||
jenkins_updates_url: "https://updates.jenkins.io"
|
||||
|
||||
jenkins_admin_username: admin
|
||||
jenkins_admin_password: admin
|
||||
jenkins_admin_password_file: ""
|
||||
|
||||
jenkins_process_user: jenkins
|
||||
jenkins_process_group: "{{ jenkins_process_user }}"
|
||||
|
||||
jenkins_init_changes:
|
||||
- option: "JENKINS_ARGS"
|
||||
value: "--prefix={{ jenkins_url_prefix }}"
|
||||
- option: "{{ jenkins_java_options_env_var }}"
|
||||
value: "{{ jenkins_java_options }}"
|
||||
|
||||
# If Jenkins is behind a proxy, configure this.
|
||||
jenkins_proxy_host: ""
|
||||
jenkins_proxy_port: ""
|
||||
jenkins_proxy_noproxy:
|
||||
- "127.0.0.1"
|
||||
- "localhost"
|
|
@ -1,12 +0,0 @@
|
|||
---
|
||||
- name: restart jenkins
|
||||
service: name=jenkins state=restarted
|
||||
|
||||
- name: configure default users
|
||||
template:
|
||||
src: basic-security.groovy.j2
|
||||
dest: "{{ jenkins_home }}/init.groovy.d/basic-security.groovy"
|
||||
owner: "{{ jenkins_process_user }}"
|
||||
group: "{{ jenkins_process_group }}"
|
||||
mode: 0775
|
||||
register: jenkins_users_config
|
|
@ -1,30 +0,0 @@
|
|||
---
|
||||
dependencies: []
|
||||
|
||||
galaxy_info:
|
||||
role_name: jenkins
|
||||
author: geerlingguy
|
||||
description: Jenkins CI
|
||||
company: "Midwestern Mac, LLC"
|
||||
license: "license (BSD, MIT)"
|
||||
min_ansible_version: 2.4
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 6
|
||||
- 7
|
||||
- 8
|
||||
- name: Fedora
|
||||
versions:
|
||||
- all
|
||||
- name: Debian
|
||||
versions:
|
||||
- all
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- all
|
||||
galaxy_tags:
|
||||
- development
|
||||
- packaging
|
||||
- jenkins
|
||||
- ci
|
|
@ -1,21 +0,0 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
pre_tasks:
|
||||
- include_tasks: java-8.yml
|
||||
|
||||
- include_tasks: java-11.yml
|
||||
when:
|
||||
- ansible_distribution == 'Debian'
|
||||
- ansible_distribution_major_version == '10'
|
||||
|
||||
roles:
|
||||
- role: geerlingguy.java
|
||||
- role: geerlingguy.jenkins
|
||||
|
||||
post_tasks:
|
||||
- name: Check if Jenkins is running.
|
||||
uri:
|
||||
url: "http://127.0.0.1:8080/"
|
|
@ -1,24 +0,0 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
jenkins_http_port: 8081
|
||||
|
||||
pre_tasks:
|
||||
- include_tasks: java-8.yml
|
||||
|
||||
roles:
|
||||
- geerlingguy.java
|
||||
- geerlingguy.jenkins
|
||||
|
||||
post_tasks:
|
||||
- name: Ensure Jenkins is running on the specified port.
|
||||
uri:
|
||||
url: "http://127.0.0.1:{{ jenkins_http_port }}"
|
||||
status_code: 200
|
||||
register: result
|
||||
until: result.status == 200
|
||||
retries: 60
|
||||
delay: 1
|
|
@ -1,6 +0,0 @@
|
|||
---
|
||||
- name: Set the java_packages variable (Debian).
|
||||
set_fact:
|
||||
java_packages:
|
||||
- openjdk-11-jdk
|
||||
when: ansible_os_family == 'Debian'
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
# Debian.
|
||||
- name: Update apt cache.
|
||||
apt: update_cache=true cache_valid_time=600
|
||||
when: ansible_os_family == 'Debian'
|
||||
changed_when: false
|
||||
|
||||
- name: Set the java_packages variable (Debian).
|
||||
set_fact:
|
||||
java_packages:
|
||||
- openjdk-8-jdk
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
# Red Hat.
|
||||
- name: Set the java_packages variable (RedHat).
|
||||
set_fact:
|
||||
java_packages:
|
||||
- java-1.8.0-openjdk
|
||||
when: ansible_os_family == 'RedHat'
|
|
@ -1,27 +0,0 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
jenkins_version: "2.220"
|
||||
|
||||
roles:
|
||||
- geerlingguy.java
|
||||
- geerlingguy.jenkins
|
||||
|
||||
post_tasks:
|
||||
- name: Check installed version of Jenkins.
|
||||
command: rpm -q jenkins
|
||||
args:
|
||||
warn: false
|
||||
changed_when: false
|
||||
register: jenkins_rpm_version
|
||||
tags: ['skip_ansible_lint']
|
||||
|
||||
- name: Print installed Jenkins package information.
|
||||
debug: var=jenkins_rpm_version
|
||||
|
||||
- name: Fail if version doesn't match what we wanted.
|
||||
fail:
|
||||
when: "jenkins_version not in jenkins_rpm_version.stdout"
|
|
@ -1,17 +0,0 @@
|
|||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: instance
|
||||
image: "geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest"
|
||||
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
provisioner:
|
||||
name: ansible
|
||||
playbooks:
|
||||
converge: ${MOLECULE_PLAYBOOK:-converge.yml}
|
|
@ -1,62 +0,0 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
jenkins_plugins:
|
||||
- ghprb
|
||||
- greenballs
|
||||
- {name: cloudbees-folder, version: 6.11}
|
||||
jenkins_home: /tmp/jenkins
|
||||
jenkins_plugin_timeout: 120
|
||||
|
||||
pre_tasks:
|
||||
- include_tasks: java-8.yml
|
||||
|
||||
roles:
|
||||
- geerlingguy.java
|
||||
- geerlingguy.jenkins
|
||||
|
||||
post_tasks:
|
||||
- name: Verify JENKINS_HOME is correct.
|
||||
stat:
|
||||
path: "{{ jenkins_home }}/config.xml"
|
||||
register: jenkins_home_config
|
||||
|
||||
- name: Fail if Jenkins config file doesn't exist.
|
||||
fail:
|
||||
when: not jenkins_home_config.stat.exists
|
||||
|
||||
- name: List plugins directory contents.
|
||||
command: "ls {{ jenkins_home }}/plugins"
|
||||
register: plugins_contents
|
||||
changed_when: false
|
||||
tags: ['skip_ansible_lint']
|
||||
|
||||
- name: Verify greenballs plugin exists.
|
||||
stat:
|
||||
path: "{{ jenkins_home }}/plugins/greenballs.jpi"
|
||||
register: greenballs_plugin
|
||||
|
||||
- name: Fail if greenballs plugin file doesn't exist.
|
||||
fail:
|
||||
when: not greenballs_plugin.stat.exists
|
||||
|
||||
- name: Verify cloudbees-folder plugin exists.
|
||||
stat:
|
||||
path: "{{ jenkins_home }}/plugins/cloudbees-folder.jpi"
|
||||
register: folder_plugin
|
||||
|
||||
- name: Fail if cloudbees-folder plugin file doesn't exist.
|
||||
fail:
|
||||
when: not folder_plugin.stat.exists
|
||||
|
||||
- name: Ensure Jenkins is running.
|
||||
uri:
|
||||
url: "http://127.0.0.1:8080/"
|
||||
status_code: 200
|
||||
register: result
|
||||
until: result.status == 200
|
||||
retries: 60
|
||||
delay: 1
|
|
@ -1,24 +0,0 @@
|
|||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: true
|
||||
|
||||
vars:
|
||||
jenkins_url_prefix: /jenkins
|
||||
|
||||
pre_tasks:
|
||||
- include_tasks: java-8.yml
|
||||
|
||||
roles:
|
||||
- geerlingguy.java
|
||||
- geerlingguy.jenkins
|
||||
|
||||
post_tasks:
|
||||
- name: Ensure Jenkins is running with the specified prefix.
|
||||
uri:
|
||||
url: "http://127.0.0.1:8080{{ jenkins_url_prefix }}"
|
||||
status_code: 200
|
||||
register: result
|
||||
until: result.status == 200
|
||||
retries: 60
|
||||
delay: 1
|
|
@ -1,2 +0,0 @@
|
|||
---
|
||||
- src: geerlingguy.java
|
|
@ -1,67 +0,0 @@
|
|||
---
|
||||
# Variable setup.
|
||||
- name: Include OS-Specific variables
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: Define jenkins_repo_url
|
||||
set_fact:
|
||||
jenkins_repo_url: "{{ __jenkins_repo_url }}"
|
||||
when: jenkins_repo_url is not defined
|
||||
|
||||
- name: Define jenkins_repo_key_url
|
||||
set_fact:
|
||||
jenkins_repo_key_url: "{{ __jenkins_repo_key_url }}"
|
||||
when: jenkins_repo_key_url is not defined
|
||||
|
||||
- name: Define jenkins_pkg_url
|
||||
set_fact:
|
||||
jenkins_pkg_url: "{{ __jenkins_pkg_url }}"
|
||||
when: jenkins_pkg_url is not defined
|
||||
|
||||
# Setup/install tasks.
|
||||
- include_tasks: setup-RedHat.yml
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- include_tasks: setup-Debian.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
# Configure Jenkins init settings.
|
||||
- include_tasks: settings.yml
|
||||
|
||||
# Make sure Jenkins starts, then configure Jenkins.
|
||||
- name: Ensure Jenkins is started and runs on startup.
|
||||
service: name=jenkins state=started enabled=yes
|
||||
|
||||
- name: Wait for Jenkins to start up before proceeding.
|
||||
uri:
|
||||
url: "http://{{ jenkins_hostname }}:{{ jenkins_http_port }}{{ jenkins_url_prefix }}/cli/"
|
||||
method: GET
|
||||
return_content: "yes"
|
||||
timeout: 5
|
||||
body_format: raw
|
||||
follow_redirects: "no"
|
||||
status_code: 200,403
|
||||
register: result
|
||||
until: (result.status == 403 or result.status == 200) and (result.content.find("Please wait while") == -1)
|
||||
retries: "{{ jenkins_connection_retries }}"
|
||||
delay: "{{ jenkins_connection_delay }}"
|
||||
changed_when: false
|
||||
check_mode: false
|
||||
|
||||
- name: Get the jenkins-cli jarfile from the Jenkins server.
|
||||
get_url:
|
||||
url: "http://{{ jenkins_hostname }}:{{ jenkins_http_port }}{{ jenkins_url_prefix }}/jnlpJars/jenkins-cli.jar"
|
||||
dest: "{{ jenkins_jar_location }}"
|
||||
register: jarfile_get
|
||||
until: "'OK' in jarfile_get.msg or '304' in jarfile_get.msg or 'file already exists' in jarfile_get.msg"
|
||||
retries: 5
|
||||
delay: 10
|
||||
check_mode: false
|
||||
|
||||
- name: Remove Jenkins security init scripts after first startup.
|
||||
file:
|
||||
path: "{{ jenkins_home }}/init.groovy.d/basic-security.groovy"
|
||||
state: absent
|
||||
|
||||
# Update Jenkins and install configured plugins.
|
||||
- include_tasks: plugins.yml
|
|
@ -1,63 +0,0 @@
|
|||
---
|
||||
# jenkins_plugin module doesn't support password files.
|
||||
- name: Get Jenkins admin password from file.
|
||||
slurp:
|
||||
src: "{{ jenkins_admin_password_file }}"
|
||||
register: adminpasswordfile
|
||||
no_log: true
|
||||
when: jenkins_admin_password_file | default(false)
|
||||
tags: ['skip_ansible_lint']
|
||||
|
||||
- name: Set Jenkins admin password fact.
|
||||
set_fact:
|
||||
jenkins_admin_password: "{{ adminpasswordfile['stdout'] | default(jenkins_admin_password) }}"
|
||||
no_log: true
|
||||
|
||||
# Update Jenkins so that plugin updates don't fail.
|
||||
- name: Create Jenkins updates directory.
|
||||
file:
|
||||
path: "{{ jenkins_home }}/updates"
|
||||
state: directory
|
||||
owner: jenkins
|
||||
group: jenkins
|
||||
mode: 0755
|
||||
|
||||
- name: Download current plugin updates from Jenkins update site.
|
||||
get_url:
|
||||
url: "{{ jenkins_updates_url }}/update-center.json"
|
||||
dest: "{{ jenkins_home }}/updates/default.json"
|
||||
owner: jenkins
|
||||
group: jenkins
|
||||
mode: 0440
|
||||
changed_when: false
|
||||
register: get_result
|
||||
until: get_result is success
|
||||
retries: 3
|
||||
delay: 2
|
||||
|
||||
- name: Remove first and last line from json file.
|
||||
replace: # noqa 208
|
||||
path: "{{ jenkins_home }}/updates/default.json"
|
||||
regexp: "1d;$d"
|
||||
|
||||
- name: Install Jenkins plugins using password.
|
||||
jenkins_plugin:
|
||||
name: "{{ item.name | default(item) }}"
|
||||
version: "{{ item.version | default(omit) }}"
|
||||
jenkins_home: "{{ jenkins_home }}"
|
||||
url_username: "{{ jenkins_admin_username }}"
|
||||
url_password: "{{ jenkins_admin_password }}"
|
||||
state: "{{ 'present' if item.version is defined else jenkins_plugins_state }}"
|
||||
timeout: "{{ jenkins_plugin_timeout }}"
|
||||
updates_expiration: "{{ jenkins_plugin_updates_expiration }}"
|
||||
updates_url: "{{ jenkins_updates_url }}"
|
||||
url: "http://{{ jenkins_hostname }}:{{ jenkins_http_port }}{{ jenkins_url_prefix }}"
|
||||
with_dependencies: "{{ jenkins_plugins_install_dependencies }}"
|
||||
with_items: "{{ jenkins_plugins }}"
|
||||
when: jenkins_admin_password | default(false)
|
||||
notify: restart jenkins
|
||||
tags: ['skip_ansible_lint']
|
||||
register: plugin_result
|
||||
until: plugin_result is success
|
||||
retries: 3
|
||||
delay: 2
|
|
@ -1,86 +0,0 @@
|
|||
---
|
||||
- name: Check if jenkins_init_file exists.
|
||||
stat:
|
||||
path: "{{ jenkins_init_file }}"
|
||||
register: jenkins_init_file_stat
|
||||
|
||||
- name: Ensure jenkins_init_file exists.
|
||||
file:
|
||||
path: "{{ jenkins_init_file }}"
|
||||
state: touch
|
||||
mode: 0644
|
||||
when: not jenkins_init_file_stat.stat.exists
|
||||
|
||||
- name: Modify variables in init file.
|
||||
lineinfile:
|
||||
dest: "{{ jenkins_init_file }}"
|
||||
insertafter: '^{{ item.option }}='
|
||||
regexp: '^{{ item.option }}=\"\${{ item.option }} '
|
||||
line: '{{ item.option }}="${{ item.option }} {{ item.value }}"'
|
||||
state: present
|
||||
mode: 0644
|
||||
with_items: "{{ jenkins_init_changes }}"
|
||||
register: jenkins_init_prefix
|
||||
|
||||
- name: Ensure jenkins_home {{ jenkins_home }} exists.
|
||||
file:
|
||||
path: "{{ jenkins_home }}"
|
||||
state: directory
|
||||
owner: jenkins
|
||||
group: jenkins
|
||||
mode: u+rwx
|
||||
follow: true
|
||||
|
||||
- name: Set the Jenkins home directory.
|
||||
lineinfile:
|
||||
dest: "{{ jenkins_init_file }}"
|
||||
regexp: '^JENKINS_HOME=.*'
|
||||
line: 'JENKINS_HOME={{ jenkins_home }}'
|
||||
mode: 0644
|
||||
register: jenkins_home_config
|
||||
|
||||
- name: Immediately restart Jenkins on init config changes.
|
||||
service: name=jenkins state=restarted
|
||||
when: jenkins_init_prefix.changed
|
||||
tags: ['skip_ansible_lint']
|
||||
|
||||
- name: Set HTTP port in Jenkins config.
|
||||
lineinfile:
|
||||
backrefs: true
|
||||
dest: "{{ jenkins_init_file }}"
|
||||
regexp: '^{{ jenkins_http_port_param }}='
|
||||
line: '{{ jenkins_http_port_param }}={{ jenkins_http_port }}'
|
||||
mode: 0644
|
||||
register: jenkins_http_config
|
||||
|
||||
- name: Create custom init scripts directory.
|
||||
file:
|
||||
path: "{{ jenkins_home }}/init.groovy.d"
|
||||
state: directory
|
||||
owner: "{{ jenkins_process_user }}"
|
||||
group: "{{ jenkins_process_group }}"
|
||||
mode: 0775
|
||||
|
||||
- name: Configure proxy config for Jenkins
|
||||
template:
|
||||
src: proxy.xml
|
||||
dest: "{{ jenkins_home }}/proxy.xml"
|
||||
owner: "{{ jenkins_process_user }}"
|
||||
group: "{{ jenkins_process_group }}"
|
||||
mode: 0664
|
||||
register: jenkins_proxy_config
|
||||
when:
|
||||
- jenkins_proxy_host | length > 0
|
||||
- jenkins_proxy_port | length > 0
|
||||
|
||||
- name: Trigger handlers immediately in case Jenkins was installed
|
||||
meta: flush_handlers
|
||||
|
||||
- name: Immediately restart Jenkins on http or user changes.
|
||||
service: name=jenkins state=restarted
|
||||
when: >
|
||||
(jenkins_users_config is defined and jenkins_users_config.changed)
|
||||
or (jenkins_http_config is defined and jenkins_http_config.changed)
|
||||
or (jenkins_home_config is defined and jenkins_home_config.changed)
|
||||
or (jenkins_proxy_config is defined and jenkins_proxy_config.changed)
|
||||
tags: ['skip_ansible_lint']
|
|
@ -1,46 +0,0 @@
|
|||
---
|
||||
- name: Ensure dependencies are installed.
|
||||
apt:
|
||||
name:
|
||||
- curl
|
||||
- apt-transport-https
|
||||
- gnupg
|
||||
state: present
|
||||
|
||||
- name: Add Jenkins apt repository key.
|
||||
apt_key:
|
||||
url: "{{ jenkins_repo_key_url }}"
|
||||
state: present
|
||||
|
||||
- name: Add Jenkins apt repository.
|
||||
apt_repository:
|
||||
repo: "{{ jenkins_repo_url }}"
|
||||
state: present
|
||||
update_cache: true
|
||||
when: jenkins_repo_url | default(false)
|
||||
tags: ['skip_ansible_lint']
|
||||
|
||||
- name: Download specific Jenkins version.
|
||||
get_url:
|
||||
url: "{{ jenkins_pkg_url }}/jenkins_{{ jenkins_version }}_all.deb"
|
||||
dest: "/tmp/jenkins_{{ jenkins_version }}_all.deb"
|
||||
when: jenkins_version is defined
|
||||
|
||||
- name: Check if we downloaded a specific version of Jenkins.
|
||||
stat:
|
||||
path: "/tmp/jenkins_{{ jenkins_version }}_all.deb"
|
||||
register: specific_version
|
||||
when: jenkins_version is defined
|
||||
|
||||
- name: Install our specific version of Jenkins.
|
||||
apt:
|
||||
deb: "/tmp/jenkins_{{ jenkins_version }}_all.deb"
|
||||
state: present
|
||||
when: jenkins_version is defined and specific_version.stat.exists
|
||||
notify: configure default users
|
||||
|
||||
- name: Ensure Jenkins is installed.
|
||||
apt:
|
||||
name: jenkins
|
||||
state: "{{ jenkins_package_state }}"
|
||||
notify: configure default users
|
|
@ -1,45 +0,0 @@
|
|||
---
|
||||
- name: Ensure dependencies are installed.
|
||||
package:
|
||||
name:
|
||||
- curl
|
||||
- initscripts
|
||||
- "{{ 'libselinux-python' if ansible_python['version']['major'] < 3 else 'python3-libselinux' }}"
|
||||
state: present
|
||||
|
||||
- name: Ensure Jenkins repo is installed.
|
||||
get_url:
|
||||
url: "{{ jenkins_repo_url }}"
|
||||
dest: /etc/yum.repos.d/jenkins.repo
|
||||
when: jenkins_repo_url | default(false)
|
||||
|
||||
- name: Add Jenkins repo GPG key.
|
||||
rpm_key:
|
||||
state: present
|
||||
key: "{{ jenkins_repo_key_url }}"
|
||||
when: jenkins_repo_url | default(false)
|
||||
|
||||
- name: Download specific Jenkins version.
|
||||
get_url:
|
||||
url: "{{ jenkins_pkg_url }}/jenkins-{{ jenkins_version }}-1.1.noarch.rpm"
|
||||
dest: "/tmp/jenkins-{{ jenkins_version }}-1.1.noarch.rpm"
|
||||
when: jenkins_version is defined
|
||||
|
||||
- name: Check if we downloaded a specific version of Jenkins.
|
||||
stat:
|
||||
path: "/tmp/jenkins-{{ jenkins_version }}-1.1.noarch.rpm"
|
||||
register: specific_version
|
||||
when: jenkins_version is defined
|
||||
|
||||
- name: Install our specific version of Jenkins.
|
||||
package:
|
||||
name: "/tmp/jenkins-{{ jenkins_version }}-1.1.noarch.rpm"
|
||||
state: present
|
||||
when: jenkins_version is defined and specific_version.stat.exists
|
||||
notify: configure default users
|
||||
|
||||
- name: Ensure Jenkins is installed.
|
||||
package:
|
||||
name: jenkins
|
||||
state: "{{ jenkins_package_state }}"
|
||||
notify: configure default users
|
|
@ -1,28 +0,0 @@
|
|||
#!groovy
|
||||
import hudson.security.*
|
||||
import jenkins.model.*
|
||||
|
||||
def instance = Jenkins.getInstance()
|
||||
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
|
||||
def users = hudsonRealm.getAllUsers()
|
||||
users_s = users.collect { it.toString() }
|
||||
|
||||
// Create the admin user account if it doesn't already exist.
|
||||
if ("{{ jenkins_admin_username }}" in users_s) {
|
||||
println "Admin user already exists - updating password"
|
||||
|
||||
def user = hudson.model.User.get('{{ jenkins_admin_username }}');
|
||||
def password = hudson.security.HudsonPrivateSecurityRealm.Details.fromPlainPassword('{{ jenkins_admin_password }}')
|
||||
user.addProperty(password)
|
||||
user.save()
|
||||
}
|
||||
else {
|
||||
println "--> creating local admin user"
|
||||
|
||||
hudsonRealm.createAccount('{{ jenkins_admin_username }}', '{{ jenkins_admin_password }}')
|
||||
instance.setSecurityRealm(hudsonRealm)
|
||||
|
||||
def strategy = new FullControlOnceLoggedInAuthorizationStrategy()
|
||||
instance.setAuthorizationStrategy(strategy)
|
||||
instance.save()
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<proxy>
|
||||
<name>{{ jenkins_proxy_host }}</name>
|
||||
<port>{{ jenkins_proxy_port}}</port>
|
||||
<noProxyHost>{{ jenkins_proxy_noproxy | join(',') }}</noProxyHost>
|
||||
<secretPassword></secretPassword>
|
||||
</proxy>
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
__jenkins_repo_url: deb https://pkg.jenkins.io/debian{{ '-stable' if (jenkins_prefer_lts | bool) else '' }} binary/
|
||||
__jenkins_repo_key_url: https://pkg.jenkins.io/debian{{ '-stable' if (jenkins_prefer_lts | bool) else '' }}/jenkins.io.key
|
||||
__jenkins_pkg_url: https://pkg.jenkins.io/debian/binary
|
||||
jenkins_init_file: /etc/default/jenkins
|
||||
jenkins_http_port_param: HTTP_PORT
|
||||
jenkins_java_options_env_var: JAVA_ARGS
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue