Files
alexandre.pires 25d3eafa5b Add support for Ubuntu containers and WSL verification
- Implemented tasks for managing Ubuntu containers using Podman, including inspection, creation, starting, and SSH setup.
- Added verification tasks for WSL and Podman installation, machine existence, and NSSM service status.
- Created PowerShell scripts for Podman auto-start on Windows boot.
- Introduced Prometheus role with default configurations and installation tasks.
- Updated Windows SSH role to improve authorized_keys management and permissions handling.
- Modified inventory to include Windows containers host.
- Updated Grafana datasource configurations with direct IP addresses for Prometheus instances.
2026-06-07 20:35:59 +02:00

56 lines
1.4 KiB
YAML

---
# Install NSSM on Windows - reusable role
- name: Create NSSM installation directory
ansible.windows.win_file:
path: "{{ nssm_install_dir }}"
state: directory
- name: Check if NSSM is already installed
ansible.windows.win_stat:
path: "{{ nssm_exe }}"
register: __nssm_check
- name: Download NSSM if not installed
ansible.windows.win_get_url:
url: "{{ nssm_zip_url }}"
dest: "{{ nssm_zip_path }}"
force: false
when: not __nssm_check.stat.exists
- name: Extract NSSM if not installed
community.windows.win_unzip:
src: "{{ nssm_zip_path }}"
dest: "{{ nssm_install_dir }}"
delete_archive: false
creates: "{{ nssm_exe }}"
- name: Verify NSSM executable is present
ansible.windows.win_stat:
path: "{{ nssm_exe }}"
register: __nssm_stat
- name: Fail if NSSM executable is missing
ansible.builtin.fail:
msg: >-
nssm binary not found at {{ nssm_exe }}.
Check download/unzip and nssm_version.
when: not __nssm_stat.stat.exists
# - name: Add NSSM to PATH (user level)
# ansible.windows.win_path:
# name: Path
# elements:
# - "{{ nssm_install_dir }}\\nssm-{{ nssm_version }}\\win64"
# state: present
- name: Add NSSM to PATH (system level)
ansible.windows.win_path:
name: Path
elements:
- "{{ nssm_install_dir }}\\nssm-{{ nssm_version }}\\win64"
state: present
become: true
become_method: ansible.builtin.runas
become_user: SYSTEM