Compare commits
1 Commits
main
...
dockerbox_
Author | SHA1 | Date | |
---|---|---|---|
533dd40722 |
5
.github/workflows/vagrant.yml
vendored
5
.github/workflows/vagrant.yml
vendored
@ -3,9 +3,8 @@ name: homelab-ci
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- github_actions
|
- main
|
||||||
# - main
|
- testing
|
||||||
# - testing
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
homelab-ci:
|
homelab-ci:
|
||||||
|
@ -33,7 +33,7 @@ docker_compose_deploy:
|
|||||||
# Nextcloud
|
# Nextcloud
|
||||||
- name: nextcloud
|
- name: nextcloud
|
||||||
url: https://github.com/krislamo/nextcloud
|
url: https://github.com/krislamo/nextcloud
|
||||||
version: fe6d349749f178e91ae7ff726d557f48ebf84356
|
version: 0abc5cc6ba64ed94b7ddc6fd934f0fd62b8a6d11
|
||||||
env:
|
env:
|
||||||
DATA: ./data
|
DATA: ./data
|
||||||
|
|
||||||
|
@ -4,5 +4,4 @@
|
|||||||
roles:
|
roles:
|
||||||
- base
|
- base
|
||||||
- jenkins
|
- jenkins
|
||||||
- proxy
|
|
||||||
- docker
|
- docker
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: smb.conf.j2
|
src: smb.conf.j2
|
||||||
dest: /etc/samba/smb.conf
|
dest: /etc/samba/smb.conf
|
||||||
mode: "644"
|
mode: "700"
|
||||||
notify: restart_samba
|
notify: restart_samba
|
||||||
|
|
||||||
- name: Start smbd and enable on boot
|
- name: Start smbd and enable on boot
|
||||||
|
@ -18,28 +18,6 @@
|
|||||||
src: /etc/wireguard/privatekey
|
src: /etc/wireguard/privatekey
|
||||||
register: wgkey
|
register: wgkey
|
||||||
|
|
||||||
- name: Check if WireGuard preshared key file exists
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: /etc/wireguard/presharedkey-{{ item.name }}
|
|
||||||
loop: "{{ wireguard.peers }}"
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.name }}"
|
|
||||||
register: presharedkey_files
|
|
||||||
|
|
||||||
- name: Grab WireGuard preshared key for configuration
|
|
||||||
ansible.builtin.slurp:
|
|
||||||
src: /etc/wireguard/presharedkey-{{ item.item.name }}
|
|
||||||
register: wgshared
|
|
||||||
loop: "{{ presharedkey_files.results }}"
|
|
||||||
loop_control:
|
|
||||||
label: "{{ item.item.name }}"
|
|
||||||
when: item.stat.exists
|
|
||||||
|
|
||||||
- name: Grab WireGuard private key for configuration
|
|
||||||
ansible.builtin.slurp:
|
|
||||||
src: /etc/wireguard/privatekey
|
|
||||||
register: wgkey
|
|
||||||
|
|
||||||
- name: Install WireGuard configuration
|
- name: Install WireGuard configuration
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: wireguard.j2
|
src: wireguard.j2
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
# {{ ansible_managed }}
|
[Interface]
|
||||||
|
|
||||||
[Interface] # {{ ansible_hostname }}
|
|
||||||
PrivateKey = {{ wgkey['content'] | b64decode | trim }}
|
PrivateKey = {{ wgkey['content'] | b64decode | trim }}
|
||||||
Address = {{ wireguard.address }}
|
Address = {{ wireguard.address }}
|
||||||
{% if wireguard.listenport is defined %}
|
{% if wireguard.listenport is defined %}
|
||||||
@ -8,26 +6,8 @@ ListenPort = {{ wireguard.listenport }}
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for peer in wireguard.peers %}
|
{% for peer in wireguard.peers %}
|
||||||
{% if peer.name is defined %}
|
|
||||||
[Peer] # {{ peer.name }}
|
|
||||||
{% else %}
|
|
||||||
[Peer]
|
[Peer]
|
||||||
{% endif %}
|
|
||||||
PublicKey = {{ peer.publickey }}
|
PublicKey = {{ peer.publickey }}
|
||||||
{% if peer.presharedkey is defined %}
|
|
||||||
PresharedKey = {{ peer.presharedkey }}
|
|
||||||
{% else %}
|
|
||||||
{% set preshared_key = (
|
|
||||||
wgshared.results
|
|
||||||
| selectattr('item.item.name', 'equalto', peer.name)
|
|
||||||
| first
|
|
||||||
).content
|
|
||||||
| default(none)
|
|
||||||
%}
|
|
||||||
{% if preshared_key is not none %}
|
|
||||||
PresharedKey = {{ preshared_key | b64decode | trim }}
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% if peer.endpoint is defined %}
|
{% if peer.endpoint is defined %}
|
||||||
Endpoint = {{ peer.endpoint }}
|
Endpoint = {{ peer.endpoint }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -35,13 +35,7 @@ server {
|
|||||||
client_max_body_size {{ item.client_max_body_size }};
|
client_max_body_size {{ item.client_max_body_size }};
|
||||||
{% endif %}
|
{% endif %}
|
||||||
location / {
|
location / {
|
||||||
{% if item.allowedips is defined %}
|
{% if item.restrict is defined and item.restrict %}
|
||||||
{% for ip in item.allowedips %}
|
|
||||||
allow {{ ip }};
|
|
||||||
{% endfor %}
|
|
||||||
deny all;
|
|
||||||
{% endif %}
|
|
||||||
{% if item.restrict is defined and item.restrict %}
|
|
||||||
auth_basic "{{ item.restrict_name | default('Restricted Access') }}";
|
auth_basic "{{ item.restrict_name | default('Restricted Access') }}";
|
||||||
auth_basic_user_file {{ item.restrict_file | default('/etc/nginx/.htpasswd') }};
|
auth_basic_user_file {{ item.restrict_file | default('/etc/nginx/.htpasswd') }};
|
||||||
proxy_set_header Authorization "";
|
proxy_set_header Authorization "";
|
||||||
|
Loading…
Reference in New Issue
Block a user