entercloudsuite.filesystem
Ansible 角色:文件系统
创建分区、文件系统并挂载
需求
此角色需要 Ansible 2.2 或更高版本。
角色变量
请参阅 https://github.com/AerisCloud/ansible-disk
文件系统剧本
使用默认变量运行:
- hosts: all
roles:
- role: entercloudsuite.filesystem
disk_additional_disks:
- disk: /dev/vdb
fstype: xfs
mount_options: defaults
mount: /example
disable_periodic_fsck: false
测试
测试使用 Molecule 进行。
- 运行
molecule create
在本地引擎上启动目标 Docker 容器。 - 使用
molecule login
登录运行中的容器。 - 编辑角色文件。
- 在 molecule/default/requirements.yml 文件中添加其他所需的外部角色。
- 编辑 molecule/default/playbook.yml 文件。
- 在 molecule/default/tests 文件夹下定义基础设施测试,使用 goos 验证器。
- 准备好后,使用
molecule converge
运行 Ansible 剧本,使用molecule verify
执行测试套件。
注意,converge 过程会开始执行角色的语法检查。
使用命令molecule destroy
销毁 Docker 容器。
要用一个命令运行所有步骤,可以执行 molecule test
。
许可证
MIT
安装
ansible-galaxy install entercloudsuite.filesystem
许可证
mit
下载
15.6k