From b309373e065bf7442c8ce071feeea352cb873fd9 Mon Sep 17 00:00:00 2001 From: "Jesse Pretorius (odyssey4me)" Date: Tue, 18 Aug 2020 16:04:08 +0100 Subject: [PATCH] Use collection namespace in examples --- plugins/connection/libvirt_lxc.py | 2 +- plugins/modules/virt.py | 14 +++++++------- plugins/modules/virt_net.py | 26 +++++++++++++------------- plugins/modules/virt_pool.py | 28 ++++++++++++++-------------- 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/plugins/connection/libvirt_lxc.py b/plugins/connection/libvirt_lxc.py index 4f80299..947be7b 100644 --- a/plugins/connection/libvirt_lxc.py +++ b/plugins/connection/libvirt_lxc.py @@ -10,7 +10,7 @@ DOCUMENTATION = ''' author: Michael Scherer - 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 diff --git a/plugins/modules/virt.py b/plugins/modules/virt.py index 550304e..deb03a4 100644 --- a/plugins/modules/virt.py +++ b/plugins/modules/virt.py @@ -64,7 +64,7 @@ EXAMPLES = ''' # a playbook task line: -- virt: +- community.libvirt.virt: name: alpha state: running @@ -75,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 diff --git a/plugins/modules/virt_net.py b/plugins/modules/virt_net.py index d62eb5a..3101988 100644 --- a/plugins/modules/virt_net.py +++ b/plugins/modules/virt_net.py @@ -68,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: "" diff --git a/plugins/modules/virt_pool.py b/plugins/modules/virt_pool.py index 5fdd419..ce8da46 100644 --- a/plugins/modules/virt_pool.py +++ b/plugins/modules/virt_pool.py @@ -74,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 '''