-
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
Showing
10 changed files
with
95 additions
and
1 deletion.
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,7 +1,7 @@ | ||
--- | ||
namespace: damex | ||
name: systemd | ||
version: 1.0.2 | ||
version: 1.0.3 | ||
readme: README.md | ||
authors: | ||
- Roman Kuzmitskii <[email protected]> | ||
|
Empty file.
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,9 @@ | ||
--- | ||
systemd_oomd_service_name: systemd-oomd | ||
systemd_oomd_configuration_file: /etc/systemd/oomd.conf | ||
systemd_oomd_swapusedlimit: 90% | ||
systemd_oomd_defaultmemorypressurelimit: 60% | ||
systemd_oomd_defaultmemorypressuredurationsec: 30s | ||
systemd_oomd_package_name: systemd-oomd | ||
systemd_oomd_package_version: "" | ||
systemd_oomd_package_state: present |
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,26 @@ | ||
--- | ||
argument_specs: | ||
main: | ||
options: | ||
systemd_oomd_service_name: | ||
required: true | ||
type: str | ||
systemd_oomd_configuration_file: | ||
required: true | ||
type: str | ||
systemd_oomd_swapusedlimit: | ||
type: str | ||
systemd_oomd_defaultmemorypressurelimit: | ||
type: str | ||
systemd_oomd_defaultmemorypressuredurationsec: | ||
type: str | ||
systemd_oomd_package_name: | ||
required: true | ||
type: str | ||
systemd_oomd_package_version: | ||
type: str | ||
systemd_oomd_package_state: | ||
type: str | ||
choices: | ||
- present | ||
- absent |
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,15 @@ | ||
--- | ||
galaxy_info: | ||
author: Roman Kuzmitskii <[email protected]> | ||
description: systemd oomd role | ||
license: GPLv2 | ||
min_ansible_version: 2.16.0 | ||
platforms: | ||
- name: Debian | ||
versions: | ||
- buster | ||
- bullseye | ||
- name: Ubuntu | ||
versions: | ||
- focal | ||
dependencies: [] |
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,13 @@ | ||
--- | ||
- name: Ensure systemd oomd | ||
tags: | ||
- systemd_oomd | ||
- systemd | ||
- oomd | ||
block: | ||
- name: Ensure systemd oomd package | ||
ansible.builtin.import_tasks: package.yml | ||
- name: Ensure systemd oomd oomd.conf | ||
ansible.builtin.import_tasks: oomd.conf.yml | ||
- name: Ensure systemd oomd systemd service | ||
ansible.builtin.import_tasks: systemd_service.yml |
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,10 @@ | ||
--- | ||
- name: Ensure oomd.conf | ||
ansible.builtin.template: | ||
src: oomd.conf.j2 | ||
dest: "{{ systemd_oomd_configuration_file }}" | ||
group: root | ||
owner: root | ||
mode: "0644" | ||
register: systemd_oomd_conf | ||
become: true |
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,9 @@ | ||
--- | ||
- name: Ensure systemd oomd package | ||
ansible.builtin.include_role: | ||
name: damex.apt.apt_packages | ||
vars: | ||
apt_packages: # noqa: var-naming[no-role-prefix] | ||
- name: "{{ systemd_oomd_package_name }}" | ||
version: "{{ systemd_oomd_package_version }}" | ||
state: "{{ systemd_oomd_package_state }}" |
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,7 @@ | ||
--- | ||
- name: Ensure systemd service {{ systemd_oomd_service_name }} | ||
ansible.builtin.include_role: | ||
name: damex.systemd.systemd_service | ||
vars: | ||
systemd_service_name: "{{ systemd_oomd_service_name }}" | ||
systemd_service_restart_on: "{{ systemd_oomd_conf.changed }}" |
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 | comment }} | ||
[OOM] | ||
SwapUsedLimit = {{ systemd_oomd_swapusedlimit }} | ||
DefaultMemoryPressureLimit = {{ systemd_oomd_defaultmemorypressurelimit }} | ||
DefaultMemoryPressureDurationSec = {{ systemd_oomd_defaultmemorypressuredurationsec }} |