Fix Ansible documentation in part of example formatting. Part 1 (#332)

* Fix Ansible documentation in part of example formatting

* Fix
This commit is contained in:
Andrew Klychkov 2020-05-15 13:13:45 +03:00 committed by GitHub
commit 328319b926
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 762 additions and 705 deletions

View file

@ -362,171 +362,174 @@ requirements: [ "proxmoxer", "requests" ]
'''
EXAMPLES = '''
# Create new VM with minimal options
- proxmox_kvm:
api_user : root@pam
- name: Create new VM with minimal options
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
api_host: helldorado
name: spynal
node: sabrewulf
# Create new VM with minimal options and given vmid
- proxmox_kvm:
api_user : root@pam
- name: Create new VM with minimal options and given vmid
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
vmid : 100
api_host: helldorado
name: spynal
node: sabrewulf
vmid: 100
# Create new VM with two network interface options.
- proxmox_kvm:
api_user : root@pam
- name: Create new VM with two network interface options
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
net : '{"net0":"virtio,bridge=vmbr1,rate=200", "net1":"e1000,bridge=vmbr2,"}'
api_host: helldorado
name: spynal
node: sabrewulf
net: '{"net0":"virtio,bridge=vmbr1,rate=200", "net1":"e1000,bridge=vmbr2,"}'
# Create new VM with one network interface, three virto hard disk, 4 cores, and 2 vcpus.
- proxmox_kvm:
api_user : root@pam
- name: Create new VM with one network interface, three virto hard disk, 4 cores, and 2 vcpus
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
net : '{"net0":"virtio,bridge=vmbr1,rate=200"}'
virtio : '{"virtio0":"VMs_LVM:10", "virtio1":"VMs:2,format=qcow2", "virtio2":"VMs:5,format=raw"}'
cores : 4
vcpus : 2
api_host: helldorado
name: spynal
node: sabrewulf
net: '{"net0":"virtio,bridge=vmbr1,rate=200"}'
virtio: '{"virtio0":"VMs_LVM:10", "virtio1":"VMs:2,format=qcow2", "virtio2":"VMs:5,format=raw"}'
cores: 4
vcpus: 2
# Clone VM with only source VM name
- proxmox_kvm:
api_user : root@pam
- name: >
Clone VM with only source VM name.
The VM source is spynal.
The target VM name is zavala
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
clone : spynal # The VM source
name : zavala # The target VM name
node : sabrewulf
storage : VMs
format : qcow2
timeout : 500 # Note: The task can take a while. Adapt
api_host: helldorado
clone: spynal
name: zavala
node: sabrewulf
storage: VMs
format: qcow2
timeout: 500
# Clone VM with source vmid and target newid and raw format
- proxmox_kvm:
api_user : root@pam
- name: Clone VM with source vmid and target newid and raw format
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
clone : arbitrary_name
vmid : 108
newid : 152
name : zavala # The target VM name
node : sabrewulf
storage : LVM_STO
format : raw
timeout : 300 # Note: The task can take a while. Adapt
api_host: helldorado
clone: arbitrary_name
vmid: 108
newid: 152
name: zavala
node: sabrewulf
storage: LVM_STO
format: raw
timeout: 300
# Create new VM and lock it for snapashot.
- proxmox_kvm:
api_user : root@pam
- name: Create new VM and lock it for snapashot
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
lock : snapshot
api_host: helldorado
name: spynal
node: sabrewulf
lock: snapshot
# Create new VM and set protection to disable the remove VM and remove disk operations
- proxmox_kvm:
api_user : root@pam
- name: Create new VM and set protection to disable the remove VM and remove disk operations
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
protection : yes
api_host: helldorado
name: spynal
node: sabrewulf
protection: yes
# Start VM
- proxmox_kvm:
api_user : root@pam
- name: Start VM
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
state : started
api_host: helldorado
name: spynal
node: sabrewulf
state: started
# Stop VM
- proxmox_kvm:
api_user : root@pam
- name: Stop VM
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
state : stopped
api_host: helldorado
name: spynal
node: sabrewulf
state: stopped
# Stop VM with force
- proxmox_kvm:
api_user : root@pam
- name: Stop VM with force
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
state : stopped
force : yes
api_host: helldorado
name: spynal
node: sabrewulf
state: stopped
force: yes
# Restart VM
- proxmox_kvm:
api_user : root@pam
- name: Restart VM
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
state : restarted
api_host: helldorado
name: spynal
node: sabrewulf
state: restarted
# Remove VM
- proxmox_kvm:
api_user : root@pam
- name: Remove VM
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
state : absent
api_host: helldorado
name: spynal
node: sabrewulf
state: absent
# Get VM current state
- proxmox_kvm:
api_user : root@pam
- name: Get VM current state
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
state : current
api_host: helldorado
name: spynal
node: sabrewulf
state: current
# Update VM configuration
- proxmox_kvm:
api_user : root@pam
- name: Update VM configuration
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
cores : 8
memory : 16384
update : yes
api_host: helldorado
name: spynal
node: sabrewulf
cores: 8
memory: 16384
update: yes
# Delete QEMU parameters
- proxmox_kvm:
api_user : root@pam
- name: Delete QEMU parameters
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
delete : 'args,template,cpulimit'
api_host: helldorado
name: spynal
node: sabrewulf
delete: 'args,template,cpulimit'
# Revert a pending change
- proxmox_kvm:
api_user : root@pam
- name: Revert a pending change
proxmox_kvm:
api_user: root@pam
api_password: secret
api_host : helldorado
name : spynal
node : sabrewulf
revert : 'template,cpulimit'
api_host: helldorado
name: spynal
node: sabrewulf
revert: 'template,cpulimit'
'''
RETURN = '''

View file

@ -76,23 +76,25 @@ author: Sergei Antipov (@UnderGreen)
'''
EXAMPLES = '''
# Upload new openvz template with minimal options
- proxmox_template:
- name: Upload new openvz template with minimal options
proxmox_template:
node: uk-mc02
api_user: root@pam
api_password: 1q2w3e
api_host: node1
src: ~/ubuntu-14.04-x86_64.tar.gz
# Upload new openvz template with minimal options use environment PROXMOX_PASSWORD variable(you should export it before)
- proxmox_template:
- name: >
Upload new openvz template with minimal options use environment
PROXMOX_PASSWORD variable(you should export it before)
proxmox_template:
node: uk-mc02
api_user: root@pam
api_host: node1
src: ~/ubuntu-14.04-x86_64.tar.gz
# Upload new openvz template with all options and force overwrite
- proxmox_template:
- name: Upload new openvz template with all options and force overwrite
proxmox_template:
node: uk-mc02
api_user: root@pam
api_password: 1q2w3e
@ -102,8 +104,8 @@ EXAMPLES = '''
src: ~/ubuntu-14.04-x86_64.tar.gz
force: yes
# Delete template with minimal options
- proxmox_template:
- name: Delete template with minimal options
proxmox_template:
node: uk-mc02
api_user: root@pam
api_password: 1q2w3e

View file

@ -102,13 +102,13 @@ author: "Ryan Scott Brown (@ryansb)"
'''
EXAMPLES = """
# Basic deploy of a service
- terraform:
- name: Basic deploy of a service
terraform:
project_path: '{{ project_dir }}'
state: present
# Define the backend configuration at init
- terraform:
- name: Define the backend configuration at init
terraform:
project_path: 'project/'
state: "{{ state }}"
force_init: true