Skip to content

Commit

Permalink
Empty commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
aybarsm committed Jun 27, 2024
1 parent 6c34ff8 commit 02c3f17
Show file tree
Hide file tree
Showing 21 changed files with 70 additions and 45 deletions.
File renamed without changes.
6 changes: 6 additions & 0 deletions roles/posix/defaults/sysctl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
linux_manage_posix_sysctl: false

linux_posix_sysctl_default: []
linux_posix_sysctl_group: []
linux_posix_sysctl_host: []
linux_posix_sysctl_all: "{{ (linux_posix_sysctl_host + linux_posix_sysctl_group + linux_posix_sysctl_default) | unique(attribute='name') }}"
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions roles/posix/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Import posix sysctl tasks
ansible.builtin.import_tasks:
file: sysctl.yml
when: linux_manage_posix_sysctl | bool
14 changes: 14 additions & 0 deletions roles/posix/tasks/sysctl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: Manage sysctl settings
ansible.posix.sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
ignoreerrors: "{{ item.ignoreerrors | default(omit) | bool }}"
reload: "{{ item.reload | default(omit) | bool }}"
state: "{{ item.state | default('present') }}"
sysctl_file: "{{ item.sysctl_file | default(omit) }}"
sysctl_set: "{{ item.sysctl_set | default(omit) | bool }}"
when:
- linux_posix_sysctl_conf | linux_type_debug == 'list'
- linux_posix_sysctl_conf | length > 0
loop: "{{ linux_posix_sysctl_conf }}"
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions roles/systemd/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ensures system manager is systemd - ansible_service_mgr == "systemd"
linux_systemd_ensure_service_manager: true
36 changes: 36 additions & 0 deletions roles/systemd/defaults/network.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
linux_manage_systemd_network: false

linux_systemd_network_apply_changes: false
linux_systemd_network_responsible_services:
- systemd
- systemd-networkd

linux_systemd_network_backup: true
linux_systemd_network_cleanup: false
linux_systemd_network_cleanup_patterns_use_regex: true

# Consult: https://manpages.debian.org/bookworm/systemd/systemd.net-naming-scheme.7.en.html
linux_systemd_network_naming_scheme: "v252"
# TODO: This feature will be implemented.
linux_systemd_network_naming_scheme_apply_kernel: false

linux_systemd_network_dir: /etc/systemd/network
linux_systemd_network_template: network.j2

linux_systemd_network_default: []
linux_systemd_network_group: []
linux_systemd_network_host: []
linux_systemd_network_all: "{{ (linux_systemd_network_host + linux_systemd_network_group + linux_systemd_network_default) |
selectattr('name', 'defined') | selectattr('name', 'search', '\\.(network|link|netdev)$') |
selectattr('config', 'defined') | unique(attribute='name') }}"

linux_systemd_network_names: "{{ linux_systemd_network_all | map(attribute='name') }}"
linux_systemd_network_cleanup_regex:
- "^({{ linux_systemd_network_names | select('match', '.*\\.link$') | map('replace', '.link', '') | join('|') }})\\.link$"
- "^({{ linux_systemd_network_names | select('match', '.*\\.netdev$') | map('replace', '.netdev', '') | join('|') }})\\.netdev$"
- "^({{ linux_systemd_network_names | select('match', '.*\\.network$') | map('replace', '.network', '') | join('|') }})\\.network$"
# Escape backup files:
- "^.*\\.\\d+\\.\\d{4}-\\d{2}-\\d{2}@\\d{2}:\\d{2}:\\d{2}~$"

linux_systemd_network_cleanup_patterns: ["(?!{{ linux_systemd_network_cleanup_regex | join('|') }})"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions roles/systemd/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Import systemd network tasks
ansible.builtin.import_tasks:
file: network.yml
when:
- linux_manage_systemd_network | bool
- not linux_systemd_ensure_service_manager | bool or ansible_service_mgr == "systemd"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 0 additions & 38 deletions roles/systemd_network/defaults/main.yml

This file was deleted.

7 changes: 0 additions & 7 deletions roles/systemd_network/tasks/main.yml

This file was deleted.

0 comments on commit 02c3f17

Please sign in to comment.