77 lines
2.3 KiB
YAML
77 lines
2.3 KiB
YAML
---
|
|
# Main playbook for complete VPS setup with Trillium Notes
|
|
- name: Complete VPS Setup for Trillium Notes
|
|
hosts: vps
|
|
become: yes
|
|
gather_facts: yes
|
|
|
|
pre_tasks:
|
|
- name: Display deployment information
|
|
debug:
|
|
msg:
|
|
- "Starting deployment for {{ full_domain }}"
|
|
- "Target server: {{ inventory_hostname }}"
|
|
- "User: {{ ansible_user }}"
|
|
- "Email for SSL: {{ ssl_email }}"
|
|
|
|
- name: Update system packages
|
|
apt:
|
|
update_cache: yes
|
|
upgrade: safe
|
|
autoremove: yes
|
|
|
|
tasks:
|
|
# Include individual playbooks
|
|
- name: Include Docker installation
|
|
import_tasks: playbooks/01-install-docker.yml
|
|
tags: docker
|
|
|
|
- name: Include Nginx installation
|
|
import_tasks: playbooks/02-install-nginx.yml
|
|
tags: nginx
|
|
|
|
- name: Include Certbot setup
|
|
import_tasks: playbooks/03-setup-certbot.yml
|
|
tags: certbot
|
|
|
|
- name: Include Trillium deployment
|
|
import_tasks: playbooks/04-deploy-trillium.yml
|
|
tags: trillium
|
|
|
|
- name: Include Gitea deployment
|
|
import_tasks: playbooks/05-deploy-gitea.yml
|
|
tags: gitea
|
|
|
|
- name: Include Gitea Nginx configuration
|
|
import_tasks: playbooks/06-configure-gitea-nginx.yml
|
|
tags: gitea
|
|
|
|
- name: Include Gitea Certbot setup
|
|
import_tasks: playbooks/07-setup-gitea-certbot.yml
|
|
tags: gitea
|
|
|
|
post_tasks:
|
|
- name: Get service status
|
|
systemd:
|
|
name: "{{ item }}"
|
|
register: service_status
|
|
loop:
|
|
- docker
|
|
- nginx
|
|
- gitea
|
|
- trillium
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Final system check
|
|
debug:
|
|
msg:
|
|
- "Deployment completed successfully!"
|
|
- "Trillium Notes should be accessible at: https://{{ trillium_domain }}"
|
|
- "Gitea should be accessible at: https://{{ gitea_domain }}"
|
|
- "Services status:"
|
|
- " - Docker: {{ service_status.results[0].status.ActiveState }}"
|
|
- " - Nginx: {{ service_status.results[1].status.ActiveState }}"
|
|
- " - Gitea: {{ service_status.results[2].status.ActiveState if service_status.results[2] is defined else 'not found' }}"
|
|
- " - Trillium: {{ service_status.results[3].status.ActiveState if service_status.results[3] is defined else 'not found' }}"
|