Compare commits
1 Commits
master
...
c06b228be6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c06b228be6 |
@@ -2,7 +2,7 @@
|
||||
namespace: uumas
|
||||
name: general
|
||||
description: General roles
|
||||
version: 0.5.20
|
||||
version: 0.5.17
|
||||
readme: README.md
|
||||
authors:
|
||||
- uumas
|
||||
|
||||
@@ -1,14 +1,4 @@
|
||||
---
|
||||
- name: Set sysctl udp buffer sizes for caddy
|
||||
ansible.posix.sysctl:
|
||||
name: "{{ item.key }}"
|
||||
value: "{{ item.value }}"
|
||||
state: present
|
||||
reload: true
|
||||
with_dict:
|
||||
net.core.rmem_max: "7500000"
|
||||
net.core.wmem_max: "7500000"
|
||||
|
||||
- name: Ensure legacy caddy apt repository not present
|
||||
ansible.builtin.file:
|
||||
path: /etc/apt/sources.list.d/caddy-stable.list
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
msg: "{{ lookup('ansible.builtin.template', 'distroerror.j2').strip() }}"
|
||||
when: >
|
||||
_compatcheck_distro | length != 1 or (
|
||||
ansible_facts.distribution_major_version != 'n/a' and
|
||||
_compatcheck_distro[0].version_min | default(0) > ansible_facts.distribution_major_version | int
|
||||
ansible_distribution_major_version != 'n/a' and
|
||||
_compatcheck_distro[0].version_min | default(0) > ansible_distribution_major_version | int
|
||||
) or
|
||||
_compatcheck_distro[0].version_max is defined and _compatcheck_distro[0].version_max < ansible_facts.distribution_major_version | int or
|
||||
ansible_facts.pkg_mgr not in _compatcheck_distro[0].package_managers | default([_compatcheck_default_package_manager])
|
||||
_compatcheck_distro[0].version_max is defined and _compatcheck_distro[0].version_max < ansible_distribution_major_version | int or
|
||||
ansible_pkg_mgr not in _compatcheck_distro[0].package_managers | default([_compatcheck_default_package_manager])
|
||||
loop_control:
|
||||
loop_var: checkfailed
|
||||
|
||||
@@ -15,4 +15,4 @@
|
||||
{{ distros.append(distro_name ~ distro_package_managers_str) }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
This role only supports {{ distros | join(', ') }} (You are running {{ ansible_facts.distribution }} {{ ansible_facts.distribution_major_version }} ({{ ansible_facts.pkg_mgr }})
|
||||
This role only supports {{ distros | join(', ') }} (You are running {{ ansible_distribution }} {{ ansible_distribution_major_version }} ({{ ansible_pkg_mgr }})
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
_compatcheck_distro: "{{ compatcheck_supported_distributions | selectattr('name', 'equalto', ansible_facts.distribution | lower) }}"
|
||||
_compatcheck_distro: "{{ compatcheck_supported_distributions | selectattr('name', 'equalto', ansible_distribution | lower) }}"
|
||||
_compatcheck_default_package_managers:
|
||||
debian: apt
|
||||
ubuntu: apt
|
||||
fedora: dnf
|
||||
archlinux: pacman
|
||||
macosx: homebrew
|
||||
_compatcheck_default_package_manager: "{{ _compatcheck_default_package_managers[ansible_facts.distribution | lower] }}"
|
||||
_compatcheck_default_package_manager: "{{ _compatcheck_default_package_managers[ansible_distribution | lower] }}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- name: Restart ssh service
|
||||
- name: Restart sshd
|
||||
ansible.builtin.systemd_service:
|
||||
name: "{{ _ssh_service_name }}"
|
||||
name: sshd.service
|
||||
state: restarted
|
||||
|
||||
@@ -6,13 +6,8 @@
|
||||
line: "{{ item.key }} {{ item.value }}"
|
||||
state: present
|
||||
validate: '/usr/sbin/sshd -t -f %s'
|
||||
notify: Restart ssh service
|
||||
notify: Restart sshd
|
||||
with_dict:
|
||||
PermitRootLogin: "prohibit-password"
|
||||
PasswordAuthentication: "{{ 'yes' if ssh_password_auth else 'no' }}"
|
||||
X11Forwarding: "no"
|
||||
|
||||
- name: Ensure ssh service is enabled
|
||||
ansible.builtin.systemd_service:
|
||||
name: "{{ _ssh_service_name }}"
|
||||
enabled: true
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
_ssh_service_name: "{{ 'ssh.service' if ansible_facts.os_family == 'Debian' else 'sshd.service' }}"
|
||||
@@ -1,9 +0,0 @@
|
||||
Adds systemd-related notifiable handlers
|
||||
|
||||
- Reload systemd daemon
|
||||
- Reloads all systemd unit files
|
||||
- Apply systemd unit restarts
|
||||
- Restarts multiple systemd units in a single transaction
|
||||
- Units to be restarted are defined in the `systemd_restart_units` variable of type list
|
||||
- The variable should be set using `ansible.builtin.set_fact`, with `# noqa: var-naming[no-role-prefix]`
|
||||
- The list must not be overridden, but appended (`systemd_restart_units: "{{ systemd_restart_units + ['restartme.service'] }}"`
|
||||
@@ -9,6 +9,6 @@
|
||||
changed_when: true
|
||||
|
||||
- name: Reset systemd restart units
|
||||
listen: Apply systemd unit restarts
|
||||
listen: Apply systemd units restart
|
||||
ansible.builtin.set_fact:
|
||||
systemd_restart_units: []
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Adds a systemd socket for a service
|
||||
@@ -1,2 +0,0 @@
|
||||
---
|
||||
systemd_socket_requires: []
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
- name: Restart socket {{ systemd_socket_name }}
|
||||
ansible.builtin.set_fact:
|
||||
systemd_restart_units: "{{ systemd_restart_units + [systemd_socket_name ~ '.socket'] }}" # noqa: var-naming[no-role-prefix]
|
||||
changed_when: true
|
||||
notify: Apply systemd unit restarts
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
argument_specs:
|
||||
main:
|
||||
description:
|
||||
- Adds a systemd socket for a service
|
||||
options:
|
||||
systemd_socket_name:
|
||||
description: Name of the socket. The socket will be created at /run/<systemd_socket_name>.sock
|
||||
type: str
|
||||
required: true
|
||||
systemd_socket_requires:
|
||||
description: List of units this socket depends on.
|
||||
type: list
|
||||
required: false
|
||||
default: []
|
||||
elements: str
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: systemd
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
- name: Socket {{ systemd_socket_name }}
|
||||
ansible.builtin.template:
|
||||
src: socket.j2
|
||||
dest: /etc/systemd/system/{{ systemd_socket_name }}.socket
|
||||
mode: "0644"
|
||||
notify:
|
||||
- Reload systemd daemon
|
||||
- Restart socket {{ systemd_socket_name }}
|
||||
@@ -1,9 +0,0 @@
|
||||
# {{ ansible_managed }}
|
||||
[Unit]
|
||||
Description={{ systemd_socket_name }} socket
|
||||
{% for item in systemd_socket_requires %}
|
||||
Requires={{ item }}
|
||||
{% endfor %}
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/{{ systemd_socket_name }}.sock
|
||||
@@ -247,26 +247,6 @@ argument_specs:
|
||||
type: dict
|
||||
required: false
|
||||
default: {}
|
||||
match_query:
|
||||
description: Query to match
|
||||
type: list
|
||||
elements: dict
|
||||
required: false
|
||||
default: []
|
||||
options:
|
||||
key:
|
||||
description: Query key to match
|
||||
type: str
|
||||
required: true
|
||||
value:
|
||||
description: Query value to match. Matches any if unset.
|
||||
type: str
|
||||
required: false
|
||||
reverse:
|
||||
description: If true, matches request without matching key/value
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
|
||||
type:
|
||||
type: str
|
||||
@@ -675,26 +655,6 @@ argument_specs:
|
||||
type: dict
|
||||
required: false
|
||||
default: {}
|
||||
match_query:
|
||||
description: Query to match
|
||||
type: list
|
||||
elements: dict
|
||||
required: false
|
||||
default: []
|
||||
options:
|
||||
key:
|
||||
description: Query key to match
|
||||
type: str
|
||||
required: true
|
||||
value:
|
||||
description: Query value to match. Matches any if unset.
|
||||
type: str
|
||||
required: false
|
||||
reverse:
|
||||
description: If true, matches request without matching key/value
|
||||
type: bool
|
||||
required: false
|
||||
default: false
|
||||
|
||||
type:
|
||||
type: str
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
{% for matcher in location.matchers %}
|
||||
{% if matcher.name != '' %}
|
||||
@{{ matcher.name }} {
|
||||
{% for query in matcher.match_query | default([]) %}
|
||||
{{ 'not ' if query.reverse else '' }}query {{ query.key }}={{ query.value | default('*') }}
|
||||
{% endfor %}
|
||||
{% if matcher.match_methods | default([]) | length > 0 %}
|
||||
method {{ matcher.match_methods | join(' ') }}
|
||||
{% endif %}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
_vhost_matcher_defaults:
|
||||
match_headers: {}
|
||||
match_methods: []
|
||||
match_query: []
|
||||
_vhost_matchers: >-
|
||||
{{
|
||||
vhost_matchers
|
||||
|
||||
Reference in New Issue
Block a user