Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
2cce72a5fd
|
|||
|
d4a86c667e
|
|||
|
b994778d66
|
|||
|
5dac2b5175
|
|||
|
fb35a0acc6
|
|||
|
afcea9439c
|
|||
|
d337407685
|
|||
|
a9c66729dd
|
|||
|
f0f7c05564
|
|||
|
91c793c3c4
|
|||
|
d0ade80f19
|
0
.config/ansible-lint-ignore.txt
Normal file
0
.config/ansible-lint-ignore.txt
Normal file
21
.config/ansible-lint.yml
Normal file
21
.config/ansible-lint.yml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
# see https://docs.ansible.com/projects/lint/configuring/#ansible-lint-configuration
|
||||||
|
profile: moderate
|
||||||
|
exclude_paths:
|
||||||
|
- ".ansible/"
|
||||||
|
|
||||||
|
# Enable checking of loop variable prefixes in roles
|
||||||
|
loop_var_prefix: "^(__|{role}_)"
|
||||||
|
|
||||||
|
# Enforce variable names to follow pattern below, in addition to Ansible own
|
||||||
|
# requirements, like avoiding python identifiers. To disable add `var-naming`
|
||||||
|
# to skip_list.
|
||||||
|
var_naming_pattern: "^[a-z_][a-z0-9_]*$"
|
||||||
|
|
||||||
|
skip_list:
|
||||||
|
- "name[template]"
|
||||||
|
enable_list:
|
||||||
|
- galaxy
|
||||||
|
- fqcn
|
||||||
|
|
||||||
|
offline: true
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.ansible/
|
||||||
|
results/
|
||||||
@@ -8,9 +8,9 @@ description: >-2
|
|||||||
Roles for base services which are core functionality like managing packages
|
Roles for base services which are core functionality like managing packages
|
||||||
and ssh or common dependencies other services like databases
|
and ssh or common dependencies other services like databases
|
||||||
dependencies:
|
dependencies:
|
||||||
"community.docker": "^4.7.0"
|
"community.docker": ">=4.7.0"
|
||||||
"community.general": "^11.1.2"
|
"community.general": ">=11.1.2"
|
||||||
"containers.podman": "^1.17.0"
|
"containers.podman": ">=1.17.0"
|
||||||
license_file: LICENSE.md
|
license_file: LICENSE.md
|
||||||
build_ignore:
|
build_ignore:
|
||||||
- '*.tar.gz'
|
- '*.tar.gz'
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ caddy_config: |+2
|
|||||||
|
|
||||||
# Import all configurations
|
# Import all configurations
|
||||||
import {{ caddy_dynamic_configs_dir }}/*/Caddyfile
|
import {{ caddy_dynamic_configs_dir }}/*/Caddyfile
|
||||||
|
|
||||||
:80 {
|
:80 {
|
||||||
redir / https://{host}{uri} 301
|
redir / https://{host}{uri} 301
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ gpg_config_emit_version: false
|
|||||||
gpg_config_comments: false
|
gpg_config_comments: false
|
||||||
gpg_config_ignore_time_conflict: false
|
gpg_config_ignore_time_conflict: false
|
||||||
gpg_config_allow_freeform_uid: true
|
gpg_config_allow_freeform_uid: true
|
||||||
gpg_config_keyid_format: 0xlong
|
gpg_config_keyid_format: "0xlong"
|
||||||
gpg_config_with_fingerprint: true
|
gpg_config_with_fingerprint: true
|
||||||
|
|
||||||
gpg_config_keyserver: hkps://keys.openpgp.org
|
gpg_config_keyserver: hkps://keys.openpgp.org
|
||||||
|
|||||||
@@ -1,55 +1,54 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Ensure gnupg is installed (RedHat*)
|
- name: Ensure gnupg is installed (RedHat*)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: gnupg2
|
name: gnupg2
|
||||||
state: latest
|
state: latest
|
||||||
become: true
|
become: true
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_os_family == "RedHat"
|
||||||
|
|
||||||
- name: Ensure gnupg is installed (Arch)
|
- name: Ensure gnupg is installed (Arch)
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: gnupg
|
name: gnupg
|
||||||
state: latest
|
state: latest
|
||||||
become: true
|
become: true
|
||||||
when: ansible_os_family == "Archlinux"
|
when: ansible_os_family == "Archlinux"
|
||||||
|
|
||||||
- name: Ensure ~/.gnupg folder exists with correct permissions
|
- name: Ensure ~/.gnupg folder exists with correct permissions
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ gpg_config_folder }}"
|
path: "{{ gpg_config_folder }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0700
|
mode: "0700"
|
||||||
|
|
||||||
- name: Ensure gpg.conf is templated
|
- name: Ensure gpg.conf is templated
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: gpg.conf.j2
|
src: gpg.conf.j2
|
||||||
dest: "{{ gpg_config_file }}"
|
dest: "{{ gpg_config_file }}"
|
||||||
|
|
||||||
- name: Configure gpg-agent.conf (agent configuration)
|
- name: Configure gpg-agent.conf (agent configuration)
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: gpg-agent.conf.j2
|
src: gpg-agent.conf.j2
|
||||||
dest: "{{ gpg_agent_config_file }}"
|
dest: "{{ gpg_agent_config_file }}"
|
||||||
|
|
||||||
- name: Configure scdaemon.conf (smartcard daemon)
|
- name: Configure scdaemon.conf (smartcard daemon)
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: scdaemon.conf.j2
|
src: scdaemon.conf.j2
|
||||||
dest: "{{ gpg_scdaemon_config_file }}"
|
dest: "{{ gpg_scdaemon_config_file }}"
|
||||||
|
|
||||||
- name: Configure sshcontrol (in order for gpg-agent to act as ssh-agent)
|
- name: Configure sshcontrol (in order for gpg-agent to act as ssh-agent)
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: sshcontrol.j2
|
src: sshcontrol.j2
|
||||||
dest: "{{ gpg_agent_sshcontrol_file }}"
|
dest: "{{ gpg_agent_sshcontrol_file }}"
|
||||||
when: gpg_agent_config_enable_ssh_support
|
when: gpg_agent_config_enable_ssh_support
|
||||||
|
|
||||||
- name: Copy gnupg_agent script, which makes gpg-agent responsible for ssh-auth
|
- name: Copy gnupg_agent script, which makes gpg-agent responsible for ssh-auth
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: gpg-configure-ssh-auth-socket.sh
|
src: gpg-configure-ssh-auth-socket.sh
|
||||||
dest: "{{ gpg_configure_agent_script }}"
|
dest: "{{ gpg_configure_agent_script }}"
|
||||||
mode: 0700
|
mode: "0700"
|
||||||
when: gpg_agent_config_enable_ssh_support
|
when: gpg_agent_config_enable_ssh_support
|
||||||
|
|
||||||
- name: Ensure gnupg_agent script is included in bashrc
|
- name: Ensure gnupg_agent script is included in bashrc
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "~/.bashrc"
|
path: "~/.bashrc"
|
||||||
line: "source {{ gpg_configure_agent_script }}"
|
line: "source {{ gpg_configure_agent_script }}"
|
||||||
state: present
|
state: present
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -xeuo pipefail
|
||||||
|
|
||||||
LEGO_BINARY=$(/usr/bin/env which lego)
|
LEGO_BINARY=$(/usr/bin/env which lego)
|
||||||
|
|
||||||
@@ -8,8 +8,11 @@ if [[ -n "${LEGO_HTTP_FALLBACK_PORT:-}" ]]; then
|
|||||||
echo "nc not found (in PATH), exiting"
|
echo "nc not found (in PATH), exiting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
set +e
|
||||||
nc -z 127.0.0.1 $LEGO_HTTP_PORT;
|
nc -z 127.0.0.1 $LEGO_HTTP_PORT;
|
||||||
if [[ $? -eq 0 ]]; then
|
nc_exit_code=$?;
|
||||||
|
set -e
|
||||||
|
if [[ $nc_exit_code -eq 0 ]]; then
|
||||||
LEGO_HTTP_PORT=$LEGO_HTTP_FALLBACK_PORT
|
LEGO_HTTP_PORT=$LEGO_HTTP_FALLBACK_PORT
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
lego_domain_command_args: >-
|
lego_domain_command_args: >-2
|
||||||
{% for domain in lego_cert_domains %}
|
{% for domain in lego_cert_domains %}
|
||||||
--domains={{ domain }}
|
--domains={{ domain }}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
lego_config_command_args: >-
|
lego_config_command_args: >-2
|
||||||
{% for key in lego_full_command_config %}
|
{% for key in lego_full_command_config %}
|
||||||
--{{ key | replace("_", "-") }}
|
--{{ key | replace("_", "-") }}
|
||||||
{%- if lego_full_command_config[key] != None and lego_full_command_config[key] != '' -%}
|
{%- if lego_full_command_config[key] != None and lego_full_command_config[key] != '' -%}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
community.docker.docker_image:
|
community.docker.docker_image:
|
||||||
name: "{{ minio_container_image }}"
|
name: "{{ minio_container_image }}"
|
||||||
state: "{{ minio_state }}"
|
state: "{{ minio_state }}"
|
||||||
source: pull
|
source: "pull"
|
||||||
force_source: "{{ minio_container_image_force_source }}"
|
force_source: "{{ minio_container_image_force_source }}"
|
||||||
|
|
||||||
- name: Ensure container '{{ minio_container_name }}' is {{ minio_container_state }}
|
- name: Ensure container '{{ minio_container_name }}' is {{ minio_container_state }}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
nginx_version: "1.29.4"
|
nginx_version: "1.29.5"
|
||||||
nginx_flavour: alpine
|
nginx_flavour: alpine
|
||||||
nginx_base_path: /opt/nginx
|
nginx_base_path: /opt/nginx
|
||||||
nginx_config_file: "{{ nginx_base_path }}/nginx.conf"
|
nginx_config_file: "{{ nginx_base_path }}/nginx.conf"
|
||||||
@@ -34,4 +34,3 @@ nginx_container_state: >-2
|
|||||||
nginx_container_restart_policy: "unless-stopped"
|
nginx_container_restart_policy: "unless-stopped"
|
||||||
nginx_container_volumes:
|
nginx_container_volumes:
|
||||||
- "{{ nginx_config_file }}:/etc/nginx/conf.d/nginx.conf:ro"
|
- "{{ nginx_config_file }}:/etc/nginx/conf.d/nginx.conf:ro"
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: "{{ nginx_config_file }}"
|
dest: "{{ nginx_config_file }}"
|
||||||
content: "{{ nginx_config }}"
|
content: "{{ nginx_config }}"
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
notify:
|
notify:
|
||||||
- restart-nginx
|
- restart-nginx
|
||||||
when: nginx_state == 'present'
|
when: nginx_state == 'present'
|
||||||
|
|||||||
@@ -22,4 +22,3 @@
|
|||||||
{{ openldap_container_restart_policy | default(omit, true) }}
|
{{ openldap_container_restart_policy | default(omit, true) }}
|
||||||
healthcheck: "{{ openldap_container_healthcheck | default(omit, true) }}"
|
healthcheck: "{{ openldap_container_healthcheck | default(omit, true) }}"
|
||||||
state: "{{ openldap_container_state }}"
|
state: "{{ openldap_container_state }}"
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
msg: "`restic_backup_stdin_command` was set but no filename for the resulting output was supplied in `restic_backup_stdin_command_filename`"
|
msg: "`restic_backup_stdin_command` was set but no filename for the resulting output was supplied in `restic_backup_stdin_command_filename`"
|
||||||
|
|
||||||
- name: Ensure backup frequency adheres to systemd's OnCalender syntax
|
- name: Ensure backup frequency adheres to systemd's OnCalender syntax
|
||||||
command:
|
ansible.builtin.command:
|
||||||
cmd: "systemd-analyze calendar {{ restic_policy.frequency }}"
|
cmd: "systemd-analyze calendar {{ restic_policy.frequency }}"
|
||||||
register: systemd_calender_parse_res
|
register: restic_systemd_calender_parse_result
|
||||||
failed_when: systemd_calender_parse_res.rc != 0
|
failed_when: restic_systemd_calender_parse_result.rc != 0
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
- name: Ensure restic is installed
|
- name: Ensure restic is installed
|
||||||
@@ -42,13 +42,21 @@
|
|||||||
state: present
|
state: present
|
||||||
when: ansible_os_family not in ['RedHat', 'Debian']
|
when: ansible_os_family not in ['RedHat', 'Debian']
|
||||||
|
|
||||||
|
- name: Ensure backup script is templated
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: restic-backup-directories.sh
|
||||||
|
dest: /opt/restic-backup-directories.sh
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
- name: Ensure systemd service file for '{{ restic_job_name }}' is templated
|
- name: Ensure systemd service file for '{{ restic_job_name }}' is templated
|
||||||
template:
|
template:
|
||||||
dest: "/etc/systemd/system/{{ restic_systemd_unit_naming_scheme }}.service"
|
dest: "/etc/systemd/system/{{ restic_systemd_unit_naming_scheme }}.service"
|
||||||
src: restic.service.j2
|
src: restic.service.j2
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
notify:
|
notify:
|
||||||
- reload-systemd
|
- reload-systemd
|
||||||
- trigger-restic
|
- trigger-restic
|
||||||
@@ -59,7 +67,7 @@
|
|||||||
src: restic.timer.j2
|
src: restic.timer.j2
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: 0640
|
mode: "0640"
|
||||||
notify:
|
notify:
|
||||||
- reload-systemd
|
- reload-systemd
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user