Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ctf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@


ENV = {}
STATE = {"verbose": False}
for k, v in os.environ.items():
ENV[k] = v

Expand Down
3 changes: 2 additions & 1 deletion ctf/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typer import Typer
from typing_extensions import Annotated

from ctf import ENV, LOG
from ctf import ENV, LOG, STATE
from ctf.check import app as check_app
from ctf.deploy import app as deploy_app
from ctf.destroy import app as destroy_app
Expand Down Expand Up @@ -52,6 +52,7 @@ def global_options(
if verbose:
LOG.setLevel(logging.DEBUG)
LOG.handlers[0].setLevel(logging.DEBUG)
STATE["verbose"] = True

if location:
ENV["CTF_ROOT_DIR"] = location
Expand Down
4 changes: 3 additions & 1 deletion ctf/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import typer
from typing_extensions import Annotated

from ctf import ENV
from ctf import ENV, STATE
from ctf.destroy import destroy
from ctf.generate import generate
from ctf.logger import LOG
Expand Down Expand Up @@ -224,6 +224,8 @@ def deploy(

def run_ansible_playbook(remote: str, production: bool, track: str, path: str) -> None:
extra_args = []
if STATE["verbose"]:
extra_args.append("-vvv")
if remote:
extra_args += ["-e", f"ansible_incus_remote={remote}"]

Expand Down
2 changes: 1 addition & 1 deletion ctf/templates/new/common/inventory.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This YAML file defines all machines that Ansible needs to know about to run playbooks and configure machines.
all:
hosts:
# The following line defines how this machine will be refered to in ansible scripts.
# The following line defines how this machine will be referred to in ansible scripts.
{{ data.name }}:
# This one tells ansible that this host is reached using incus, and the name of the machine in incus is `{{ data.name }}`.
ansible_incus_host: {{ data.name }}
Expand Down