Some checks failed
CI / lint-and-test (pull_request) Successful in 1m21s
CI / ansible-validation (pull_request) Successful in 9m3s
CI / secret-scanning (pull_request) Successful in 3m19s
CI / dependency-scan (pull_request) Successful in 7m13s
CI / sast-scan (pull_request) Successful in 6m38s
CI / license-check (pull_request) Successful in 1m16s
CI / vault-check (pull_request) Failing after 6m40s
CI / playbook-test (pull_request) Successful in 9m28s
CI / container-scan (pull_request) Successful in 7m59s
CI / sonar-analysis (pull_request) Failing after 1m11s
CI / workflow-summary (pull_request) Successful in 1m11s
- Add roles/pote: Python/venv deployment role with PostgreSQL, cron jobs - Add playbooks/app/: Proxmox app stack provisioning and configuration - Add roles/app_setup: Generic app deployment role (Node.js/systemd) - Add roles/base_os: Base OS hardening role - Enhance roles/proxmox_vm: Split LXC/KVM tasks, improve error handling - Add IP uniqueness validation: Preflight check for duplicate IPs within projects - Add Proxmox-side IP conflict detection: Check existing LXC net0 configs - Update inventories/production/group_vars/all/main.yml: Add pote project config - Add vault.example.yml: Template for POTE secrets (git key, DB, SMTP) - Update .gitignore: Exclude deploy keys, backup files, and other secrets - Update documentation: README, role docs, execution flow guides Security: - All secrets stored in encrypted vault.yml (never committed in plaintext) - Deploy keys excluded via .gitignore - IP conflict guardrails prevent accidental duplicate IP assignments
66 lines
1.5 KiB
YAML
66 lines
1.5 KiB
YAML
---
|
|
# Role: base_os
|
|
# Purpose: baseline OS config for app guests.
|
|
|
|
- name: Ensure apt cache is up to date
|
|
ansible.builtin.apt:
|
|
update_cache: true
|
|
cache_valid_time: 3600
|
|
|
|
- name: Install baseline packages
|
|
ansible.builtin.apt:
|
|
name: "{{ base_os_packages }}"
|
|
state: present
|
|
|
|
- name: Ensure app user exists
|
|
ansible.builtin.user:
|
|
name: "{{ base_os_user }}"
|
|
shell: "{{ base_os_user_shell }}"
|
|
groups: "{{ base_os_user_groups }}"
|
|
append: true
|
|
create_home: true
|
|
state: present
|
|
|
|
- name: Ensure app user has authorized SSH key
|
|
ansible.posix.authorized_key:
|
|
user: "{{ base_os_user }}"
|
|
state: present
|
|
key: "{{ base_os_user_ssh_public_key }}"
|
|
when: base_os_user_ssh_public_key | length > 0
|
|
|
|
- name: Configure passwordless sudo for app user
|
|
ansible.builtin.copy:
|
|
dest: "/etc/sudoers.d/{{ base_os_user }}"
|
|
content: "{{ base_os_user }} ALL=(ALL) NOPASSWD:ALL\n"
|
|
owner: root
|
|
group: root
|
|
mode: "0440"
|
|
when: base_os_passwordless_sudo | bool
|
|
|
|
- name: Ensure UFW allows SSH
|
|
ansible.builtin.ufw:
|
|
rule: allow
|
|
port: "{{ base_os_allow_ssh_port }}"
|
|
proto: tcp
|
|
|
|
- name: Ensure UFW allows backend port
|
|
ansible.builtin.ufw:
|
|
rule: allow
|
|
port: "{{ base_os_backend_port }}"
|
|
proto: tcp
|
|
when: base_os_enable_backend | bool
|
|
|
|
- name: Ensure UFW allows frontend port
|
|
ansible.builtin.ufw:
|
|
rule: allow
|
|
port: "{{ base_os_frontend_port }}"
|
|
proto: tcp
|
|
when: base_os_enable_frontend | bool
|
|
|
|
- name: Enable UFW (deny incoming by default)
|
|
ansible.builtin.ufw:
|
|
state: enabled
|
|
policy: deny
|
|
|
|
|