30 lines
722 B
YAML
30 lines
722 B
YAML
---
|
|
- name: Build runtime target from survey vars
|
|
hosts: localhost
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
- name: Fail early if required vars missing
|
|
ansible.builtin.assert:
|
|
that:
|
|
- vm_ip is defined
|
|
fail_msg: "You must provide vm_ip (via Semaphore survey / extra vars)."
|
|
|
|
- name: Add the chosen VM as an in-memory inventory host
|
|
ansible.builtin.add_host:
|
|
name: target_vm
|
|
groups: runtime
|
|
ansible_host: "{{ vm_ip }}"
|
|
|
|
- name: Show what we will target
|
|
ansible.builtin.debug:
|
|
msg: "Targeting VM at {{ vm_ip }}"
|
|
|
|
- name: Install Docker on chosen VM
|
|
hosts: runtime
|
|
become: true
|
|
gather_facts: true
|
|
|
|
tasks:
|
|
# ... your docker tasks ...
|