Validate EXAMPLES as YAML

This commit is contained in:
Matt Martz
2017-02-07 15:39:24 -06:00
committed by Toshio Kuratomi
parent 499d3a1b53
commit 7c00346714
112 changed files with 441 additions and 381 deletions

View File

@@ -286,7 +286,7 @@ EXAMPLES = '''
- proxmox:
vmid: 100
api_user: root@pam
api_passwordL 1q2w3e
api_password: 1q2w3e
api_host: node1
force: yes
state: stopped

View File

@@ -217,8 +217,7 @@ vm:
EXAMPLES = '''
# basic get info from VM
action: rhevm
args:
- rhevm:
name: "demo"
user: "{{ rhev.admin.name }}"
password: "{{ rhev.admin.pass }}"
@@ -226,8 +225,7 @@ EXAMPLES = '''
state: "info"
# basic create example from image
action: rhevm
args:
- rhevm:
name: "demo"
user: "{{ rhev.admin.name }}"
password: "{{ rhev.admin.pass }}"
@@ -237,8 +235,7 @@ EXAMPLES = '''
cluster: "centos"
# power management
action: rhevm
args:
- rhevm:
name: "uptime_server"
user: "{{ rhev.admin.name }}"
password: "{{ rhev.admin.pass }}"
@@ -246,11 +243,10 @@ EXAMPLES = '''
cluster: "RH"
state: "down"
image: "centos7_x64"
cluster: "centos
cluster: "centos"
# multi disk, multi nic create example
action: rhevm
args:
- rhevm:
name: "server007"
user: "{{ rhev.admin.name }}"
password: "{{ rhev.admin.pass }}"
@@ -290,23 +286,21 @@ EXAMPLES = '''
- "hd"
# add a CD to the disk cd_drive
action: rhevm
args:
name: 'server007'
user: "{{ rhev.admin.name }}"
password: "{{ rhev.admin.pass }}"
state: 'cd'
cd_drive: 'rhev-tools-setup.iso'
- rhevm:
name: 'server007'
user: "{{ rhev.admin.name }}"
password: "{{ rhev.admin.pass }}"
state: 'cd'
cd_drive: 'rhev-tools-setup.iso'
# new host deployment + host network configuration
action: rhevm
args:
name: "ovirt_node007"
password: "{{ rhevm.admin.pass }}"
type: "host"
state: present
cluster: "rhevm01"
ifaces:
- rhevm:
name: "ovirt_node007"
password: "{{ rhevm.admin.pass }}"
type: "host"
state: present
cluster: "rhevm01"
ifaces:
- name: em1
- name: em2
- name: p3p1

View File

@@ -75,17 +75,18 @@ EXAMPLES = '''
state: running
# /usr/bin/ansible invocations
ansible host -m virt -a "name=alpha command=status"
ansible host -m virt -a "name=alpha command=get_xml"
ansible host -m virt -a "name=alpha command=create uri=lxc:///"
# ansible host -m virt -a "name=alpha command=status"
# ansible host -m virt -a "name=alpha command=get_xml"
# ansible host -m virt -a "name=alpha command=create uri=lxc:///"
---
# a playbook example of defining and launching an LXC guest
tasks:
- name: define vm
virt:
name: foo
command: define
xml: '{{ lookup('template', 'container-template.xml.j2') }}'
xml: "{{ lookup('template', 'container-template.xml.j2') }}"
uri: 'lxc:///'
- name: start vm
virt:

View File

@@ -34,10 +34,11 @@ options: {}
EXAMPLES = '''
- name: Gather facts from xenserver
xenserver:
xenserver:
- name: Print running VMs
debug: msg="{{ item }}"
debug:
msg: "{{ item }}"
with_items: "{{ xs_vms.keys() }}"
when: xs_vms[item]['power_state'] == "Running"