加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ansible创建分区 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
旗. 提交于 2021-09-18 01:23 . add ansible创建分区.
---
- hosts: test05
tasks:
- block:
- parted:
device: /dev/vdc
number: 1
part_end: "1500MiB"
state: present
rescue:
- debug:
msg: "insufficient free space"
- parted:
device: /dev/vdc
number: 1
part_end: "800MiB"
state: present
always:
- filesystem:
fstype: ext4
dev: /dev/vdc1
- file:
path: /newmnt
state: directory
- mount:
path: /newmnt
src: /dev/vdc1
fstype: ext4
state: present
- hosts: test05
tasks:
- debug:
msg: "VG not found"
when: "'vdd' not in ansible_devices"
failed_when: "'vdd' not in ansible_devices"
- block:
- parted:
device: /dev/vdd
number: 1
part_end: "1500Mib"
state: present
rescue:
- debug:
msg: "insufficient free space"
- parted:
device: /dev/vdd
number: 1
part_end: "800MiB"
state: present
always:
- filesystem:
fstype: ext4
dev: /dev/vdd1
- file:
path: /newmnt
state: directory
- mount:
path: /newmnt
src: /dev/vdd1
fstype: ext4
state: present
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化