Skip to content

Commit

Permalink
fix(remote-os-configure): Align command with recent Ansible playbooks…
Browse files Browse the repository at this point in the history
… dry_run support (reboot excluded at the playbook YAML)
  • Loading branch information
ZachiNachshon committed Aug 11, 2023
1 parent b2c9c63 commit 2a30664
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 75 deletions.
29 changes: 28 additions & 1 deletion provisioner_examples_plugin/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,9 @@ def _print_pre_run_instructions(self, printer: Printer, prompter: Prompter):

def _prerequisites(self, ctx: Context, checks: Checks) -> None:
if ctx.os_arch.is_linux():
checks.check_tool_fn("docker")

return
elif ctx.os_arch.is_darwin():
checks.check_tool_fn("docker")

return
elif ctx.os_arch.is_windows():
raise NotImplementedError("Windows is not supported")
else:
Expand Down
2 changes: 1 addition & 1 deletion provisioner_examples_plugin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ diagrams = "^0.22.0"
ruff = "^0.0.265"

# For debugging purposes when running "poetry run provisioner" from within the plugins folder
# provisioner = { path = "../../provisioner/provisioner", develop = true }
provisioner = { path = "../../provisioner/provisioner", develop = true }

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
29 changes: 28 additions & 1 deletion provisioner_installers_plugin/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion provisioner_installers_plugin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ diagrams = "^0.22.0"
ruff = "^0.0.265"

# For debugging purposes when running "poetry run provisioner" from within the plugins folder
# provisioner = { path = "../../provisioner/provisioner", develop = true }
provisioner = { path = "../../provisioner/provisioner", develop = true }

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
79 changes: 25 additions & 54 deletions provisioner_single_board_plugin/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ def _run_ansible_network_configure_playbook_with_progress_bar(
ansible_tags=[
"configure_rpi_network",
"define_static_ip",
"reboot" if not args.remote_opts.get_remote_context().is_dry_run() else "",
],
] + (["reboot"] if not args.remote_opts.get_remote_context().is_dry_run() else []),
),
desc_run="Running Ansible playbook (Configure Network)",
desc_end="Ansible playbook finished (Configure Network).",
Expand Down Expand Up @@ -230,11 +229,9 @@ def _bundle_network_information_from_tuple(

def _prerequisites(self, ctx: Context, checks: Checks) -> None:
if ctx.os_arch.is_linux():
checks.check_tool_fn("docker")

return
elif ctx.os_arch.is_darwin():
checks.check_tool_fn("docker")

return
elif ctx.os_arch.is_windows():
raise NotImplementedError("Windows is not supported")
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ def _run_ansible_configure_os_playbook_with_progress_bar(
ansible_vars=[f"host_name={ansible_host.host}"],
ansible_tags=[
"configure_remote_node",
"reboot" if not args.remote_opts.get_remote_context().is_dry_run() else "",
],
"reboot"
]
# ansible_tags=[
# "configure_remote_node",
# ] + (["reboot"] if not args.remote_opts.get_remote_context().is_dry_run() else []),
),
desc_run="Running Ansible playbook (Configure OS)",
desc_end="Ansible playbook finished (Configure OS).",
Expand Down Expand Up @@ -118,11 +121,9 @@ def _print_post_run_instructions(

def _prerequisites(self, ctx: Context, checks: Checks) -> None:
if ctx.os_arch.is_linux():
checks.check_tool_fn("docker")

return
elif ctx.os_arch.is_darwin():
checks.check_tool_fn("docker")

return
elif ctx.os_arch.is_windows():
raise NotImplementedError("Windows is not supported")
else:
Expand Down
2 changes: 1 addition & 1 deletion provisioner_single_board_plugin/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ diagrams = "^0.22.0"
ruff = "^0.0.265"

# For debugging purposes when running "poetry run provisioner" from within the plugins folder
# provisioner = { path = "../../provisioner/provisioner", develop = true }
provisioner = { path = "../../provisioner/provisioner", develop = true }

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down

0 comments on commit 2a30664

Please sign in to comment.