You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
---
|
|
|
|
- name: Configure apt packages
|
|
import_tasks: packages.yml
|
|
|
|
- name: Configure sshd
|
|
import_tasks: sshd.yml
|
|
|
|
- name: Configure ufw
|
|
import_tasks: ufw.yml
|
|
|
|
- name: Configure locales
|
|
import_tasks: locales.yml
|
|
|
|
- name: Configure custom facts
|
|
import_tasks: custom_facts.yml
|
|
|
|
- name: Configure helpers
|
|
import_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@{{ inventory_hostname }}"
|
|
register: root_user
|
|
|
|
- name: Store ssh public key local
|
|
copy:
|
|
content: "{{ root_user.ssh_public_key }}\n"
|
|
dest: "{{ global_ssh_key_directory }}/root@{{ inventory_hostname }}"
|
|
delegate_to: localhost
|
|
vars:
|
|
ansible_become: no
|
|
|
|
- name: Create scripts directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "u=rwx,g=rx,o="
|
|
loop:
|
|
- "{{ backup_scripts_directory }}"
|
|
- "{{ backup_files_scripts_directory }}"
|
|
- "{{ backup_mysql_database_scripts_directory }}"
|
|
- "{{ update_scripts_directory }}"
|
|
|
|
- name: Create backups directories
|
|
file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "u=rwx,g=rx,o=rx"
|
|
loop:
|
|
- "{{ backups_directory }}"
|
|
- "{{ backups_files_directory }}"
|
|
- "{{ backups_mysql_database_directory }}"
|
|
|
|
- name: Flush handlers for role
|
|
meta: flush_handlers
|