Compare commits

..
1 Commits
Author SHA1 Message Date
kevinnlsamuel 227bb41259 rearrange a lot 2026-10-25 01:46:36 +05:30
8 changed files with 29 additions and 29 deletions

No files matched your search

+4 -19
View File
@@ -5,23 +5,8 @@
ansible_user: root
alt_ssh_port: 1023
name: setup server natsuco
roles:
- kevinnlsamuel.galaxy.sshd.disablepasswd
- kevinnlsamuel.galaxy.sshd.altport
tasks:
- name: harden ssh
block:
- name: disable password auth
include_role:
name: kevinnlsamuel.galaxy.sshd.disablepasswd
- name: change ssh port
when: false
template:
src: sshd/00-altport.conf
dest: /etc/ssh/ssh_config.d/00-altport.conf
- name: install semanage
dnf:
state: present
name: policycoreutils-python-utils
- name: give sshd access to alt port on selinux
register: result_change_to_alt_port
ignore_errors: true
changed_when: "'already defined' not in result_change_to_alt_port.stdout"
command: semanage port -a -t ssh_port_t -p tcp {{ alt_ssh_port }}
+5
View File
@@ -0,0 +1,5 @@
---
- name: restart sshd
service:
name: sshd
state: restarted
+1
View File
@@ -0,0 +1 @@
/home/kevins/Projects/galaxy/roles/sshd/_handlers
+16
View File
@@ -0,0 +1,16 @@
---
- name: change ssh port to {{ alt_ssh_port | mandatory }}
notify: restart sshd
template:
src: 00-altport.conf
dest: /etc/ssh/sshd_config.d/00-altport.conf
- name: install semanage
when: ansible_facts.selinux.status != 'disabled'
dnf:
state: present
name: policycoreutils-python-utils
- name: give sshd access to alt port on selinux
register: result_change_to_alt_port
ignore_errors: true
changed_when: "'already defined' not in result_change_to_alt_port.stdout"
command: semanage port -a -t ssh_port_t -p tcp {{ alt_ssh_port }}
@@ -0,0 +1 @@
Port {{ alt_ssh_port }}
+1
View File
@@ -0,0 +1 @@
/home/kevins/Projects/galaxy/roles/sshd/_handlers
-6
View File
@@ -1,6 +0,0 @@
galaxy_info:
author: kevinnlsamuel
description: sayin hello
dependencies:
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
+1 -4
View File
@@ -1,8 +1,5 @@
- name: disable password auth
notify: restart sshd
copy:
src: 00-nopasswd.conf
dest: /etc/ssh/sshd_config.d/00-nopasswd.conf
- name: restart sshd
service:
name: sshd
state: restarted