-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8458d0f
commit 787a647
Showing
11 changed files
with
177 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
mirror_path: /repo | ||
mirror_path_use_subdir: false | ||
mirror_custom_ssl: true | ||
mirror_create_fs: false | ||
mirror_bootstrap_mirror: false | ||
mirror_configure_crons: false | ||
rsync_modules: | ||
almalinux: | ||
path: "{{ mirror_path }}/almalinux" | ||
comment: AlmaLinux repository | ||
almalinux-elevate: | ||
path: "{{ mirror_path }}/elevate" | ||
comment: AlmaLinux ELevate repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
--- | ||
- name: Restart caddy | ||
ansible.builtin.systemd: | ||
ansible.builtin.systemd_service: | ||
name: caddy.service | ||
state: restarted | ||
|
||
- name: Restart rsyncd | ||
ansible.builtin.systemd_service: | ||
name: rsyncd.service | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
- name: Route 53 tasks | ||
ansible.builtin.include_tasks: route53.yml | ||
|
||
- name: Install certbot and route53 plugin | ||
ansible.builtin.package: | ||
name: | ||
- certbot | ||
- python3-certbot-dns-route53 | ||
state: present | ||
tags: certbot | ||
|
||
- name: Start/enable certbot renew timer | ||
ansible.builtin.systemd_service: | ||
name: certbot-renew.timer | ||
enabled: true | ||
state: started | ||
tags: certbot | ||
|
||
- name: Configure certbot deploy hook | ||
ansible.builtin.template: | ||
src: certbot-deploy-hook.sh.j2 | ||
dest: /etc/letsencrypt/deploy-caddy.sh | ||
mode: "0755" | ||
tags: certbot | ||
|
||
- name: Get certificate with certbot | ||
args: | ||
creates: /etc/letsencrypt/live/{{ inventory_hostname }}/fullchain.pem | ||
ansible.builtin.shell: > | ||
certbot certonly --dns-route53 -d {{ inventory_hostname }} -d rsync.repo.almalinux.org -m {{ certbot_email }} --agree-tos -n --force-renewal | ||
--deploy-hook /etc/letsencrypt/deploy-caddy.sh | ||
throttle: 1 | ||
tags: certbot skip_ansible_lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
- name: Create AWS config dir | ||
ansible.builtin.file: | ||
path: /root/.aws | ||
state: directory | ||
mode: "0700" | ||
|
||
- name: Write AWS config file | ||
vars: | ||
aws_access_key_id: | ||
"{{ lookup('community.hashi_vault.hashi_vault', 'kv/data/infra/aws/rsync.repo.almalinux.org/route53:access_key', | ||
token=lookup('env', 'VAULT_TOKEN'), url=secrets_url) }}" | ||
aws_secret_access_key: | ||
"{{ lookup('community.hashi_vault.hashi_vault', 'kv/data/infra/aws/rsync.repo.almalinux.org/route53:secret_key', | ||
token=lookup('env', 'VAULT_TOKEN'), url=secrets_url) }}" | ||
ansible.builtin.template: | ||
src: aws_config.j2 | ||
dest: /root/.aws/config | ||
mode: "0600" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# {{ ansible_managed }} | ||
[default] | ||
region = us-east-1 | ||
aws_access_key_id = {{ aws_access_key_id }} | ||
aws_secret_access_key = {{ aws_secret_access_key}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
# {{ ansible_managed }} | ||
|
||
# dynamic based on domain. ex: /etc/letsencrypt/live/example.com | ||
cert_dir=$RENEWED_LINEAGE | ||
|
||
install -pD -m 700 -g caddy -o caddy $cert_dir/fullchain.pem /etc/caddy/{{ inventory_hostname }}.fullchain.pem | ||
install -pD -m 700 -g caddy -o caddy $cert_dir/privkey.pem /etc/caddy/{{ inventory_hostname }}.privkey.pem | ||
|
||
# only reload caddy if it is running | ||
systemctl is-active --quiet caddy.service && systemctl reload caddy.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# {{ ansible_managed }} | ||
|
||
uid = nobody | ||
gid = nobody | ||
reverse lookup = false | ||
forward lookup = false | ||
max connections = 1000 | ||
transfer logging = true | ||
use chroot = true | ||
read only = true | ||
timeout = 600 | ||
|
||
motd file = /etc/rsyncmotd | ||
|
||
log file=/var/log/rsyncd.log | ||
|
||
{% for module,values in rsync_modules.items() %} | ||
[{{ module }}] | ||
{% for key,value in values.items() %} | ||
{{ key }} = {{ value }} | ||
{% endfor %} | ||
|
||
{% endfor %} |