From fa6ca818ed31f98f9516dc05b45a555cc681c615 Mon Sep 17 00:00:00 2001 From: "Saha, Priyam" Date: Wed, 16 Sep 2026 10:56:02 +0530 Subject: [PATCH] fix(ansible): replace removed yaml callback and print onboard token Use ansible.builtin.default result_format=yaml so playbooks work after community.general 12 removed the yaml callback, and print the access token after login for reuse. Co-authored-by: Cursor --- ansible/console/local/README.md | 7 ++++--- ansible/console/local/ansible.cfg | 7 ++++++- ansible/console/local/playbooks/register_and_onboard.yml | 6 ++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ansible/console/local/README.md b/ansible/console/local/README.md index 54def43..f0624bd 100644 --- a/ansible/console/local/README.md +++ b/ansible/console/local/README.md @@ -184,9 +184,10 @@ ansible/console/local/ > they are part of the Galaxy collection artifact or internal dev tooling only. > **`ansible.cfg` in PACE** is minimal — it sets `host_key_checking = False` and -> `stdout_callback = yaml` only. It intentionally does **not** set -> `collections_path`, so Ansible resolves `netapp.console` from the Galaxy -> default (`~/.ansible/collections`) after `ansible-galaxy collection install`. +> YAML stdout via `ansible.builtin.default` (`result_format = yaml`). It +> intentionally does **not** set `collections_path`, so Ansible resolves +> `netapp.console` from the Galaxy default (`~/.ansible/collections`) after +> `ansible-galaxy collection install`. --- diff --git a/ansible/console/local/ansible.cfg b/ansible/console/local/ansible.cfg index 1899e99..a9cb293 100644 --- a/ansible/console/local/ansible.cfg +++ b/ansible/console/local/ansible.cfg @@ -8,5 +8,10 @@ # (~/.ansible/collections or the path set in ANSIBLE_COLLECTIONS_PATHS). #collections_path = . host_key_checking = False -stdout_callback = yaml +stdout_callback = default interpreter_python = auto_silent + +# YAML task results via ansible.builtin.default (ansible-core ≥ 2.13). +# Do not set stdout_callback=yaml — that loaded community.general.yaml, removed in 12.0.0. +[callback_default] +result_format = yaml diff --git a/ansible/console/local/playbooks/register_and_onboard.yml b/ansible/console/local/playbooks/register_and_onboard.yml index 3250db8..f724e34 100644 --- a/ansible/console/local/playbooks/register_and_onboard.yml +++ b/ansible/console/local/playbooks/register_and_onboard.yml @@ -149,6 +149,12 @@ - _ncl_access_token | length > 0 fail_msg: "Could not obtain an access token. Check credentials or supply NCL_ACCESS_TOKEN." + - name: "STEP 2 | Show access token" + ansible.builtin.debug: + msg: >- + ✅ Access token obtained. Set this in your environment to reuse it: + export NCL_ACCESS_TOKEN="{{ _ncl_access_token }}" + # ══════════════════════════════════════════════════════════════════════════ # STEP 3 — Ensure the target organisation exists # ══════════════════════════════════════════════════════════════════════════