Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06631ee505 | ||
|
|
ce9b5d58b4 | ||
|
|
2c29ea2780 |
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
## OS generated files
|
## OS generated files
|
||||||
# macOS
|
# macOS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
._*
|
._*
|
||||||
@@ -1,3 +1,8 @@
|
|||||||
Opinionated set of roles to configure reasonable defaults for newly provisioned virtual machines. The repository provides a ready-to-use Ansible Collection (`studiovitali.ansible`) containing reusable roles.
|
# Ansible Collection
|
||||||
|
|
||||||
|
Opinionated set of roles to configure reasonable defaults for newly provisioned virtual machines. The repository provides:
|
||||||
|
- An Ansible Collection (`studio.ansible`) containing reusable roles. Use with ansible-galaxy's `requirements.yml`.
|
||||||
|
- A ready-to-use playbook configured by passing CLI vars `--extra-vars "ansible_host=${HOST_IP}` locally or through CI / CD.
|
||||||
|
|
||||||
Currently only supports Debian-based systems.
|
Currently only supports Debian-based systems.
|
||||||
|
|
||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
## galaxy.yml
|
## galaxy.yml
|
||||||
|
|
||||||
namespace: studiovitali
|
namespace: studio
|
||||||
name: ansible
|
name: ansible
|
||||||
readme: README.md
|
readme: README.md
|
||||||
version: 0.1.1
|
version: 0.0.1
|
||||||
authors:
|
authors:
|
||||||
- Studio Vitali
|
- Studio Vitali
|
||||||
description: Studio Ansible collection containing common roles
|
description: Studio Ansible collection containing common roles
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
[target]
|
||||||
|
target_host ansible_host="{{ ansible_host }}"
|
||||||
|
|
||||||
|
[all:vars]
|
||||||
|
ansible_user="{{ ansible_user }}"
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
- name: Setup machines
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- base
|
||||||
|
- users
|
||||||
|
- security
|
||||||
|
- docker
|
||||||
|
# - backup
|
||||||
@@ -9,6 +9,6 @@ base_packages:
|
|||||||
- rsync
|
- rsync
|
||||||
- unzip
|
- unzip
|
||||||
- unattended-upgrades
|
- unattended-upgrades
|
||||||
# - acl ## needed for ansible to become unprivileged user
|
# - acl ## needed for Ansible to become unprivileged user
|
||||||
# - python3-pip
|
# - python3-pip
|
||||||
# - wget
|
# - wget
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
become: true
|
become: true
|
||||||
|
#
|
||||||
# - name: Enable unattended-upgrades
|
# - name: Enable unattended-upgrades
|
||||||
# ansible.builtin.copy:
|
# ansible.builtin.copy:
|
||||||
# dest: /etc/apt/apt.conf.d/20auto-upgrades
|
# dest: /etc/apt/apt.conf.d/20auto-upgrades
|
||||||
@@ -35,14 +35,3 @@
|
|||||||
# APT::Periodic::Unattended-Upgrade "1";
|
# APT::Periodic::Unattended-Upgrade "1";
|
||||||
# mode: "0644"
|
# mode: "0644"
|
||||||
# when: ansible_facts['os_family'] == "Debian"
|
# when: ansible_facts['os_family'] == "Debian"
|
||||||
|
|
||||||
- name: Check if reboot is required
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: /var/run/reboot-required
|
|
||||||
register: reboot_required_file
|
|
||||||
|
|
||||||
- name: Reboot host if necessary
|
|
||||||
ansible.builtin.reboot:
|
|
||||||
post_reboot_delay: 10
|
|
||||||
become: true
|
|
||||||
when: reboot_required_file.stat.exists
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: Restart sshd
|
- name: Restart sshd
|
||||||
become: true
|
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: ssh
|
name: ssh
|
||||||
state: restarted
|
state: restarted
|
||||||
@@ -17,7 +17,6 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
validate: /usr/sbin/sshd -t -f %s
|
|
||||||
notify: Restart sshd
|
notify: Restart sshd
|
||||||
|
|
||||||
- name: Enable fail2ban
|
- name: Enable fail2ban
|
||||||
@@ -33,4 +32,4 @@
|
|||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: fail2ban
|
name: fail2ban
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: yes
|
||||||
Reference in new issue
Block a user