问题描述
另一个代码,我希望你们会觉得有用
Centos ansible 安装
yum install ansible -y
设置主机和凭据
[ansible_client]
proxmoxip ansible_ssh_user= root ansible_ssh_pass= password ansible_ssh_port=8888
确保将其粘贴到您的 ansible.cfg 文件中
[defaults]
host_key_checking = false
克隆虚拟机模板并创建虚拟机
---
- name: sample proxmox book
hosts: ansible_client
remote_user: root
become: true
tasks:
- proxmox_kvm:
node : Proxmox-VE
api_user : root@pam
api_password: 'passsword'
api_host : Proxmox-VE
clone : IntelliDB
name : zavala
xmox-VE
vmid : 100
timeout : 500
启动/停止/重启虚拟机
---
- name: sample proxmox book
hosts: ansible_client
remote_user: root
become: true
tasks:
- proxmox_kvm:
node : Proxmox-VE
api_user : root@pam
api_password: 'password'
api_host : Proxmox-VE
name : zavala
state : stopped/started/restarted
修改内存和处理器
---
- name: sample proxmox book
hosts: ansible_client
remote_user: root
become: true
tasks:
- proxmox_kvm:
api_user : root@pam
api_password: 'password'
api_host : Proxmox-VE
name : zavala
node : Proxmox-VE
cores : 4
memory : 2048
update : yes
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)