Skip to content

Instantly share code, notes, and snippets.

View NetguruGist's full-sized avatar

Netguru NetguruGist

View GitHub Profile
tasks:
- name: remove admin account
user: name=admin state=absent remove=true
(...)
PLAY RECAP **************************************************************
<IP> : ok=3 changed=0 unreachable=0 failed=0
ansible-playbook -i inventory playbook.yml
- name: “update ssh-key to admin user”
authorized_key: user=admin key="SSH_KEY" exclusive=yes
tasks:
- name: create admin account
user: name=admin shell=/bin/bash
- name: Basic server security
hosts: linux
become: true
ansible linux -i inventory -m setup
IP_ADDRESS ansible_ssh_user=ubuntu
- apt: name=logwatch state=present
- cron: name="send logwatch logs" minute="0" hour="0" job="/usr/sbin/logwatch --output mail --mailto you@example.com --detail high" state=present
- apt: name=fail2ban state=present