docs(tutorials): run commands on multiple nodes

This commit is contained in:
Khue Doan 2022-02-19 10:52:07 +07:00
parent 71e0828297
commit 3b107c28fa
2 changed files with 23 additions and 0 deletions

View File

@ -13,6 +13,7 @@
- [Tutorials]()
- [Single node cluster adjustments](./tutorials/single_node_cluster_adjustments.md)
- [Add or remove nodes (scale up or down)](./tutorials/add-or-remove-nodes.md)
- [Run commands on multiple nodes](./tutorials/run-commands-on-multiple-nodes.md)
- [Install new applications]()
- [Reference](./reference/README.md)
- [Architecture](./reference/architecture.md)

View File

@ -0,0 +1,22 @@
# Run commands on multiple nodes
Use [ansible-console](https://docs.ansible.com/ansible/latest/cli/ansible-console.html):
```
ansible-console -i metal/inventories/prod.yml -u root
```
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 >>
10:52:02 up 2 min, 1 user, load average: 0.14, 0.11, 0.04
metal3 | CHANGED | rc=0 >>
10:52:02 up 2 min, 1 user, load average: 0.03, 0.02, 0.00
metal2 | CHANGED | rc=0 >>
10:52:02 up 2 min, 1 user, load average: 0.06, 0.06, 0.02
```