Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for the 1.0.0 release #42

Merged
merged 13 commits into from
Aug 18, 2020
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# python stuff
__pycache__/
*.py[cod]
*.py[cod]

# ansible-test stuff
/tests/output/

# antsibull-changelog stuff
/changelogs/.plugin-cache.yaml
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
===============================
Community.Libvirt Release Notes
===============================

.. contents:: Topics


v1.0.0
======

Major Changes
-------------

- added generic libvirt inventory plugin
- removed libvirt_lxc inventory script
10 changes: 10 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ancestor: null
releases:
1.0.0:
changes:
major_changes:
- added generic libvirt inventory plugin
- removed libvirt_lxc inventory script
fragments:
- 23-inventory.yml
release_date: '2020-08-18'
31 changes: 31 additions & 0 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Community.Libvirt
trivial_section_name: trivial
use_fqcn: true
4 changes: 0 additions & 4 deletions changelogs/fragments/23-inventory.yml

This file was deleted.

2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace: community
name: libvirt
version: 0.1.0
version: 1.0.0
readme: README.md
authors:
- Ansible (https://github.com/ansible)
Expand Down
2 changes: 2 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
requires_ansible: '>=2.9.10'
2 changes: 1 addition & 1 deletion plugins/connection/libvirt_lxc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

DOCUMENTATION = '''
author: Michael Scherer <[email protected]>
connection: libvirt_lxc
connection: community.libvirt.libvirt_lxc
short_description: Run tasks in lxc containers via libvirt
description:
- Run commands or put/fetch files to an existing lxc container using libvirt
Expand Down
17 changes: 7 additions & 10 deletions plugins/modules/virt.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}

DOCUMENTATION = '''
---
Expand Down Expand Up @@ -67,7 +64,7 @@

EXAMPLES = '''
# a playbook task line:
- virt:
- community.libvirt.virt:
name: alpha
state: running

Expand All @@ -78,37 +75,37 @@

# defining and launching an LXC guest
- name: define vm
virt:
community.libvirt.virt:
command: define
xml: "{{ lookup('template', 'container-template.xml.j2') }}"
uri: 'lxc:///'
- name: start vm
virt:
community.libvirt.virt:
name: foo
state: running
uri: 'lxc:///'

# setting autostart on a qemu VM (default uri)
- name: set autostart for a VM
virt:
community.libvirt.virt:
name: foo
autostart: yes

# Defining a VM and making is autostart with host. VM will be off after this task
- name: define vm from xml and set autostart
virt:
community.libvirt.virt:
command: define
xml: "{{ lookup('template', 'vm_template.xml.j2') }}"
autostart: yes

# Listing VMs
- name: list all VMs
virt:
community.libvirt.virt:
command: list_vms
register: all_vms

- name: list only running VMs
virt:
community.libvirt.virt:
command: list_vms
state: running
register: running_vms
Expand Down
31 changes: 13 additions & 18 deletions plugins/modules/virt_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
__metaclass__ = type


ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}


DOCUMENTATION = '''
---
module: virt_net
Expand Down Expand Up @@ -73,69 +68,69 @@

EXAMPLES = '''
# Define a new network
- virt_net:
- community.libvirt.virt_net:
command: define
name: br_nat
xml: '{{ lookup("template", "network/bridge.xml.j2") }}'

# Start a network
- virt_net:
- community.libvirt.virt_net:
command: create
name: br_nat

# List available networks
- virt_net:
- community.libvirt.virt_net:
command: list_nets

# Get XML data of a specified network
- virt_net:
- community.libvirt.virt_net:
command: get_xml
name: br_nat

# Stop a network
- virt_net:
- community.libvirt.virt_net:
command: destroy
name: br_nat

# Undefine a network
- virt_net:
- community.libvirt.virt_net:
command: undefine
name: br_nat

# Gather facts about networks
# Facts will be available as 'ansible_libvirt_networks'
- virt_net:
- community.libvirt.virt_net:
command: facts

# Gather information about network managed by 'libvirt' remotely using uri
- virt_net:
- community.libvirt.virt_net:
command: info
uri: '{{ item }}'
with_items: '{{ libvirt_uris }}'
register: networks

# Ensure that a network is active (needs to be defined and built first)
- virt_net:
- community.libvirt.virt_net:
state: active
name: br_nat

# Ensure that a network is inactive
- virt_net:
- community.libvirt.virt_net:
state: inactive
name: br_nat

# Ensure that a given network will be started at boot
- virt_net:
- community.libvirt.virt_net:
autostart: yes
name: br_nat

# Disable autostart for a given network
- virt_net:
- community.libvirt.virt_net:
autostart: no
name: br_nat

# Add a new host in the dhcp pool
- virt_net:
- community.libvirt.virt_net:
name: br_nat
command: modify
xml: "<host mac='FC:C2:33:00:6c:3c' name='my_vm' ip='192.168.122.30'/>"
Expand Down
33 changes: 14 additions & 19 deletions plugins/modules/virt_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
__metaclass__ = type


ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}


DOCUMENTATION = '''
---
module: virt_pool
Expand Down Expand Up @@ -79,74 +74,74 @@

EXAMPLES = '''
# Define a new storage pool
- virt_pool:
- community.libvirt.virt_pool:
command: define
name: vms
xml: '{{ lookup("template", "pool/dir.xml.j2") }}'

# Build a storage pool if it does not exist
- virt_pool:
- community.libvirt.virt_pool:
command: build
name: vms

# Start a storage pool
- virt_pool:
- community.libvirt.virt_pool:
command: create
name: vms

# List available pools
- virt_pool:
- community.libvirt.virt_pool:
command: list_pools

# Get XML data of a specified pool
- virt_pool:
- community.libvirt.virt_pool:
command: get_xml
name: vms

# Stop a storage pool
- virt_pool:
- community.libvirt.virt_pool:
command: destroy
name: vms

# Delete a storage pool (destroys contents)
- virt_pool:
- community.libvirt.virt_pool:
command: delete
name: vms

# Undefine a storage pool
- virt_pool:
- community.libvirt.virt_pool:
command: undefine
name: vms

# Gather facts about storage pools
# Facts will be available as 'ansible_libvirt_pools'
- virt_pool:
- community.libvirt.virt_pool:
command: facts

# Gather information about pools managed by 'libvirt' remotely using uri
- virt_pool:
- community.libvirt.virt_pool:
command: info
uri: '{{ item }}'
with_items: '{{ libvirt_uris }}'
register: storage_pools

# Ensure that a pool is active (needs to be defined and built first)
- virt_pool:
- community.libvirt.virt_pool:
state: active
name: vms

# Ensure that a pool is inactive
- virt_pool:
- community.libvirt.virt_pool:
state: inactive
name: vms

# Ensure that a given pool will be started at boot
- virt_pool:
- community.libvirt.virt_pool:
autostart: yes
name: vms

# Disable autostart for a given pool
- virt_pool:
- community.libvirt.virt_pool:
autostart: no
name: vms
'''
Expand Down
6 changes: 3 additions & 3 deletions shippable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ matrix:

# - env: T=aix/7.2/1
# - env: T=osx/10.11/1
- env: T=rhel/7.6/1
- env: T=rhel/8.1/1
- env: T=rhel/7.8/1
- env: T=rhel/8.2/1
- env: T=freebsd/11.1/1
- env: T=freebsd/12.1/1
- env: T=linux/centos6/1
- env: T=linux/centos7/1
- env: T=linux/centos8/1
- env: T=linux/fedora30/1
- env: T=linux/fedora31/1
- env: T=linux/fedora32/1
- env: T=linux/opensuse15py2/1
- env: T=linux/opensuse15/1
- env: T=linux/ubuntu1604/1
Expand Down
9 changes: 0 additions & 9 deletions tests/sanity/ignore-2.10.txt

This file was deleted.

1 change: 1 addition & 0 deletions tests/sanity/ignore-2.10.txt
1 change: 1 addition & 0 deletions tests/sanity/ignore-2.11.txt
9 changes: 9 additions & 0 deletions tests/sanity/ignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tests/unit/mock/path.py future-import-boilerplate
tests/unit/mock/path.py metaclass-boilerplate
tests/unit/mock/yaml_helper.py future-import-boilerplate
tests/unit/mock/yaml_helper.py metaclass-boilerplate
tests/unit/modules/cloud/misc/virt_net/conftest.py future-import-boilerplate
tests/unit/modules/cloud/misc/virt_net/conftest.py metaclass-boilerplate
tests/unit/modules/cloud/misc/virt_net/test_virt_net.py future-import-boilerplate
tests/unit/modules/cloud/misc/virt_net/test_virt_net.py metaclass-boilerplate
tests/utils/shippable/timing.py shebang
Loading