From 5952b3d20874f2e4c40910f4b5cd85c75a12adea Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Fri, 25 Feb 2022 01:38:53 +0700 Subject: [PATCH] build(metal): add target for ansible-console --- docs/src/tutorials/run-commands-on-multiple-nodes.md | 10 +++++----- metal/Makefile | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/src/tutorials/run-commands-on-multiple-nodes.md b/docs/src/tutorials/run-commands-on-multiple-nodes.md index 7e72b942..72e5c659 100644 --- a/docs/src/tutorials/run-commands-on-multiple-nodes.md +++ b/docs/src/tutorials/run-commands-on-multiple-nodes.md @@ -2,15 +2,15 @@ Use [ansible-console](https://docs.ansible.com/ansible/latest/cli/ansible-console.html): -``` -ansible-console -i metal/inventories/prod.yml -u root +```sh +cd metal +make console ``` -For example: - -`root@all (4)[f:5]$ uptime` +Then enter the command(s) you want to run, for example: ``` +root@all (4)[f:5]$ uptime metal0 | CHANGED | rc=0 >> 10:52:02 up 2 min, 1 user, load average: 0.17, 0.15, 0.06 metal1 | CHANGED | rc=0 >> diff --git a/metal/Makefile b/metal/Makefile index 843bfbe3..9ab38ea4 100644 --- a/metal/Makefile +++ b/metal/Makefile @@ -17,5 +17,9 @@ cluster: --inventory inventories/${env}.yml \ cluster.yml +console: + ansible-console \ + --inventory inventories/${env}.yml + vagrant: vagrant up