You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ctf/templates/new/common/inventory.j2
+18-1Lines changed: 18 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,15 @@
1
1
# This YAML file defines all machines that Ansible needs to know about to run playbooks and configure machines.
2
2
all:
3
-
hosts:
3
+
hosts:{%ifnotdata.is_windows%}
4
4
# The following line defines how this machine will be referred to in Ansible scripts.
5
5
{{ data.name }}:
6
6
# This one tells Ansible that this host is reached using incus, and the name of the machine in incus is `{{ data.name }}`.
7
7
ansible_incus_host: {{ data.name }}
8
+
{%else%}
9
+
# If you also need Linux containers, add them here.
10
+
# linux-incus-container:
11
+
# ansible_incus_host: linux-incus-container
12
+
{%endif%}
8
13
# You can set variables here to use in your Ansible playbooks. For example, you can set the flags here to set them dynamically when setting up the challenge.
9
14
vars:
10
15
# Do not change these.
@@ -24,4 +29,16 @@ build:
24
29
build-container:
25
30
# The name must be the same as the previous line.
26
31
ansible_incus_host: build-container
32
+
{%endif%}{%ifdata.is_windows%}
33
+
# This section is needed if you need Windows virtual machines. It's a group of hosts regrouped under the name "windows" which MUST remain the same.
34
+
# The group "windows" is removed from the "cleanup.yaml" and "common.yaml", which is why you should not change it.
35
+
windows:
36
+
hosts:
37
+
# The following line defines how this machine will be referred to in Ansible scripts.
38
+
{{ data.name }}:
39
+
# This one tells Ansible that this host is reached using incus, and the name of the machine in incus is `{{ data.name }}`.
40
+
ansible_incus_host: {{ data.name }}
41
+
vars:
42
+
# This variable is used to tell Ansible that the hosts are Windows hosts and require a PowerShell shell.
type = {%ifdata.is_windows%}"virtual-machine"{%else%}"container"{%endif%}
90
+
91
+
image = {%ifdata.is_windows%}"CHANGE_ME" # Change to the Windows image location. Refer to the ctf-script README to know how to create an image in Incus.{%else%}"images:ubuntu/24.04"{%endif%}
0 commit comments