Modified ssh role

This commit is contained in:
Opnxng 2023-11-25 08:10:49 +08:00
parent 31fb9a6ba9
commit bad6fb7b57
7 changed files with 67 additions and 39 deletions

2
.gitignore vendored Normal file → Executable file
View File

@ -3,5 +3,3 @@ production
.hidden
.vscode
*.swp
set-up-control-node.yaml
roles/ufw-control-node

View File

@ -0,0 +1,14 @@
- name: Set up Grub
template:
src: "grub.j2"
dest: "/etc/default/grub"
owner: 0
group: 0
mode: 0644
when: inventory_hostname in groups["oracle"]
- name: System | GRUB | Update GRUB
become: true
ansible.builtin.command:
cmd: update-grub2
when: inventory_hostname in groups["oracle"]

View File

@ -0,0 +1,10 @@
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash fsck.mode=force fsck.repair=yes"
GRUB_CMDLINE_LINUX=""

View File

@ -0,0 +1,5 @@
- name: Add vm.overcommit_memory to sysctl.conf
lineinfile:
path: /etc/sysctl.conf
line: 'vm.overcommit_memory=1'
insertafter: EOF # Add the line at the end of the file

View File

@ -11,6 +11,7 @@
- name: Restart SSH service
systemd:
name: sshd
enabled: true
state: restarted
# ----------------------------------------------------------------------------------------------------------------
@ -32,4 +33,4 @@
group: "1000"
# stat -c "%a %n" .ssh/*
# ls -al .ssh
# ls -al .ssh

View File

@ -9,41 +9,44 @@
# ----------------------------------------------------------------------------------------------------
pre_tasks:
- name: Install packages
apt:
name:
- iputils-ping
- cron
- fzf
- git
- curl
- zip
- unzip
- trash-cli
state: latest
install_recommends: false
update_cache: true
autoclean: true
autoremove: true
# - name: Install packages
# apt:
# name:
# - iputils-ping
# - cron
# - fzf
# - git
# - curl
# - zip
# - unzip
# - trash-cli
# state: latest
# install_recommends: false
# update_cache: true
# autoclean: true
# autoremove: true
- name: Touch .hushlogin
file:
path: "/home/{{ user }}/.hushlogin"
state: touch
# ----------------------------------------------------------------------------------------------------
roles:
- neovim
- disable-root
- timezone
- chrony
- hostname
- systemd-resolved
- sources-list
- ssh
- ufw-opnxng
- fail2ban
- unattended-upgrades
- nfs-opnxng
- docker
- grub-opnxng
# - neovim
# - disable-root
# - timezone
# - chrony
# - hostname
# - systemd-resolved
# - sources-list
# - ssh
# - ufw-opnxng
# - fail2ban
# - unattended-upgrades
# - nfs-opnxng
# - docker
# - set-vm-overcommit-memory
#- docker-buildx

View File

@ -1,9 +1,6 @@
user:
ssh_port:
docker_dir:
oracle_ipv4_cidr_block:
wireguard_mesh_subnet:
wireguard_mesh_control_host:
wireguard_port:
oracle_ipv4_cidr_block:
user:
ssh_port:
wireguard_port: