-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
15 changed files
with
148 additions
and
62 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 |
---|---|---|
@@ -1,15 +0,0 @@ | ||
[submodule "ansible-role-nginx"] | ||
path = ansible-role-nginx | ||
url = https://github.com/nginxinc/ansible-role-nginx.git | ||
[submodule "ansible/roles/ansible-role-nginx"] | ||
path = ansible/roles/ansible-role-nginx | ||
url = https://github.com/nginxinc/ansible-role-nginx.git | ||
[submodule "ansible/roles/ansible-role-nginx-config"] | ||
path = ansible/roles/ansible-role-nginx-config | ||
url = https://github.com/nginxinc/ansible-role-nginx-config.git | ||
[submodule "ansible/roles/ansible-role-certbot"] | ||
path = ansible/roles/ansible-role-certbot | ||
url = [email protected]:geerlingguy/ansible-role-certbot.git | ||
[submodule "ansible/roles/postgresql"] | ||
path = ansible/roles/postgresql | ||
url = [email protected]:ANXS/postgresql.git | ||
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 |
---|---|---|
|
@@ -13,7 +13,9 @@ | |
- role: systemd_journald | ||
- role: systemd_timesyncd | ||
- role: node_exporter | ||
- role: geerlingguy.certbot | ||
- role: lego_encrypt_acme | ||
- role: ansible-systemd-timers | ||
# - role: geerlingguy.certbot | ||
|
||
tasks: | ||
- name: Install NGINX | ||
|
@@ -135,6 +137,8 @@ | |
keepalive_timeout: 75s | ||
server_name: | ||
- "{{ domain_name }}" | ||
- "www.{{ domain_name }}" | ||
- "{{ domain_name_nginx }}" | ||
listen: | ||
- address: 0.0.0.0 | ||
port: 80 | ||
|
@@ -172,6 +176,8 @@ | |
keepalive_timeout: 75s | ||
server_name: | ||
- "{{ domain_name }}" | ||
- "www.{{ domain_name }}" | ||
- "{{ domain_name_nginx }}" | ||
listen: | ||
- address: 0.0.0.0 | ||
port: 443 | ||
|
@@ -204,9 +210,9 @@ | |
autoindex: | ||
enable: false | ||
ssl: | ||
certificate: /etc/letsencrypt/live/{{ domain_name }}/fullchain.pem | ||
certificate_key: /etc/letsencrypt/live/{{ domain_name }}/privkey.pem | ||
trusted_certificate: /etc/letsencrypt/live/{{ domain_name }}/cert.pem | ||
certificate: /etc/letsencrypt/{{ domain_name }}/certificates/_.{{ domain_name }}.crt | ||
certificate_key: /etc/letsencrypt/{{ domain_name }}/certificates/_.{{ domain_name }}.key | ||
# trusted_certificate: /etc/letsencrypt/{{ domain_name }}/certificates/cert.pem | ||
ciphers: | ||
- ECDHE-ECDSA-AES128-GCM-SHA256 | ||
- ECDHE-RSA-AES128-GCM-SHA256 | ||
|
@@ -278,6 +284,19 @@ | |
value: $remote_addr | ||
|
||
vars: | ||
domain_name: "{{ domain_name }}" # The primary domain name to obtain wildcard letsencrypt SSL and for paths and certificates name. | ||
api_key: "{{ api_key }}" | ||
email: "{{ email }}" | ||
lego_v: "v4.14.0" | ||
|
||
timers: # https://wiki.archlinux.org/title/systemd/Timers | ||
renewal_letsencrypt: | ||
timer_command: "{{ script_path }} renew && nginx -s reload" | ||
timer_user: root | ||
timer_OnCalendar: "*-*-* 02:37:00 EST" | ||
# timer_persistent: true | ||
timer_AccuracySec: 2h | ||
|
||
docker_compose_version: "2.20.3" | ||
systemd_journald_systemmaxuse: "2G" | ||
node_exporter_version: 1.6.1 # https://github.com/prometheus/node_exporter/releases | ||
|
@@ -289,16 +308,16 @@ | |
ignored-mount-points: "^/(sys|proc|dev)($|/)" | ||
ignored-fs-types: "^(sys|proc|auto)fs$" | ||
|
||
certbot_admin_email: [email protected] | ||
certbot_auto_renew: true | ||
certbot_auto_renew_hour: 2 | ||
certbot_auto_renew_minute: 16 | ||
certbot_auto_renew_options: --quiet | ||
certbot_create_if_missing: true | ||
certbot_create_method: standalone | ||
certbot_install_method: snap | ||
certbot_testmode: true # Enable test mode to only run a test request without actually creating certificates. | ||
certbot_create_standalone_stop_services: | ||
- nginx | ||
certbot_certs: | ||
- domains: "{{ domain_name }}" | ||
# certbot_admin_email: [email protected] | ||
# certbot_auto_renew: true | ||
# certbot_auto_renew_hour: 2 | ||
# certbot_auto_renew_minute: 16 | ||
# certbot_auto_renew_options: --quiet | ||
# certbot_create_if_missing: true | ||
# certbot_create_method: standalone | ||
# certbot_install_method: snap | ||
# certbot_testmode: true # Enable test mode to only run a test request without actually creating certificates. | ||
# certbot_create_standalone_stop_services: | ||
# - nginx | ||
# certbot_certs: | ||
# - domains: "{{ domain_name }}" |
This file was deleted.
Oops, something went wrong.
Submodule anxs.postgresql
deleted from
2697f9
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,6 @@ | ||
--- | ||
domain: "{{ domain_name }}" | ||
apikey: "{{ api_key }}" | ||
email: "{{ email }}" | ||
lego_v: v4.14.0 | ||
script_path: "/etc/letsencrypt/lego_ssl.sh" |
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,55 @@ | ||
--- | ||
- name: Get URL of latest Lego | ||
ansible.builtin.uri: | ||
url: https://api.github.com/repos/go-acme/lego/releases/latest | ||
body_format: json | ||
return_content: true | ||
remote_src: false | ||
# delegate_to: localhost | ||
register: json_response | ||
|
||
- name: Debug json_response | ||
debug: | ||
msg: >- | ||
{{ | ||
(json_response.json.assets | selectattr('browser_download_url', 'search', 'lego_' + (lego_v) + '_linux_amd64.tar.gz') | ||
| list | first).browser_download_url | ||
}} | ||
- name: "Install {{ json_response.json.tag_name }}" | ||
ansible.builtin.unarchive: | ||
src: >- | ||
{{ | ||
(json_response.json.assets | selectattr('browser_download_url', 'search', 'lego_' + (lego_v) + '_linux_amd64.tar.gz') | ||
| list | first).browser_download_url | ||
}} | ||
dest: /usr/bin/ | ||
remote_src: true | ||
|
||
- name: Create Letsencrypt directory | ||
ansible.builtin.file: | ||
path: '{{ item.src }}' | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: '0755' | ||
loop: | ||
- { src: /etc/letsencrypt/ } | ||
|
||
- name: Template a file to /etc/file.conf | ||
ansible.builtin.template: | ||
src: lego_ssl.sh.j2 | ||
dest: "{{ script_path }}" | ||
owner: root | ||
group: root | ||
mode: '0700' | ||
|
||
# - name: Issue a Letsencrypt certificate | ||
# ansible.builtin.command: "${{ script_path }}" | ||
|
||
- name: Issue a Letsencrypt certificate | ||
ansible.builtin.command: | ||
argv: | ||
- "{{ script_path }}" | ||
- run | ||
|
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,17 @@ | ||
#!/bin/sh | ||
|
||
{{ ansible_managed | comment }} | ||
|
||
export VULTR_API_KEY={{ apikey }} | ||
export VULTR_HTTP_TIMEOUT=300 | ||
export VULTR_POLLING_INTERVAL=120 | ||
export VULTR_PROPAGATION_TIMEOUT=600 | ||
export VULTR_TTL=300 | ||
lego --dns vultr \ | ||
--domains *.{{ domain }} \ | ||
--domains {{ domain }} \ | ||
--email {{ email }} \ | ||
--path="/etc/letsencrypt/{{ domain }}" \ | ||
--http.port 81 \ | ||
--tls.port 82 \ | ||
--accept-tos {{ '${1}' }} |
Submodule nginxinc.nginx
deleted from
2d0843
Submodule nginxinc.nginx_config
deleted from
4f5ff6
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#cloud-config | ||
"package_update": false | ||
"package_upgrade": false | ||
"timezone": "Europe/Kiev" | ||
|
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