maas批量执行命令我的maas是英文界面的
To execute commands in bulk in MAAS, you can use the command-line tool called "maas-cli". Here are the steps:
-
Open a terminal on your MAAS server or client machine.
-
Install the "maas-cli" tool by running the command: "sudo apt-get install maas-cli"
-
Authenticate to your MAAS server by running the command: "maas login
http://<maas_ip>/MAAS/api/2.0/ " and replace , <maas_ip>, and with your MAAS credentials. -
Create a file containing the commands you want to execute in bulk. For example, you can create a file called "commands.txt" with the following contents:
hostnamectl set-hostname node1 apt-get update apt-get install nginx
-
Run the following command to execute the commands in the file on all machines in your MAAS environment: "maas admin node-group-apply-commands
< commands.txt". Replace "admin" with your MAAS username, with the name of the node group you want to target, and "commands.txt" with the name of your command file.
Note: You can also execute commands on individual machines by replacing "node-group-apply-commands" with "machine deploy" and specifying the machine's system ID instead of the node group name.
原文地址: https://www.cveoy.top/t/topic/6VL 著作权归作者所有。请勿转载和采集!