Updated playbook
This commit is contained in:
parent
48d031035e
commit
5c56b99173
@ -1,3 +1,4 @@
|
||||
- name: Set hostname
|
||||
command: "hostnamectl set-hostname {{ inventory_hostname }}"
|
||||
when: inventory_hostname in groups["oracle"]
|
||||
when:
|
||||
- inventory_hostname != 'localhost'
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
- name: Restart SSH service
|
||||
systemd:
|
||||
name: sshd
|
||||
name: ssh
|
||||
enabled: true
|
||||
state: restarted
|
||||
|
||||
|
@ -5,7 +5,7 @@ PermitRootLogin no
|
||||
PasswordAuthentication no
|
||||
AddressFamily inet
|
||||
ChallengeResponseAuthentication no
|
||||
AllowUsers {{ user }}
|
||||
AllowUsers {{ ansible_user }}
|
||||
KbdInteractiveAuthentication no
|
||||
UsePAM yes
|
||||
X11Forwarding no
|
||||
X11Forwarding no
|
||||
|
@ -1,4 +1,4 @@
|
||||
- name: Set timezone to Asia/Singapore
|
||||
- name: Set timezone
|
||||
community.general.timezone:
|
||||
name: "{{ TZ }}"
|
||||
become: true
|
||||
become: true
|
||||
|
6
roles/touch-hushlogin/tasks/main.yml
Normal file
6
roles/touch-hushlogin/tasks/main.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: touch .hushlogin
|
||||
file:
|
||||
path: "/home/{{ user }}/.hushlogin"
|
||||
state: touch
|
||||
|
85
set-up.yaml
85
set-up.yaml
@ -5,47 +5,52 @@
|
||||
vars_files:
|
||||
- vars/secrets.yaml
|
||||
become: true
|
||||
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
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------
|
||||
|
||||
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: Include roles
|
||||
include_role:
|
||||
name: "{{ item }}"
|
||||
loop:
|
||||
- disable-root
|
||||
- timezone
|
||||
- chrony
|
||||
- vps-sources-list
|
||||
- vps-ufw
|
||||
- ssh
|
||||
- fail2ban
|
||||
- unattended-upgrades
|
||||
- nfs-opnxng
|
||||
- docker
|
||||
- touch-hushlogin
|
||||
- set-vm-overcommit-memory
|
||||
#- docker-buildx
|
||||
|
||||
- name: Touch .hushlogin
|
||||
file:
|
||||
path: "/home/{{ user }}/.hushlogin"
|
||||
state: touch
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------
|
||||
|
||||
roles:
|
||||
# - grub-opnxng
|
||||
# - disable-root
|
||||
# - timezone
|
||||
# - chrony
|
||||
# - hostname
|
||||
# - systemd-resolved
|
||||
# - sources-list
|
||||
# - ssh
|
||||
- ufw-opnxng
|
||||
# - fail2ban
|
||||
# - unattended-upgrades
|
||||
# - nfs-opnxng
|
||||
# - docker
|
||||
# - set-vm-overcommit-memory
|
||||
# - docker-buildx
|
||||
- name: Include roles
|
||||
include_role:
|
||||
name: "{{ item }}"
|
||||
loop:
|
||||
- oracle-systemd-resolved
|
||||
- oracle-grub-opnxng
|
||||
- hostname
|
||||
when:
|
||||
- inventory_hostname in groups["oracle"]
|
||||
|
Loading…
Reference in New Issue
Block a user