Files
proxmox-template-clone/playbooks/configure.yml
2026-03-12 09:22:09 -04:00

54 lines
1.4 KiB
YAML

---
- name: Configure provisioned machine
hosts: new_host
become: true
gather_facts: true
tasks:
- name: Wait for system to be ready
ansible.builtin.wait_for_connection:
timeout: 300
- name: Gather facts after connection
ansible.builtin.setup:
- name: Update apt cache
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
- name: Upgrade all packages
ansible.builtin.apt:
upgrade: dist
autoremove: true
- name: Install git
ansible.builtin.apt:
name: git
state: present
when: install_git | default(false) | bool
- name: Include Zabbix agent role
ansible.builtin.include_role:
name: zabbix_agent
when: install_zabbix | default(false) | bool
- name: Include Docker role
ansible.builtin.include_role:
name: docker
when: install_docker | default(false) | bool
- name: Include NFS role
ansible.builtin.include_role:
name: nfs
vars:
install_nfs_folder: "{{ install_nfs_folder | default(false) | bool }}"
install_nfs_vault: "{{ install_nfs_vault | default(false) | bool }}"
when: install_nfs_folder | default(false) | bool or install_nfs_vault | default(false) | bool
- name: Reboot if required
ansible.builtin.reboot:
reboot_timeout: 300
when: ansible_facts['distribution'] == 'Ubuntu'
ignore_errors: true