|
|
|
---
|
|
|
|
|
|
|
|
- name: Configure apt packages
|
|
|
|
include_tasks: packages.yml
|
|
|
|
|
|
|
|
- name: Configure sshd
|
|
|
|
include_tasks: sshd.yml
|
|
|
|
|
|
|
|
- name: Configure ufw
|
|
|
|
include_tasks: ufw.yml
|
|
|
|
|
|
|
|
- name: Configure locales
|
|
|
|
include_tasks: locales.yml
|
|
|
|
|
|
|
|
- name: Configure helpers
|
|
|
|
include_tasks: helpers.yml
|
|
|
|
|
|
|
|
- name: Configure ssh key for root user
|
|
|
|
user:
|
|
|
|
name: root
|
|
|
|
state: present
|
|
|
|
generate_ssh_key: yes
|
|
|
|
ssh_key_type: ed25519
|
|
|
|
ssh_key_comment: "root@{{ ansible_fqdn }}"
|
|
|
|
register: root_user
|
|
|
|
|
|
|
|
- name: Store ssh public key local
|
|
|
|
copy:
|
|
|
|
content: "{{ root_user.ssh_public_key }}\n"
|
|
|
|
dest: "public_keys/ssh/root@{{ ansible_fqdn }}"
|
|
|
|
delegate_to: localhost
|
|
|
|
vars:
|
|
|
|
ansible_become: no
|
|
|
|
|
|
|
|
- name: Create auto update scripts directory
|
|
|
|
file:
|
|
|
|
path: "{{ update_scripts_directory }}"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "u=rwx,g=rx,o="
|
|
|
|
|
|
|
|
- name: Create backups directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "u=rwx,g=rx,o=rx"
|
|
|
|
loop:
|
|
|
|
- "{{ backups_directory }}"
|
|
|
|
- "{{ backups_databases_directory }}"
|
|
|
|
- "{{ backups_files_directory }}"
|