!1 Package Init
Merge pull request !1 from Sindweller/openEuler1.0-base
This commit is contained in:
commit
381ab60ec5
72
README.en.md
72
README.en.md
@ -1,22 +1,62 @@
|
||||
# ovirt-ansible-image-template
|
||||
|
||||
#### Description
|
||||
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
|
||||
The ovirt.image-template role creates a template from external image. Currently the disk can be an image in Glance external provider or QCOW2 image.
|
||||
|
||||
#### Software Architecture
|
||||
Software architecture description
|
||||
#### Requirements
|
||||
|
||||
#### Installation
|
||||
* Ansible version 2.9 or higher.
|
||||
* Python SDK version 4.3 or higher.
|
||||
* oVirt has to be 4.1 or higher and ovirt-imageio must be installed and running.
|
||||
* CA certificate of oVirt engine. The path to CA certificate must be specified in the ovirt_ca variable.
|
||||
* File
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### Instructions
|
||||
#### Limitations
|
||||
We don not support Ansible Check Mode (Dry Run), because this role is using few modules(command module), which do not support it. Once all modules used by this role will support it, we will support it.
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
#### Role Variables
|
||||
|
||||
| Name | Default value | |
|
||||
|--------------------|-----------------------|----------------------------|
|
||||
| qcow_url | UNDEF (mandatory if glance is not used) | The URL of the QCOW2 image. |
|
||||
| qcow_url_client_cert | UNDEF | Path to client certificate if needed for retrieving QCOW from authenticated site. |
|
||||
| qcow_url_client_key | UNDEF | Path to client key if needed for retrieving QCOW from authenticated site. |
|
||||
| image_path | /tmp/ | Path where the QCOW2 image will be downloaded to. If directory the base name of the URL on the remote server will be used. |
|
||||
| image_checksum | UNDEF | If a checksum is defined, the digest of the destination file will be calculated after it is downloaded to ensure its integrity and verify that the transfer completed successfully. Format: <algorithm>:<checksum>, e.g. checksum="sha256:D98291AC[...]B6DC7B97". |
|
||||
| image_cache_download | true | When set to false will delete image_path at the start and end of execution |
|
||||
| template_cluster | Default | Name of the cluster where template must be created. |
|
||||
| template_io_threads| UNDEF | Number of IO threads used by template. 0 means IO threading disabled. (Added in ansible 2.7)|
|
||||
| template_name | mytemplate | Name of the template. |
|
||||
| template_memory | 2GiB | Amount of memory assigned to the template. |
|
||||
| template_memory_guaranteed | UNDEF | Amount of minimal guaranteed memory of the Virtual Machine |
|
||||
| template_memory_max | UNDEF | Upper bound of virtual machine memory up to which memory hot-plug can be performed. |
|
||||
| template_cpu | 1 | Number of CPUs assigned to the template. |
|
||||
| template_disk_storage | UNDEF | Name of the data storage domain where the disk must be created. If not specified, the data storage domain is selected automatically. |
|
||||
| template_disks | [] | List of dictionaries specifying the additional template disks. See below for more detailed description. |
|
||||
| template_disk_size | 10GiB | The size of the template disk. |
|
||||
| template_disk_name | UNDEF | The name of template disk. |
|
||||
| template_disk_format | UNDEF | Format of the template disk. |
|
||||
| template_disk_interface | virtio | Interface of the template disk. (Choices: virtio, ide, virtio_scsi) |
|
||||
| template_seal | true | 'Sealing' erases all machine-specific configurations from a filesystem. Not supported on Windows. Set this to 'false' for Windows. |
|
||||
| template_timeout | 600 | Amount of time to wait for the template to be created/imported. |
|
||||
| template_type | UNDEF | The type of the template: desktop, server or high_performance (for qcow2 based templates only) |
|
||||
| template_nics | {name: nic1, profile_name: ovirtmgmt, interface: virtio} | List of dictionaries that specify the NICs of template. |
|
||||
| template_operating_system | UNDEF | Operating system of the template like: other, rhel_7x64, debian_7, see others in ovirt_template module. |
|
||||
| glance_image_provider | UNDEF (mandatory if qcow_url is not used) | Name of the glance image provider. |
|
||||
| glance_image | UNDEF (mandatory if qcow_url is not used) | This parameter specifies the name of disk in glance provider to be imported as template. |
|
||||
| template_prerequisites_tasks | UNDEF | Works only with qcow image. Specify a path to Ansible tasks file, which should be executed on virtual machine before creating a template from it. Note that qcow image must contain guest agent which reports IP address. |
|
||||
|
||||
The `template_disks` List of dictionaries can contain following attributes:
|
||||
|
||||
| Name | Default value | |
|
||||
|--------------------|----------------|----------------------------------------------|
|
||||
| name | UNDEF (Required) | The name of the additional disk. |
|
||||
| size | UNDEF (Required) | The size of the additional disk. |
|
||||
| storage_domain | UNDEF | The name of storage domain where disk should be created. If no value is passed, value is set by <i>template_disk_storage</i>. |
|
||||
| interface | UNDEF | The interface of the disk. If no value is passed, value is set by <i>template_disk_interface</i>. |
|
||||
| format | UNDEF | Specify format of the disk. If no value is passed, value is set by <i>template_disk_format</i>. <ul><li>cow - If set, the disk will by created as sparse disk, so space will be allocated for the volume as needed. This format is also known as thin provisioned disks</li><li>raw - If set, disk space will be allocated right away. This format is also known as preallocated disks.</li></ul> |
|
||||
| bootable | UNDEF | True if the disk should be bootable. |
|
||||
|
||||
#### Contribution
|
||||
|
||||
@ -24,13 +64,3 @@ Software architecture description
|
||||
2. Create Feat_xxx branch
|
||||
3. Commit your code
|
||||
4. Create Pull Request
|
||||
|
||||
|
||||
#### Gitee Feature
|
||||
|
||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
|
||||
35
README.md
35
README.md
@ -1,25 +1,14 @@
|
||||
# ovirt-ansible-image-template
|
||||
|
||||
#### 介绍
|
||||
{**以下是码云平台说明,您可以替换此简介**
|
||||
码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
|
||||
无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
|
||||
Ansible的ovirt.image-template角色用于为外部镜像创建模板。目前磁盘可以是Glance提供的外部镜像,或者是QCOW2镜像。
|
||||
|
||||
#### 软件架构
|
||||
软件架构说明
|
||||
|
||||
|
||||
#### 安装教程
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
|
||||
#### 使用说明
|
||||
|
||||
1. xxxx
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
#### 依赖说明
|
||||
* Ansible 2.9或更高版本。
|
||||
* PythonSDK4.3或更高版本。
|
||||
* oVirt必须为4.1或更高版本,并且必须安装并运行oVirt imageio。
|
||||
* oVirt引擎的CA证书。必须在ovirt_CA变量中指定CA证书的路径。
|
||||
* 文件
|
||||
|
||||
#### 参与贡献
|
||||
|
||||
@ -27,13 +16,3 @@
|
||||
2. 新建 Feat_xxx 分支
|
||||
3. 提交代码
|
||||
4. 新建 Pull Request
|
||||
|
||||
|
||||
#### 码云特技
|
||||
|
||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
|
||||
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
|
||||
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
||||
|
||||
BIN
ovirt-ansible-image-template-1.1.12.tar.gz
Normal file
BIN
ovirt-ansible-image-template-1.1.12.tar.gz
Normal file
Binary file not shown.
64
ovirt-ansible-image-template.spec
Normal file
64
ovirt-ansible-image-template.spec
Normal file
@ -0,0 +1,64 @@
|
||||
%global rolename image-template
|
||||
%global roleprefix ovirt.
|
||||
%global roleprefix_legacy ovirt-
|
||||
%global roleprefix_legacy_uppercase oVirt.
|
||||
%global ansible_roles_dir ansible/roles
|
||||
|
||||
Name: ovirt-ansible-image-template
|
||||
Summary: Ansible role to create virtual machine template from disk image
|
||||
Version: 1.1.12
|
||||
Release: 1%{?release_suffix}%{?dist}
|
||||
Source0: http://resources.ovirt.org/pub/src/ovirt-ansible-image-template/ovirt-ansible-image-template-1.1.12.tar.gz
|
||||
License: ASL 2.0
|
||||
Group: Virtualization/Management
|
||||
BuildArch: noarch
|
||||
Url: http://www.ovirt.org
|
||||
|
||||
Requires: ansible >= 2.7.2
|
||||
|
||||
%description
|
||||
This Ansible role provide funtionality to create virtual machine template from disk
|
||||
image.
|
||||
|
||||
%pretrans -p <lua>
|
||||
-- Remove the legacy directory before installing the symlink. This is known issue in RPM:
|
||||
-- https://fedoraproject.org/wiki/Packaging:Directory_Replacement
|
||||
path_dash = "%{_datadir}/%{ansible_roles_dir}/%{roleprefix_legacy}%{rolename}"
|
||||
path_uppercase = "%{_datadir}/%{ansible_roles_dir}/%{roleprefix_legacy_uppercase}%{rolename}"
|
||||
|
||||
st = posix.stat(path_dash)
|
||||
if st and st.type == "directory" then
|
||||
os.execute('rm -rf "'..path_dash..'"')
|
||||
end
|
||||
|
||||
st = posix.stat(path_uppercase)
|
||||
if st and st.type == "directory" then
|
||||
os.execute('rm -rf "'..path_uppercase..'"')
|
||||
end
|
||||
|
||||
%prep
|
||||
%setup -c -q
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
export PKG_DATA_DIR_ORIG=%{_datadir}/%{ansible_roles_dir}/%{roleprefix}%{rolename}
|
||||
export PKG_DATA_DIR=%{buildroot}$PKG_DATA_DIR_ORIG
|
||||
export PKG_DOC_DIR=%{buildroot}%{_pkgdocdir}
|
||||
export ROLENAME_LEGACY=%{buildroot}%{_datadir}/%{ansible_roles_dir}/%{roleprefix_legacy}%{rolename}
|
||||
export ROLENAME_LEGACY_UPPERCASE=%{buildroot}%{_datadir}/%{ansible_roles_dir}/%{roleprefix_legacy_uppercase}%{rolename}
|
||||
sh build.sh install
|
||||
|
||||
%files
|
||||
%{_datadir}/%{ansible_roles_dir}/%{roleprefix}%{rolename}
|
||||
%{_datadir}/%{ansible_roles_dir}/%{roleprefix_legacy}%{rolename}
|
||||
%{_datadir}/%{ansible_roles_dir}/%{roleprefix_legacy_uppercase}%{rolename}
|
||||
|
||||
%doc README.md
|
||||
%doc examples/
|
||||
|
||||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
* Wed Mar 04 2020 Huihui Fu <huihui.fu@cs2c.com.cn> - 1.1.12-1
|
||||
- Package Initialization
|
||||
Loading…
x
Reference in New Issue
Block a user