Skip to content

Commit

Permalink
Merge pull request #18 from juwi/feature/common
Browse files Browse the repository at this point in the history
Add common role:
  • Loading branch information
juwi authored Nov 14, 2021
2 parents 74539e9 + b4e235c commit ad522ce
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions playbooks/install_palava_web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
- hosts: all
remote_user: root
roles:
- common
- palava-web
4 changes: 4 additions & 0 deletions roles/common/handlers/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Restart sshd
service:
name: sshd
state: restarted
4 changes: 4 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- include: upgrade.yml
- include: packages.yml
- include: ssh.yml
19 changes: 19 additions & 0 deletions roles/common/tasks/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- name: Install common packages
apt:
name:
- apt-transport-https
- apache2-utils
- fail2ban
- git
- nginx
- unattended-upgrades
- vim
state: present

- name: Make sure some packages are not installed
apt:
name:
- apache2
- cups
- telnet
state: absent
6 changes: 6 additions & 0 deletions roles/common/tasks/ssh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Disable root login without key
lineinfile:
dest: "/etc/ssh/sshd_config"
regexp: "^#?PermitRootLogin "
line: "PermitRootLogin without-password"
notify: "Restart sshd"
6 changes: 6 additions & 0 deletions roles/common/tasks/upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Upgrade packages
apt:
upgrade: 'yes'
update_cache: yes
cache_valid_time: 86400

0 comments on commit ad522ce

Please sign in to comment.