From 2baa2728c9622c71718b5ef7f7c026bed5868cf7 Mon Sep 17 00:00:00 2001 From: Rottler Tamas Date: Mon, 28 Apr 2025 10:56:55 +0200 Subject: [PATCH] x11forwarding only for debian >11, ipv6 --- tasks/debian.yml | 1 + tasks/main.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tasks/debian.yml b/tasks/debian.yml index db47c0c..d377612 100644 --- a/tasks/debian.yml +++ b/tasks/debian.yml @@ -25,5 +25,6 @@ - { a: "net.ipv6.conf.all.disable_ipv6", v: 1 } - { a: "net.ipv6.conf.default.disable_ipv6", v: 1 } - { a: "net.ipv6.conf.lo.disable_ipv6", v: 1 } + when: "'ipv6' not in group_names" # vim: set tabstop=2 shiftwidth=2 expandtab smarttab: diff --git a/tasks/main.yml b/tasks/main.yml index d520a98..f93fd2d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -16,6 +16,9 @@ copy: content: "X11Forwarding no" dest: /etc/ssh/sshd_config.d/x11forwarding.conf + when: + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or + (ansible_distribution == "RedHat") - name: bash profile.d file: