This repository has been archived on 2023-12-26. You can view files and clone it, but cannot push or open issues or pull requests.
hypervisors/ansible/hypervisors.yml

73 lines
1.5 KiB
YAML
Raw Normal View History

2023-04-24 17:28:53 +00:00
---
2023-06-17 10:54:41 +00:00
- name: Prepare physical machines
hosts: hypervisors
2023-04-24 17:28:53 +00:00
handlers:
- name: enable interfaces
command:
cmd: ifup -a
pre_tasks:
2023-06-17 10:54:41 +00:00
- name: Delete externally managed environment file
shell:
cmd: "rm /usr/lib/python*/EXTERNALLY-MANAGED"
register: rm
changed_when: "rm.rc == 0"
failed_when: "false"
2023-04-28 08:56:08 +00:00
- name: Set timezone
timezone:
name: Europe/Amsterdam
2023-04-25 20:02:00 +00:00
- name: Create data directory
file:
path: /data
state: directory
2023-04-26 14:07:06 +00:00
mode: og=rwx
2023-04-25 20:02:00 +00:00
2023-05-03 21:35:57 +00:00
- name: Copy interfaces configuration
2023-06-08 18:37:52 +00:00
template:
src: dmz.conf.j2
2023-05-03 21:35:57 +00:00
dest: /etc/network/interfaces.d/dmz.conf
2023-05-04 11:43:33 +00:00
register: interfaces
- name: Enable interfaces
command:
cmd: ifup -a
when: interfaces.changed
2023-05-03 21:35:57 +00:00
2023-06-17 10:54:41 +00:00
roles:
- {role: setup_apt, tags: setup_apt}
- {role: libvirt, tags: libvirt}
- name: Setup special services
hosts: atlas
pre_tasks:
- name: Create terraform database
include_role:
name: postgresql_database
vars:
database_name: terraform_state
database_user: terraform
database_password: "{{ terraform_db_password }}"
2023-06-17 10:54:41 +00:00
roles:
- {role: ssh_ca, tags: ssh_ca}
- hosts: hypervisors
2023-05-10 16:54:43 +00:00
2023-05-03 21:35:57 +00:00
roles:
2023-04-26 17:29:58 +00:00
- {role: ssh_ca_known_hosts, tags: ssh_ca_known_hosts}
- {role: deploy_ssh_certificates, tags: deploy_ssh_certificates}
2023-06-17 10:54:41 +00:00
- name: Enable backups
hosts: lewis
roles:
- {role: borg, tags: borg}
2023-08-03 11:52:54 +00:00
- name: Install fluentbit
hosts: hypervisors
roles:
- {role: fluentbit, tags: fluentbit}