Compare commits

...
4 Commits
5 changed files with 24 additions and 7 deletions

No files matched your search

+9 -6
View File
@@ -3,17 +3,16 @@
- tmp.kevinnlsamuel.com
vars:
ansible_user: root
alt_ssh_port: 1023
name: setup server natsuco
tasks:
- name: harden ssh
block:
- name: disable password auth
file:
src: sshd/00-nopasswd.conf
dest: /etc/ssh/ssh_config.d/00-altport.conf
include_role:
name: kevinnlsamuel.galaxy.sshd.disablepasswd
- name: change ssh port
vars:
port: 1023
when: false
template:
src: sshd/00-altport.conf
dest: /etc/ssh/ssh_config.d/00-altport.conf
@@ -21,4 +20,8 @@
dnf:
state: present
name: policycoreutils-python-utils
- command: /usr/sbin/semanage port -a -t ssh_port_t -p tcp 1023
- 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 }}
@@ -1 +1 @@
Port {{ port }}
Port {{ alt_ssh_port }}
+6
View File
@@ -0,0 +1,6 @@
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.
+8
View File
@@ -0,0 +1,8 @@
- name: disable password auth
copy:
src: 00-nopasswd.conf
dest: /etc/ssh/sshd_config.d/00-nopasswd.conf
- name: restart sshd
service:
name: sshd
state: restarted