diff --git a/README.en.md b/README.en.md index 22c76ac..6ff51d3 100644 --- a/README.en.md +++ b/README.en.md @@ -1,22 +1,28 @@ -# ovirt-ansible-vm-infra +# oVirt Virtual Machine Infrastructure #### 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.vm-infra role manages the virtual machine infrastructure in oVirt. This role also creates inventory of created virtual machines it defines if wait_for_ip is set to true and state of virtual machine is running. All defined virtual machines are part of ovirt_vm inventory group. Role also creates ovirt_tag_{tag_name} groups if there are any tags assigned to a virtual machine and places all virtual machines with that tag to that inventory group. -#### Software Architecture -Software architecture description +Consider the following variable structure: -#### Installation +```yaml +vms: + - name: myvm1 + tag: mytag1 + profile: myprofile -1. xxxx -2. xxxx -3. xxxx + - name: myvm2 + tag: mytag2 + profile: myprofile +``` -#### Instructions +The role will create inventory group ovirt_vm with both of the virtual machines - myvm1 and myvm2. The role also creates inventory group ovirt_tag_mytag1 with virtual machine myvm1 and inventory group ovirt_tag_mytag2 with virtual machine myvm2. -1. xxxx -2. xxxx -3. xxxx +#### Requirements + +* Ansible version 2.9 or higher +* Python SDK version 4.3 or higher +* python3-jmespath or python2-jmespath #### Contribution @@ -24,13 +30,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/) diff --git a/README.md b/README.md index 1526a07..c949f4d 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,28 @@ -# ovirt-ansible-vm-infra +# oVirt Virtual Machine Infrastructure #### 介绍 -{**以下是码云平台说明,您可以替换此简介** -码云是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用码云实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +ovirt.vm-infra角色管理oVirt中的虚拟机基础架构。此角色还创建了创建虚拟机的清单,它定义了是否将wait_for_ip设置为true以及虚拟机正在运行的状态。所有定义的虚拟机都是ovirt_vm清单组的一部分。如果有分配给虚拟机的任何标签,角色还将创建ovirt_tag_{tag_name}组,并将带有该标签的所有虚拟机放置到该清单组。 -#### 软件架构 -软件架构说明 +考虑以下变量结构: +```yaml +vms: + - name: myvm1 + tag: mytag1 + profile: myprofile -#### 安装教程 + - name: myvm2 + tag: mytag2 + profile: myprofile +``` -1. xxxx -2. xxxx -3. xxxx +该角色将使用两个虚拟机myvm1和myvm2创建清单组ovirt_vm。该角色还将创建具有虚拟机myvm1的清单组ovirt_tag_mytag1和具有虚拟机myvm2的清单组ovirt_tag_mytag2。 -#### 使用说明 +#### 依赖说明 -1. xxxx -2. xxxx -3. xxxx +* Ansible 2.9或更高版本 +* Python SDK版本4.3或更高版本 +* python3-jmespath或python2-jmespath #### 参与贡献 @@ -27,13 +30,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/) diff --git a/ovirt-ansible-vm-infra-1.1.22.tar.gz b/ovirt-ansible-vm-infra-1.1.22.tar.gz new file mode 100644 index 0000000..c30f06b Binary files /dev/null and b/ovirt-ansible-vm-infra-1.1.22.tar.gz differ diff --git a/ovirt-ansible-vm-infra.spec b/ovirt-ansible-vm-infra.spec new file mode 100644 index 0000000..1cbdfcc --- /dev/null +++ b/ovirt-ansible-vm-infra.spec @@ -0,0 +1,63 @@ +%global rolename vm-infra +%global roleprefix ovirt. +%global roleprefix_legacy ovirt- +%global roleprefix_legacy_uppercase oVirt. +%global ansible_roles_dir ansible/roles + +Name: ovirt-ansible-vm-infra +Summary: Ansible role to create virtual machine infrastructure +Version: 1.1.22 +Release: 1%{?release_suffix}%{?dist} +Source0: http://resources.ovirt.org/pub/src/ovirt-ansible-vm-infra/ovirt-ansible-vm-infra-1.1.22.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 infrastructure. + +%pretrans -p +-- 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 +* Tue Mar 3 2020 changjie.fu - 1.1.22-1 +- Package Initialization