Fix Ansible documentation in part of example formatting. Part 1 (#332)
* Fix Ansible documentation in part of example formatting * Fixpull/342/head
parent
983d937b7b
commit
328319b926
|
@ -57,8 +57,8 @@ options:
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
|
||||||
# Install the etcd system container
|
- name: Install the etcd system container
|
||||||
- atomic_container:
|
atomic_container:
|
||||||
name: etcd
|
name: etcd
|
||||||
image: rhel/etcd
|
image: rhel/etcd
|
||||||
backend: ostree
|
backend: ostree
|
||||||
|
@ -67,8 +67,8 @@ EXAMPLES = '''
|
||||||
values:
|
values:
|
||||||
- ETCD_NAME=etcd.server
|
- ETCD_NAME=etcd.server
|
||||||
|
|
||||||
# Uninstall the etcd system container
|
- name: Uninstall the etcd system container
|
||||||
- atomic_container:
|
atomic_container:
|
||||||
name: etcd
|
name: etcd
|
||||||
image: rhel/etcd
|
image: rhel/etcd
|
||||||
backend: ostree
|
backend: ostree
|
||||||
|
|
|
@ -110,17 +110,17 @@ EXAMPLES = '''
|
||||||
# If a key matches this name, will return the ssh key id and changed = False
|
# If a key matches this name, will return the ssh key id and changed = False
|
||||||
# If no existing key matches this name, a new key is created, the ssh key id is returned and changed = False
|
# If no existing key matches this name, a new key is created, the ssh key id is returned and changed = False
|
||||||
|
|
||||||
- digital_ocean:
|
- name: Ensure a SSH key is present
|
||||||
|
digital_ocean:
|
||||||
state: present
|
state: present
|
||||||
command: ssh
|
command: ssh
|
||||||
name: my_ssh_key
|
name: my_ssh_key
|
||||||
ssh_pub_key: 'ssh-rsa AAAA...'
|
ssh_pub_key: 'ssh-rsa AAAA...'
|
||||||
api_token: XXX
|
api_token: XXX
|
||||||
|
|
||||||
# Create a new Droplet
|
|
||||||
# Will return the droplet details including the droplet id (used for idempotence)
|
# Will return the droplet details including the droplet id (used for idempotence)
|
||||||
|
- name: Create a new Droplet
|
||||||
- digital_ocean:
|
digital_ocean:
|
||||||
state: present
|
state: present
|
||||||
command: droplet
|
command: droplet
|
||||||
name: mydroplet
|
name: mydroplet
|
||||||
|
@ -141,7 +141,8 @@ EXAMPLES = '''
|
||||||
# If droplet id already exist, will return the droplet details and changed = False
|
# If droplet id already exist, will return the droplet details and changed = False
|
||||||
# If no droplet matches the id, a new droplet will be created and the droplet details (including the new id) are returned, changed = True.
|
# If no droplet matches the id, a new droplet will be created and the droplet details (including the new id) are returned, changed = True.
|
||||||
|
|
||||||
- digital_ocean:
|
- name: Ensure a droplet is present
|
||||||
|
digital_ocean:
|
||||||
state: present
|
state: present
|
||||||
command: droplet
|
command: droplet
|
||||||
id: 123
|
id: 123
|
||||||
|
@ -157,7 +158,8 @@ EXAMPLES = '''
|
||||||
# Several keys can be added to ssh_key_ids as id1,id2,id3
|
# Several keys can be added to ssh_key_ids as id1,id2,id3
|
||||||
# The keys are used to connect as root to the droplet.
|
# The keys are used to connect as root to the droplet.
|
||||||
|
|
||||||
- digital_ocean:
|
- name: Create a droplet with ssh key
|
||||||
|
digital_ocean:
|
||||||
state: present
|
state: present
|
||||||
ssh_key_ids: 123,456
|
ssh_key_ids: 123,456
|
||||||
name: mydroplet
|
name: mydroplet
|
||||||
|
@ -165,7 +167,6 @@ EXAMPLES = '''
|
||||||
size_id: 2gb
|
size_id: 2gb
|
||||||
region_id: ams2
|
region_id: ams2
|
||||||
image_id: fedora-19-x64
|
image_id: fedora-19-x64
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -58,31 +58,34 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create new Block Storage
|
- name: Create new Block Storage
|
||||||
- digital_ocean_block_storage:
|
digital_ocean_block_storage:
|
||||||
state: present
|
state: present
|
||||||
command: create
|
command: create
|
||||||
api_token: <TOKEN>
|
api_token: <TOKEN>
|
||||||
region: nyc1
|
region: nyc1
|
||||||
block_size: 10
|
block_size: 10
|
||||||
volume_name: nyc1-block-storage
|
volume_name: nyc1-block-storage
|
||||||
# Delete Block Storage
|
|
||||||
- digital_ocean_block_storage:
|
- name: Delete Block Storage
|
||||||
|
digital_ocean_block_storage:
|
||||||
state: absent
|
state: absent
|
||||||
command: create
|
command: create
|
||||||
api_token: <TOKEN>
|
api_token: <TOKEN>
|
||||||
region: nyc1
|
region: nyc1
|
||||||
volume_name: nyc1-block-storage
|
volume_name: nyc1-block-storage
|
||||||
# Attach Block Storage to a Droplet
|
|
||||||
- digital_ocean_block_storage:
|
- name: Attach Block Storage to a Droplet
|
||||||
|
digital_ocean_block_storage:
|
||||||
state: present
|
state: present
|
||||||
command: attach
|
command: attach
|
||||||
api_token: <TOKEN>
|
api_token: <TOKEN>
|
||||||
volume_name: nyc1-block-storage
|
volume_name: nyc1-block-storage
|
||||||
region: nyc1
|
region: nyc1
|
||||||
droplet_id: <ID>
|
droplet_id: <ID>
|
||||||
# Detach Block Storage from a Droplet
|
|
||||||
- digital_ocean_block_storage:
|
- name: Detach Block Storage from a Droplet
|
||||||
|
digital_ocean_block_storage:
|
||||||
state: absent
|
state: absent
|
||||||
command: attach
|
command: attach
|
||||||
api_token: <TOKEN>
|
api_token: <TOKEN>
|
||||||
|
|
|
@ -45,26 +45,24 @@ requirements:
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create a domain
|
- name: Create a domain
|
||||||
|
digital_ocean_domain:
|
||||||
- digital_ocean_domain:
|
|
||||||
state: present
|
state: present
|
||||||
name: my.digitalocean.domain
|
name: my.digitalocean.domain
|
||||||
ip: 127.0.0.1
|
ip: 127.0.0.1
|
||||||
|
|
||||||
# Create a droplet and a corresponding domain
|
# Create a droplet and corresponding domain
|
||||||
|
- name: Create a droplet
|
||||||
- digital_ocean:
|
digital_ocean:
|
||||||
state: present
|
state: present
|
||||||
name: test_droplet
|
name: test_droplet
|
||||||
size_id: 1gb
|
size_id: 1gb
|
||||||
region_id: sgp1
|
region_id: sgp1
|
||||||
image_id: ubuntu-14-04-x64
|
image_id: ubuntu-14-04-x64
|
||||||
|
|
||||||
|
|
||||||
register: test_droplet
|
register: test_droplet
|
||||||
|
|
||||||
- digital_ocean_domain:
|
- name: Create a corresponding domain
|
||||||
|
digital_ocean_domain:
|
||||||
state: present
|
state: present
|
||||||
name: "{{ test_droplet.droplet.name }}.my.domain"
|
name: "{{ test_droplet.droplet.name }}.my.domain"
|
||||||
ip: "{{ test_droplet.droplet.ip_address }}"
|
ip: "{{ test_droplet.droplet.ip_address }}"
|
||||||
|
|
|
@ -28,17 +28,20 @@ requirements:
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- digital_ocean_sshkey_info:
|
- name: Gather information about DigitalOcean SSH keys
|
||||||
|
digital_ocean_sshkey_info:
|
||||||
oauth_token: "{{ my_do_key }}"
|
oauth_token: "{{ my_do_key }}"
|
||||||
register: ssh_keys
|
register: ssh_keys
|
||||||
|
|
||||||
- set_fact:
|
- name: Set facts based on the gathered information
|
||||||
|
set_fact:
|
||||||
pubkey: "{{ item.public_key }}"
|
pubkey: "{{ item.public_key }}"
|
||||||
loop: "{{ ssh_keys.data|json_query(ssh_pubkey) }}"
|
loop: "{{ ssh_keys.data|json_query(ssh_pubkey) }}"
|
||||||
vars:
|
vars:
|
||||||
ssh_pubkey: "[?name=='ansible_ctrl']"
|
ssh_pubkey: "[?name=='ansible_ctrl']"
|
||||||
|
|
||||||
- debug:
|
- name: Print SSH public key
|
||||||
|
debug:
|
||||||
msg: "{{ pubkey }}"
|
msg: "{{ pubkey }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -47,21 +47,23 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create an MCP 1.0 network
|
- name: Create an MCP 1.0 network
|
||||||
- dimensiondata_network:
|
dimensiondata_network:
|
||||||
region: na
|
region: na
|
||||||
location: NA5
|
location: NA5
|
||||||
name: mynet
|
name: mynet
|
||||||
# Create an MCP 2.0 network
|
|
||||||
- dimensiondata_network:
|
- name: Create an MCP 2.0 network
|
||||||
|
dimensiondata_network:
|
||||||
region: na
|
region: na
|
||||||
mcp_user: my_user
|
mcp_user: my_user
|
||||||
mcp_password: my_password
|
mcp_password: my_password
|
||||||
location: NA9
|
location: NA9
|
||||||
name: mynet
|
name: mynet
|
||||||
service_plan: ADVANCED
|
service_plan: ADVANCED
|
||||||
# Delete a network
|
|
||||||
- dimensiondata_network:
|
- name: Delete a network
|
||||||
|
dimensiondata_network:
|
||||||
region: na
|
region: na
|
||||||
location: NA1
|
location: NA1
|
||||||
name: mynet
|
name: mynet
|
||||||
|
|
|
@ -69,8 +69,8 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Add or update VLAN
|
- name: Add or update VLAN
|
||||||
- dimensiondata_vlan:
|
dimensiondata_vlan:
|
||||||
region: na
|
region: na
|
||||||
location: NA5
|
location: NA5
|
||||||
network_domain: test_network
|
network_domain: test_network
|
||||||
|
@ -80,16 +80,18 @@ EXAMPLES = '''
|
||||||
private_ipv4_prefix_size: 24
|
private_ipv4_prefix_size: 24
|
||||||
state: present
|
state: present
|
||||||
wait: yes
|
wait: yes
|
||||||
# Read / get VLAN details
|
|
||||||
- dimensiondata_vlan:
|
- name: Read / get VLAN details
|
||||||
|
dimensiondata_vlan:
|
||||||
region: na
|
region: na
|
||||||
location: NA5
|
location: NA5
|
||||||
network_domain: test_network
|
network_domain: test_network
|
||||||
name: my_vlan1
|
name: my_vlan1
|
||||||
state: readonly
|
state: readonly
|
||||||
wait: yes
|
wait: yes
|
||||||
# Delete a VLAN
|
|
||||||
- dimensiondata_vlan:
|
- name: Delete a VLAN
|
||||||
|
dimensiondata_vlan:
|
||||||
region: na
|
region: na
|
||||||
location: NA5
|
location: NA5
|
||||||
network_domain: test_network
|
network_domain: test_network
|
||||||
|
|
|
@ -128,46 +128,46 @@ notes:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create an A record.
|
- name: Create an A record
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'www1.example.com'
|
record: 'www1.example.com'
|
||||||
zone: 'example.com'
|
zone: 'example.com'
|
||||||
type: A
|
type: A
|
||||||
value: '1.2.3.4'
|
value: '1.2.3.4'
|
||||||
|
|
||||||
# Update an existing record.
|
- name: Update an existing record
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'www1.example.com'
|
record: 'www1.example.com'
|
||||||
zone: 'example.com'
|
zone: 'example.com'
|
||||||
type: A
|
type: A
|
||||||
overwrite: true
|
overwrite: true
|
||||||
value: '5.6.7.8'
|
value: '5.6.7.8'
|
||||||
|
|
||||||
# Remove an A record.
|
- name: Remove an A record
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'www1.example.com'
|
record: 'www1.example.com'
|
||||||
zone_id: 'example-com'
|
zone_id: 'example-com'
|
||||||
state: absent
|
state: absent
|
||||||
type: A
|
type: A
|
||||||
value: '5.6.7.8'
|
value: '5.6.7.8'
|
||||||
|
|
||||||
# Create a CNAME record.
|
- name: Create a CNAME record. Note the trailing dot of value
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'www.example.com'
|
record: 'www.example.com'
|
||||||
zone_id: 'example-com'
|
zone_id: 'example-com'
|
||||||
type: CNAME
|
type: CNAME
|
||||||
value: 'www.example.com.' # Note the trailing dot
|
value: 'www.example.com.'
|
||||||
|
|
||||||
# Create an MX record with a custom TTL.
|
- name: Create an MX record with a custom TTL. Note the trailing dot of value
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'example.com'
|
record: 'example.com'
|
||||||
zone: 'example.com'
|
zone: 'example.com'
|
||||||
type: MX
|
type: MX
|
||||||
ttl: 3600
|
ttl: 3600
|
||||||
value: '10 mail.example.com.' # Note the trailing dot
|
value: '10 mail.example.com.'
|
||||||
|
|
||||||
# Create multiple A records with the same name.
|
- name: Create multiple A records with the same name
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'api.example.com'
|
record: 'api.example.com'
|
||||||
zone_id: 'example-com'
|
zone_id: 'example-com'
|
||||||
type: A
|
type: A
|
||||||
|
@ -177,54 +177,54 @@ EXAMPLES = '''
|
||||||
- '198.51.100.5'
|
- '198.51.100.5'
|
||||||
- '203.0.113.10'
|
- '203.0.113.10'
|
||||||
|
|
||||||
# Change the value of an existing record with multiple record_data.
|
- name: Change the value of an existing record with multiple record_data
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'api.example.com'
|
record: 'api.example.com'
|
||||||
zone: 'example.com'
|
zone: 'example.com'
|
||||||
type: A
|
type: A
|
||||||
overwrite: true
|
overwrite: true
|
||||||
record_data: # WARNING: All values in a record will be replaced
|
record_data: # WARNING: All values in a record will be replaced
|
||||||
- '192.0.2.23'
|
- '192.0.2.23'
|
||||||
- '192.0.2.42' # The changed record
|
- '192.0.2.42' # The changed record
|
||||||
- '198.51.100.5'
|
- '198.51.100.5'
|
||||||
- '203.0.113.10'
|
- '203.0.113.10'
|
||||||
|
|
||||||
# Safely remove a multi-line record.
|
- name: Safely remove a multi-line record
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'api.example.com'
|
record: 'api.example.com'
|
||||||
zone_id: 'example-com'
|
zone_id: 'example-com'
|
||||||
state: absent
|
state: absent
|
||||||
type: A
|
type: A
|
||||||
record_data: # NOTE: All of the values must match exactly
|
record_data: # NOTE: All of the values must match exactly
|
||||||
- '192.0.2.23'
|
- '192.0.2.23'
|
||||||
- '192.0.2.42'
|
- '192.0.2.42'
|
||||||
- '198.51.100.5'
|
- '198.51.100.5'
|
||||||
- '203.0.113.10'
|
- '203.0.113.10'
|
||||||
|
|
||||||
# Unconditionally remove a record.
|
- name: Unconditionally remove a record
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'api.example.com'
|
record: 'api.example.com'
|
||||||
zone_id: 'example-com'
|
zone_id: 'example-com'
|
||||||
state: absent
|
state: absent
|
||||||
overwrite: true # overwrite is true, so no values are needed
|
overwrite: true # overwrite is true, so no values are needed
|
||||||
type: A
|
type: A
|
||||||
|
|
||||||
# Create an AAAA record
|
- name: Create an AAAA record
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'www1.example.com'
|
record: 'www1.example.com'
|
||||||
zone: 'example.com'
|
zone: 'example.com'
|
||||||
type: AAAA
|
type: AAAA
|
||||||
value: 'fd00:db8::1'
|
value: 'fd00:db8::1'
|
||||||
|
|
||||||
# Create a PTR record
|
- name: Create a PTR record
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: '10.5.168.192.in-addr.arpa'
|
record: '10.5.168.192.in-addr.arpa'
|
||||||
zone: '5.168.192.in-addr.arpa'
|
zone: '5.168.192.in-addr.arpa'
|
||||||
type: PTR
|
type: PTR
|
||||||
value: 'api.example.com.' # Note the trailing dot.
|
value: 'api.example.com.' # Note the trailing dot.
|
||||||
|
|
||||||
# Create an NS record
|
- name: Create an NS record
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'subdomain.example.com'
|
record: 'subdomain.example.com'
|
||||||
zone: 'example.com'
|
zone: 'example.com'
|
||||||
type: NS
|
type: NS
|
||||||
|
@ -235,8 +235,8 @@ EXAMPLES = '''
|
||||||
- 'ns-cloud-d3.googledomains.com.'
|
- 'ns-cloud-d3.googledomains.com.'
|
||||||
- 'ns-cloud-d4.googledomains.com.'
|
- 'ns-cloud-d4.googledomains.com.'
|
||||||
|
|
||||||
# Create a TXT record
|
- name: Create a TXT record
|
||||||
- gcdns_record:
|
gcdns_record:
|
||||||
record: 'example.com'
|
record: 'example.com'
|
||||||
zone_id: 'example-com'
|
zone_id: 'example-com'
|
||||||
type: TXT
|
type: TXT
|
||||||
|
|
|
@ -36,8 +36,8 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create a Global external IP address
|
- name: Create a Global external IP address
|
||||||
- gce_eip:
|
gce_eip:
|
||||||
service_account_email: "{{ service_account_email }}"
|
service_account_email: "{{ service_account_email }}"
|
||||||
credentials_file: "{{ credentials_file }}"
|
credentials_file: "{{ credentials_file }}"
|
||||||
project_id: "{{ project_id }}"
|
project_id: "{{ project_id }}"
|
||||||
|
@ -45,8 +45,8 @@ EXAMPLES = '''
|
||||||
region: global
|
region: global
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Create a Regional external IP address
|
- name: Create a Regional external IP address
|
||||||
- gce_eip:
|
gce_eip:
|
||||||
service_account_email: "{{ service_account_email }}"
|
service_account_email: "{{ service_account_email }}"
|
||||||
credentials_file: "{{ credentials_file }}"
|
credentials_file: "{{ credentials_file }}"
|
||||||
project_id: "{{ project_id }}"
|
project_id: "{{ project_id }}"
|
||||||
|
|
|
@ -59,25 +59,25 @@ author: "Tom Melendez (@supertom)"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create an image named test-image from the disk 'test-disk' in zone us-central1-a.
|
- name: Create an image named test-image from the disk 'test-disk' in zone us-central1-a
|
||||||
- gce_img:
|
gce_img:
|
||||||
name: test-image
|
name: test-image
|
||||||
source: test-disk
|
source: test-disk
|
||||||
zone: us-central1-a
|
zone: us-central1-a
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Create an image named test-image from a tarball in Google Cloud Storage.
|
- name: Create an image named test-image from a tarball in Google Cloud Storage
|
||||||
- gce_img:
|
gce_img:
|
||||||
name: test-image
|
name: test-image
|
||||||
source: https://storage.googleapis.com/bucket/path/to/image.tgz
|
source: https://storage.googleapis.com/bucket/path/to/image.tgz
|
||||||
|
|
||||||
# Alternatively use the gs scheme
|
- name: Alternatively use the gs scheme
|
||||||
- gce_img:
|
gce_img:
|
||||||
name: test-image
|
name: test-image
|
||||||
source: gs://bucket/path/to/image.tgz
|
source: gs://bucket/path/to/image.tgz
|
||||||
|
|
||||||
# Delete an image named test-image.
|
- name: Delete an image named test-image
|
||||||
- gce_img:
|
gce_img:
|
||||||
name: test-image
|
name: test-image
|
||||||
state: absent
|
state: absent
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -99,8 +99,8 @@ author: "Eric Johnson (@erjohnso) <erjohnso@google.com>"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Simple example of creating a new LB, adding members, and a health check
|
- name: Simple example of creating a new LB, adding members, and a health check
|
||||||
- local_action:
|
local_action:
|
||||||
module: gce_lb
|
module: gce_lb
|
||||||
name: testlb
|
name: testlb
|
||||||
region: us-central1
|
region: us-central1
|
||||||
|
|
|
@ -84,8 +84,8 @@ author: "Eric Johnson (@erjohnso) <erjohnso@google.com>"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Simple attachment action to an existing instance
|
- name: Simple attachment action to an existing instance
|
||||||
- local_action:
|
local_action:
|
||||||
module: gce_pd
|
module: gce_pd
|
||||||
instance_name: notlocalhost
|
instance_name: notlocalhost
|
||||||
size_gb: 5
|
size_gb: 5
|
||||||
|
|
|
@ -39,18 +39,18 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
## List all Topics in a project
|
- name: List all Topics in a project
|
||||||
- gcpubsub_info:
|
gcpubsub_info:
|
||||||
view: topics
|
view: topics
|
||||||
state: list
|
state: list
|
||||||
|
|
||||||
## List all Subscriptions in a project
|
- name: List all Subscriptions in a project
|
||||||
- gcpubsub_info:
|
gcpubsub_info:
|
||||||
view: subscriptions
|
view: subscriptions
|
||||||
state: list
|
state: list
|
||||||
|
|
||||||
## List all Subscriptions for a Topic in a project
|
- name: List all Subscriptions for a Topic in a project
|
||||||
- gcpubsub_info:
|
gcpubsub_info:
|
||||||
view: subscriptions
|
view: subscriptions
|
||||||
topic: my-topic
|
topic: my-topic
|
||||||
state: list
|
state: list
|
||||||
|
|
|
@ -47,13 +47,15 @@ notes:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
- heroku_collaborator:
|
- name: Create a heroku collaborator
|
||||||
|
heroku_collaborator:
|
||||||
api_key: YOUR_API_KEY
|
api_key: YOUR_API_KEY
|
||||||
user: max.mustermann@example.com
|
user: max.mustermann@example.com
|
||||||
apps: heroku-example-app
|
apps: heroku-example-app
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- heroku_collaborator:
|
- name: An example of using the module in loop
|
||||||
|
heroku_collaborator:
|
||||||
api_key: YOUR_API_KEY
|
api_key: YOUR_API_KEY
|
||||||
user: '{{ item.user }}'
|
user: '{{ item.user }}'
|
||||||
apps: '{{ item.apps | default(apps) }}'
|
apps: '{{ item.apps | default(apps) }}'
|
||||||
|
|
|
@ -362,171 +362,174 @@ requirements: [ "proxmoxer", "requests" ]
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create new VM with minimal options
|
- name: Create new VM with minimal options
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
|
|
||||||
# Create new VM with minimal options and given vmid
|
- name: Create new VM with minimal options and given vmid
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
vmid : 100
|
vmid: 100
|
||||||
|
|
||||||
# Create new VM with two network interface options.
|
- name: Create new VM with two network interface options
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
net : '{"net0":"virtio,bridge=vmbr1,rate=200", "net1":"e1000,bridge=vmbr2,"}'
|
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.
|
- name: Create new VM with one network interface, three virto hard disk, 4 cores, and 2 vcpus
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
net : '{"net0":"virtio,bridge=vmbr1,rate=200"}'
|
net: '{"net0":"virtio,bridge=vmbr1,rate=200"}'
|
||||||
virtio : '{"virtio0":"VMs_LVM:10", "virtio1":"VMs:2,format=qcow2", "virtio2":"VMs:5,format=raw"}'
|
virtio: '{"virtio0":"VMs_LVM:10", "virtio1":"VMs:2,format=qcow2", "virtio2":"VMs:5,format=raw"}'
|
||||||
cores : 4
|
cores: 4
|
||||||
vcpus : 2
|
vcpus: 2
|
||||||
|
|
||||||
# Clone VM with only source VM name
|
- name: >
|
||||||
- proxmox_kvm:
|
Clone VM with only source VM name.
|
||||||
api_user : root@pam
|
The VM source is spynal.
|
||||||
|
The target VM name is zavala
|
||||||
|
proxmox_kvm:
|
||||||
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
clone : spynal # The VM source
|
clone: spynal
|
||||||
name : zavala # The target VM name
|
name: zavala
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
storage : VMs
|
storage: VMs
|
||||||
format : qcow2
|
format: qcow2
|
||||||
timeout : 500 # Note: The task can take a while. Adapt
|
timeout: 500
|
||||||
|
|
||||||
# Clone VM with source vmid and target newid and raw format
|
- name: Clone VM with source vmid and target newid and raw format
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
clone : arbitrary_name
|
clone: arbitrary_name
|
||||||
vmid : 108
|
vmid: 108
|
||||||
newid : 152
|
newid: 152
|
||||||
name : zavala # The target VM name
|
name: zavala
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
storage : LVM_STO
|
storage: LVM_STO
|
||||||
format : raw
|
format: raw
|
||||||
timeout : 300 # Note: The task can take a while. Adapt
|
timeout: 300
|
||||||
|
|
||||||
# Create new VM and lock it for snapashot.
|
- name: Create new VM and lock it for snapashot
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
lock : snapshot
|
lock: snapshot
|
||||||
|
|
||||||
# Create new VM and set protection to disable the remove VM and remove disk operations
|
- name: Create new VM and set protection to disable the remove VM and remove disk operations
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
protection : yes
|
protection: yes
|
||||||
|
|
||||||
# Start VM
|
- name: Start VM
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
state : started
|
state: started
|
||||||
|
|
||||||
# Stop VM
|
- name: Stop VM
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
state : stopped
|
state: stopped
|
||||||
|
|
||||||
# Stop VM with force
|
- name: Stop VM with force
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
state : stopped
|
state: stopped
|
||||||
force : yes
|
force: yes
|
||||||
|
|
||||||
# Restart VM
|
- name: Restart VM
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
state : restarted
|
state: restarted
|
||||||
|
|
||||||
# Remove VM
|
- name: Remove VM
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
state : absent
|
state: absent
|
||||||
|
|
||||||
# Get VM current state
|
- name: Get VM current state
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
state : current
|
state: current
|
||||||
|
|
||||||
# Update VM configuration
|
- name: Update VM configuration
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
cores : 8
|
cores: 8
|
||||||
memory : 16384
|
memory: 16384
|
||||||
update : yes
|
update: yes
|
||||||
|
|
||||||
# Delete QEMU parameters
|
- name: Delete QEMU parameters
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
delete : 'args,template,cpulimit'
|
delete: 'args,template,cpulimit'
|
||||||
|
|
||||||
# Revert a pending change
|
- name: Revert a pending change
|
||||||
- proxmox_kvm:
|
proxmox_kvm:
|
||||||
api_user : root@pam
|
api_user: root@pam
|
||||||
api_password: secret
|
api_password: secret
|
||||||
api_host : helldorado
|
api_host: helldorado
|
||||||
name : spynal
|
name: spynal
|
||||||
node : sabrewulf
|
node: sabrewulf
|
||||||
revert : 'template,cpulimit'
|
revert: 'template,cpulimit'
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -76,23 +76,25 @@ author: Sergei Antipov (@UnderGreen)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Upload new openvz template with minimal options
|
- name: Upload new openvz template with minimal options
|
||||||
- proxmox_template:
|
proxmox_template:
|
||||||
node: uk-mc02
|
node: uk-mc02
|
||||||
api_user: root@pam
|
api_user: root@pam
|
||||||
api_password: 1q2w3e
|
api_password: 1q2w3e
|
||||||
api_host: node1
|
api_host: node1
|
||||||
src: ~/ubuntu-14.04-x86_64.tar.gz
|
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)
|
- name: >
|
||||||
- proxmox_template:
|
Upload new openvz template with minimal options use environment
|
||||||
|
PROXMOX_PASSWORD variable(you should export it before)
|
||||||
|
proxmox_template:
|
||||||
node: uk-mc02
|
node: uk-mc02
|
||||||
api_user: root@pam
|
api_user: root@pam
|
||||||
api_host: node1
|
api_host: node1
|
||||||
src: ~/ubuntu-14.04-x86_64.tar.gz
|
src: ~/ubuntu-14.04-x86_64.tar.gz
|
||||||
|
|
||||||
# Upload new openvz template with all options and force overwrite
|
- name: Upload new openvz template with all options and force overwrite
|
||||||
- proxmox_template:
|
proxmox_template:
|
||||||
node: uk-mc02
|
node: uk-mc02
|
||||||
api_user: root@pam
|
api_user: root@pam
|
||||||
api_password: 1q2w3e
|
api_password: 1q2w3e
|
||||||
|
@ -102,8 +104,8 @@ EXAMPLES = '''
|
||||||
src: ~/ubuntu-14.04-x86_64.tar.gz
|
src: ~/ubuntu-14.04-x86_64.tar.gz
|
||||||
force: yes
|
force: yes
|
||||||
|
|
||||||
# Delete template with minimal options
|
- name: Delete template with minimal options
|
||||||
- proxmox_template:
|
proxmox_template:
|
||||||
node: uk-mc02
|
node: uk-mc02
|
||||||
api_user: root@pam
|
api_user: root@pam
|
||||||
api_password: 1q2w3e
|
api_password: 1q2w3e
|
||||||
|
|
|
@ -102,13 +102,13 @@ author: "Ryan Scott Brown (@ryansb)"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
# Basic deploy of a service
|
- name: Basic deploy of a service
|
||||||
- terraform:
|
terraform:
|
||||||
project_path: '{{ project_dir }}'
|
project_path: '{{ project_dir }}'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Define the backend configuration at init
|
- name: Define the backend configuration at init
|
||||||
- terraform:
|
terraform:
|
||||||
project_path: 'project/'
|
project_path: 'project/'
|
||||||
state: "{{ state }}"
|
state: "{{ state }}"
|
||||||
force_init: true
|
force_init: true
|
||||||
|
|
|
@ -101,10 +101,8 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
- name: Create a firewall policy
|
||||||
# Provisioning example. Create and destroy a firewall policy.
|
oneandone_firewall_policy:
|
||||||
|
|
||||||
- oneandone_firewall_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
name: ansible-firewall-policy
|
name: ansible-firewall-policy
|
||||||
description: Testing creation of firewall policies with ansible
|
description: Testing creation of firewall policies with ansible
|
||||||
|
@ -117,23 +115,22 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
|
|
||||||
- oneandone_firewall_policy:
|
- name: Destroy a firewall policy
|
||||||
|
oneandone_firewall_policy:
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: absent
|
state: absent
|
||||||
name: ansible-firewall-policy
|
name: ansible-firewall-policy
|
||||||
|
|
||||||
# Update a firewall policy.
|
- name: Update a firewall policy
|
||||||
|
oneandone_firewall_policy:
|
||||||
- oneandone_firewall_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: update
|
state: update
|
||||||
firewall_policy: ansible-firewall-policy
|
firewall_policy: ansible-firewall-policy
|
||||||
name: ansible-firewall-policy-updated
|
name: ansible-firewall-policy-updated
|
||||||
description: Testing creation of firewall policies with ansible - updated
|
description: Testing creation of firewall policies with ansible - updated
|
||||||
|
|
||||||
# Add server to a firewall policy.
|
- name: Add server to a firewall policy
|
||||||
|
oneandone_firewall_policy:
|
||||||
- oneandone_firewall_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
firewall_policy: ansible-firewall-policy-updated
|
firewall_policy: ansible-firewall-policy-updated
|
||||||
add_server_ips:
|
add_server_ips:
|
||||||
|
@ -143,9 +140,8 @@ EXAMPLES = '''
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Remove server from a firewall policy.
|
- name: Remove server from a firewall policy
|
||||||
|
oneandone_firewall_policy:
|
||||||
- oneandone_firewall_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
firewall_policy: ansible-firewall-policy-updated
|
firewall_policy: ansible-firewall-policy-updated
|
||||||
remove_server_ips:
|
remove_server_ips:
|
||||||
|
@ -154,9 +150,8 @@ EXAMPLES = '''
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Add rules to a firewall policy.
|
- name: Add rules to a firewall policy
|
||||||
|
oneandone_firewall_policy:
|
||||||
- oneandone_firewall_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
firewall_policy: ansible-firewall-policy-updated
|
firewall_policy: ansible-firewall-policy-updated
|
||||||
description: Adding rules to an existing firewall policy
|
description: Adding rules to an existing firewall policy
|
||||||
|
@ -175,9 +170,8 @@ EXAMPLES = '''
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Remove rules from a firewall policy.
|
- name: Remove rules from a firewall policy
|
||||||
|
oneandone_firewall_policy:
|
||||||
- oneandone_firewall_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
firewall_policy: ansible-firewall-policy-updated
|
firewall_policy: ansible-firewall-policy-updated
|
||||||
remove_rules:
|
remove_rules:
|
||||||
|
@ -187,7 +181,6 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -138,10 +138,8 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
- name: Create a load balancer
|
||||||
# Provisioning example. Create and destroy a load balancer.
|
oneandone_load_balancer:
|
||||||
|
|
||||||
- oneandone_load_balancer:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
name: ansible load balancer
|
name: ansible load balancer
|
||||||
description: Testing creation of load balancer with ansible
|
description: Testing creation of load balancer with ansible
|
||||||
|
@ -160,16 +158,16 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
|
|
||||||
- oneandone_load_balancer:
|
- name: Destroy a load balancer
|
||||||
|
oneandone_load_balancer:
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
name: ansible load balancer
|
name: ansible load balancer
|
||||||
wait: true
|
wait: true
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Update a load balancer.
|
- name: Update a load balancer
|
||||||
|
oneandone_load_balancer:
|
||||||
- oneandone_load_balancer:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
load_balancer: ansible load balancer
|
load_balancer: ansible load balancer
|
||||||
name: ansible load balancer updated
|
name: ansible load balancer updated
|
||||||
|
@ -178,9 +176,8 @@ EXAMPLES = '''
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Add server to a load balancer.
|
- name: Add server to a load balancer
|
||||||
|
oneandone_load_balancer:
|
||||||
- oneandone_load_balancer:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
load_balancer: ansible load balancer updated
|
load_balancer: ansible load balancer updated
|
||||||
description: Adding server to a load balancer with ansible
|
description: Adding server to a load balancer with ansible
|
||||||
|
@ -190,9 +187,8 @@ EXAMPLES = '''
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Remove server from a load balancer.
|
- name: Remove server from a load balancer
|
||||||
|
oneandone_load_balancer:
|
||||||
- oneandone_load_balancer:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
load_balancer: ansible load balancer updated
|
load_balancer: ansible load balancer updated
|
||||||
description: Removing server from a load balancer with ansible
|
description: Removing server from a load balancer with ansible
|
||||||
|
@ -202,9 +198,8 @@ EXAMPLES = '''
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Add rules to a load balancer.
|
- name: Add rules to a load balancer
|
||||||
|
oneandone_load_balancer:
|
||||||
- oneandone_load_balancer:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
load_balancer: ansible load balancer updated
|
load_balancer: ansible load balancer updated
|
||||||
description: Adding rules to a load balancer with ansible
|
description: Adding rules to a load balancer with ansible
|
||||||
|
@ -223,9 +218,8 @@ EXAMPLES = '''
|
||||||
wait_timeout: 500
|
wait_timeout: 500
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Remove rules from a load balancer.
|
- name: Remove rules from a load balancer
|
||||||
|
oneandone_load_balancer:
|
||||||
- oneandone_load_balancer:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
load_balancer: ansible load balancer updated
|
load_balancer: ansible load balancer updated
|
||||||
description: Adding rules to a load balancer with ansible
|
description: Adding rules to a load balancer with ansible
|
||||||
|
|
|
@ -183,10 +183,8 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
- name: Create a monitoring policy
|
||||||
# Provisioning example. Create and destroy a monitoring policy.
|
oneandone_moitoring_policy:
|
||||||
|
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
name: ansible monitoring policy
|
name: ansible monitoring policy
|
||||||
description: Testing creation of a monitoring policy with ansible
|
description: Testing creation of a monitoring policy with ansible
|
||||||
|
@ -246,14 +244,14 @@ EXAMPLES = '''
|
||||||
email_notification: false
|
email_notification: false
|
||||||
wait: true
|
wait: true
|
||||||
|
|
||||||
- oneandone_moitoring_policy:
|
- name: Destroy a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: absent
|
state: absent
|
||||||
name: ansible monitoring policy
|
name: ansible monitoring policy
|
||||||
|
|
||||||
# Update a monitoring policy.
|
- name: Update a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
monitoring_policy: ansible monitoring policy
|
monitoring_policy: ansible monitoring policy
|
||||||
name: ansible monitoring policy updated
|
name: ansible monitoring policy updated
|
||||||
|
@ -303,9 +301,8 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Add a port to a monitoring policy.
|
- name: Add a port to a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
monitoring_policy: ansible monitoring policy updated
|
monitoring_policy: ansible monitoring policy updated
|
||||||
add_ports:
|
add_ports:
|
||||||
|
@ -317,9 +314,8 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Update existing ports of a monitoring policy.
|
- name: Update existing ports of a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
monitoring_policy: ansible monitoring policy updated
|
monitoring_policy: ansible monitoring policy updated
|
||||||
update_ports:
|
update_ports:
|
||||||
|
@ -338,18 +334,16 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Remove a port from a monitoring policy.
|
- name: Remove a port from a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
monitoring_policy: ansible monitoring policy updated
|
monitoring_policy: ansible monitoring policy updated
|
||||||
remove_ports:
|
remove_ports:
|
||||||
- port_id
|
- port_id
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Add a process to a monitoring policy.
|
- name: Add a process to a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
monitoring_policy: ansible monitoring policy updated
|
monitoring_policy: ansible monitoring policy updated
|
||||||
add_processes:
|
add_processes:
|
||||||
|
@ -360,9 +354,8 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Update existing processes of a monitoring policy.
|
- name: Update existing processes of a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
monitoring_policy: ansible monitoring policy updated
|
monitoring_policy: ansible monitoring policy updated
|
||||||
update_processes:
|
update_processes:
|
||||||
|
@ -379,9 +372,8 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Remove a process from a monitoring policy.
|
- name: Remove a process from a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
monitoring_policy: ansible monitoring policy updated
|
monitoring_policy: ansible monitoring policy updated
|
||||||
remove_processes:
|
remove_processes:
|
||||||
|
@ -389,9 +381,8 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Add server to a monitoring policy.
|
- name: Add server to a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
monitoring_policy: ansible monitoring policy updated
|
monitoring_policy: ansible monitoring policy updated
|
||||||
add_servers:
|
add_servers:
|
||||||
|
@ -399,9 +390,8 @@ EXAMPLES = '''
|
||||||
wait: true
|
wait: true
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
# Remove server from a monitoring policy.
|
- name: Remove server from a monitoring policy
|
||||||
|
oneandone_moitoring_policy:
|
||||||
- oneandone_moitoring_policy:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
monitoring_policy: ansible monitoring policy updated
|
monitoring_policy: ansible monitoring policy updated
|
||||||
remove_servers:
|
remove_servers:
|
||||||
|
|
|
@ -91,10 +91,8 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
- name: Create a private network
|
||||||
# Provisioning example. Create and destroy private networks.
|
oneandone_private_network:
|
||||||
|
|
||||||
- oneandone_private_network:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
name: backup_network
|
name: backup_network
|
||||||
description: Testing creation of a private network with ansible
|
description: Testing creation of a private network with ansible
|
||||||
|
@ -102,38 +100,35 @@ EXAMPLES = '''
|
||||||
subnet_mask: 255.0.0.0
|
subnet_mask: 255.0.0.0
|
||||||
datacenter: US
|
datacenter: US
|
||||||
|
|
||||||
- oneandone_private_network:
|
- name: Destroy a private network
|
||||||
|
oneandone_private_network:
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: absent
|
state: absent
|
||||||
name: backup_network
|
name: backup_network
|
||||||
|
|
||||||
# Modify the private network.
|
- name: Modify the private network
|
||||||
|
oneandone_private_network:
|
||||||
- oneandone_private_network:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: update
|
state: update
|
||||||
private_network: backup_network
|
private_network: backup_network
|
||||||
network_address: 192.168.2.0
|
network_address: 192.168.2.0
|
||||||
subnet_mask: 255.255.255.0
|
subnet_mask: 255.255.255.0
|
||||||
|
|
||||||
# Add members to the private network.
|
- name: Add members to the private network
|
||||||
|
oneandone_private_network:
|
||||||
- oneandone_private_network:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: update
|
state: update
|
||||||
private_network: backup_network
|
private_network: backup_network
|
||||||
add_members:
|
add_members:
|
||||||
- server identifier (id or name)
|
- server identifier (id or name)
|
||||||
|
|
||||||
# Remove members from the private network.
|
- name: Remove members from the private network
|
||||||
|
oneandone_private_network:
|
||||||
- oneandone_private_network:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: update
|
state: update
|
||||||
private_network: backup_network
|
private_network: backup_network
|
||||||
remove_members:
|
remove_members:
|
||||||
- server identifier (id or name)
|
- server identifier (id or name)
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -83,31 +83,25 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
- name: Create a public IP
|
||||||
# Create a public IP.
|
oneandone_public_ip:
|
||||||
|
|
||||||
- oneandone_public_ip:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
reverse_dns: example.com
|
reverse_dns: example.com
|
||||||
datacenter: US
|
datacenter: US
|
||||||
type: IPV4
|
type: IPV4
|
||||||
|
|
||||||
# Update a public IP.
|
- name: Update a public IP
|
||||||
|
oneandone_public_ip:
|
||||||
- oneandone_public_ip:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
public_ip_id: public ip id
|
public_ip_id: public ip id
|
||||||
reverse_dns: secondexample.com
|
reverse_dns: secondexample.com
|
||||||
state: update
|
state: update
|
||||||
|
|
||||||
|
- name: Delete a public IP
|
||||||
# Delete a public IP
|
oneandone_public_ip:
|
||||||
|
|
||||||
- oneandone_public_ip:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
public_ip_id: public ip id
|
public_ip_id: public ip id
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -139,10 +139,8 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
|
- name: Create three servers and enumerate their names
|
||||||
# Provisioning example. Creates three servers and enumerate their names.
|
oneandone_server:
|
||||||
|
|
||||||
- oneandone_server:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
hostname: node%02d
|
hostname: node%02d
|
||||||
fixed_instance_size: XL
|
fixed_instance_size: XL
|
||||||
|
@ -151,9 +149,8 @@ EXAMPLES = '''
|
||||||
auto_increment: true
|
auto_increment: true
|
||||||
count: 3
|
count: 3
|
||||||
|
|
||||||
# Create three servers, passing in an ssh_key.
|
- name: Create three servers, passing in an ssh_key
|
||||||
|
oneandone_server:
|
||||||
- oneandone_server:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
hostname: node%02d
|
hostname: node%02d
|
||||||
vcore: 2
|
vcore: 2
|
||||||
|
@ -170,23 +167,20 @@ EXAMPLES = '''
|
||||||
wait_interval: 10
|
wait_interval: 10
|
||||||
ssh_key: SSH_PUBLIC_KEY
|
ssh_key: SSH_PUBLIC_KEY
|
||||||
|
|
||||||
# Removing server
|
- name: Removing server
|
||||||
|
oneandone_server:
|
||||||
- oneandone_server:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: absent
|
state: absent
|
||||||
server: 'node01'
|
server: 'node01'
|
||||||
|
|
||||||
# Starting server.
|
- name: Starting server
|
||||||
|
oneandone_server:
|
||||||
- oneandone_server:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: running
|
state: running
|
||||||
server: 'node01'
|
server: 'node01'
|
||||||
|
|
||||||
# Stopping server
|
- name: Stopping server
|
||||||
|
oneandone_server:
|
||||||
- oneandone_server:
|
|
||||||
auth_token: oneandone_private_api_key
|
auth_token: oneandone_private_api_key
|
||||||
state: stopped
|
state: stopped
|
||||||
server: 'node01'
|
server: 'node01'
|
||||||
|
|
|
@ -74,40 +74,40 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Fetch the IMAGE by id
|
- name: Fetch the IMAGE by id
|
||||||
- one_image:
|
one_image:
|
||||||
id: 45
|
id: 45
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
# Print the IMAGE properties
|
- name: Print the IMAGE properties
|
||||||
- debug:
|
debug:
|
||||||
msg: result
|
msg: result
|
||||||
|
|
||||||
# Rename existing IMAGE
|
- name: Rename existing IMAGE
|
||||||
- one_image:
|
one_image:
|
||||||
id: 34
|
id: 34
|
||||||
state: renamed
|
state: renamed
|
||||||
new_name: bar-image
|
new_name: bar-image
|
||||||
|
|
||||||
# Disable the IMAGE by id
|
- name: Disable the IMAGE by id
|
||||||
- one_image:
|
one_image:
|
||||||
id: 37
|
id: 37
|
||||||
enabled: no
|
enabled: no
|
||||||
|
|
||||||
# Enable the IMAGE by name
|
- name: Enable the IMAGE by name
|
||||||
- one_image:
|
one_image:
|
||||||
name: bar-image
|
name: bar-image
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
||||||
# Clone the IMAGE by name
|
- name: Clone the IMAGE by name
|
||||||
- one_image:
|
one_image:
|
||||||
name: bar-image
|
name: bar-image
|
||||||
state: cloned
|
state: cloned
|
||||||
new_name: bar-image-clone
|
new_name: bar-image-clone
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
# Delete the IMAGE by id
|
- name: Delete the IMAGE by id
|
||||||
- one_image:
|
one_image:
|
||||||
id: '{{ result.id }}'
|
id: '{{ result.id }}'
|
||||||
state: absent
|
state: absent
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -65,31 +65,31 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Gather facts about all images
|
- name: Gather facts about all images
|
||||||
- one_image_info:
|
one_image_info:
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
# Print all images facts
|
- name: Print all images facts
|
||||||
- debug:
|
debug:
|
||||||
msg: result
|
msg: result
|
||||||
|
|
||||||
# Gather facts about an image using ID
|
- name: Gather facts about an image using ID
|
||||||
- one_image_info:
|
one_image_info:
|
||||||
ids:
|
ids:
|
||||||
- 123
|
- 123
|
||||||
|
|
||||||
# Gather facts about an image using the name
|
- name: Gather facts about an image using the name
|
||||||
- one_image_info:
|
one_image_info:
|
||||||
name: 'foo-image'
|
name: 'foo-image'
|
||||||
register: foo_image
|
register: foo_image
|
||||||
|
|
||||||
# Gather facts about all IMAGEs whose name matches regex 'app-image-.*'
|
- name: Gather facts about all IMAGEs whose name matches regex 'app-image-.*'
|
||||||
- one_image_info:
|
one_image_info:
|
||||||
name: '~app-image-.*'
|
name: '~app-image-.*'
|
||||||
register: app_images
|
register: app_images
|
||||||
|
|
||||||
# Gather facts about all IMAGEs whose name matches regex 'foo-image-.*' ignoring cases
|
- name: Gather facts about all IMAGEs whose name matches regex 'foo-image-.*' ignoring cases
|
||||||
- one_image_info:
|
one_image_info:
|
||||||
name: '~*foo-image-.*'
|
name: '~*foo-image-.*'
|
||||||
register: foo_images
|
register: foo_images
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -104,70 +104,70 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Instantiate a new service
|
- name: Instantiate a new service
|
||||||
- one_service:
|
one_service:
|
||||||
template_id: 90
|
template_id: 90
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
# Print service properties
|
- name: Print service properties
|
||||||
- debug:
|
debug:
|
||||||
msg: result
|
msg: result
|
||||||
|
|
||||||
# Instantiate a new service with specified service_name, service group and mode
|
- name: Instantiate a new service with specified service_name, service group and mode
|
||||||
- one_service:
|
one_service:
|
||||||
template_name: 'app1_template'
|
template_name: 'app1_template'
|
||||||
service_name: 'app1'
|
service_name: 'app1'
|
||||||
group_id: 1
|
group_id: 1
|
||||||
mode: '660'
|
mode: '660'
|
||||||
|
|
||||||
# Instantiate a new service with template_id and pass custom_attrs dict
|
- name: Instantiate a new service with template_id and pass custom_attrs dict
|
||||||
- one_service:
|
one_service:
|
||||||
template_id: 90
|
template_id: 90
|
||||||
custom_attrs:
|
custom_attrs:
|
||||||
public_network_id: 21
|
public_network_id: 21
|
||||||
private_network_id: 26
|
private_network_id: 26
|
||||||
|
|
||||||
# Instantiate a new service 'foo' if the service doesn't already exist, otherwise do nothing
|
- name: Instantiate a new service 'foo' if the service doesn't already exist, otherwise do nothing
|
||||||
- one_service:
|
one_service:
|
||||||
template_id: 53
|
template_id: 53
|
||||||
service_name: 'foo'
|
service_name: 'foo'
|
||||||
unique: yes
|
unique: yes
|
||||||
|
|
||||||
# Delete a service by ID
|
- name: Delete a service by ID
|
||||||
- one_service:
|
one_service:
|
||||||
service_id: 153
|
service_id: 153
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Get service info
|
- name: Get service info
|
||||||
- one_service:
|
one_service:
|
||||||
service_id: 153
|
service_id: 153
|
||||||
register: service_info
|
register: service_info
|
||||||
|
|
||||||
# Change service owner, group and mode
|
- name: Change service owner, group and mode
|
||||||
- one_service:
|
one_service:
|
||||||
service_name: 'app2'
|
service_name: 'app2'
|
||||||
owner_id: 34
|
owner_id: 34
|
||||||
group_id: 113
|
group_id: 113
|
||||||
mode: '600'
|
mode: '600'
|
||||||
|
|
||||||
# Instantiate service and wait for it to become RUNNING
|
- name: Instantiate service and wait for it to become RUNNING
|
||||||
- one_service:
|
one_service:
|
||||||
template_id: 43
|
template_id: 43
|
||||||
service_name: 'foo1'
|
service_name: 'foo1'
|
||||||
|
|
||||||
# Wait service to become RUNNING
|
- name: Wait service to become RUNNING
|
||||||
- one_service:
|
one_service:
|
||||||
service_id: 112
|
service_id: 112
|
||||||
wait: yes
|
wait: yes
|
||||||
|
|
||||||
# Change role cardinality
|
- name: Change role cardinality
|
||||||
- one_service:
|
one_service:
|
||||||
service_id: 153
|
service_id: 153
|
||||||
role: bar
|
role: bar
|
||||||
cardinality: 5
|
cardinality: 5
|
||||||
|
|
||||||
# Change role cardinality and wait for it to be applied
|
- name: Change role cardinality and wait for it to be applied
|
||||||
- one_service:
|
one_service:
|
||||||
service_id: 112
|
service_id: 112
|
||||||
role: foo
|
role: foo
|
||||||
cardinality: 7
|
cardinality: 7
|
||||||
|
|
|
@ -185,44 +185,44 @@ author:
|
||||||
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create a new instance
|
- name: Create a new instance
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 90
|
template_id: 90
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
# Print VM properties
|
- name: Print VM properties
|
||||||
- debug:
|
debug:
|
||||||
msg: result
|
msg: result
|
||||||
|
|
||||||
# Deploy a new VM on hold
|
- name: Deploy a new VM on hold
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_name: 'app1_template'
|
template_name: 'app1_template'
|
||||||
vm_start_on_hold: 'True'
|
vm_start_on_hold: 'True'
|
||||||
|
|
||||||
# Deploy a new VM and set its name to 'foo'
|
- name: Deploy a new VM and set its name to 'foo'
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_name: 'app1_template'
|
template_name: 'app1_template'
|
||||||
attributes:
|
attributes:
|
||||||
name: foo
|
name: foo
|
||||||
|
|
||||||
# Deploy a new VM and set its group_id and mode
|
- name: Deploy a new VM and set its group_id and mode
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 90
|
template_id: 90
|
||||||
group_id: 16
|
group_id: 16
|
||||||
mode: 660
|
mode: 660
|
||||||
|
|
||||||
# Deploy a new VM as persistent
|
- name: Deploy a new VM as persistent
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 90
|
template_id: 90
|
||||||
persistent: yes
|
persistent: yes
|
||||||
|
|
||||||
# Change VM's permissions to 640
|
- name: Change VM's permissions to 640
|
||||||
- one_vm:
|
one_vm:
|
||||||
instance_ids: 5
|
instance_ids: 5
|
||||||
mode: 640
|
mode: 640
|
||||||
|
|
||||||
# Deploy 2 new instances and set memory, vcpu, disk_size and 3 networks
|
- name: Deploy 2 new instances and set memory, vcpu, disk_size and 3 networks
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 15
|
template_id: 15
|
||||||
disk_size: 35.2 GB
|
disk_size: 35.2 GB
|
||||||
memory: 4 GB
|
memory: 4 GB
|
||||||
|
@ -236,8 +236,8 @@ EXAMPLES = '''
|
||||||
- NETWORK_ID: 27
|
- NETWORK_ID: 27
|
||||||
SECURITY_GROUPS: "10"
|
SECURITY_GROUPS: "10"
|
||||||
|
|
||||||
# Deploy a new instance which uses a Template with two Disks
|
- name: Deploy a new instance which uses a Template with two Disks
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 42
|
template_id: 42
|
||||||
disk_size:
|
disk_size:
|
||||||
- 35.2 GB
|
- 35.2 GB
|
||||||
|
@ -248,15 +248,15 @@ EXAMPLES = '''
|
||||||
networks:
|
networks:
|
||||||
- NETWORK_ID: 27
|
- NETWORK_ID: 27
|
||||||
|
|
||||||
# Deploy an new instance with attribute 'bar: bar1' and set its name to 'foo'
|
- name: "Deploy an new instance with attribute 'bar: bar1' and set its name to 'foo'"
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 53
|
template_id: 53
|
||||||
attributes:
|
attributes:
|
||||||
name: foo
|
name: foo
|
||||||
bar: bar1
|
bar: bar1
|
||||||
|
|
||||||
# Enforce that 2 instances with attributes 'foo1: app1' and 'foo2: app2' are deployed
|
- name: "Enforce that 2 instances with attributes 'foo1: app1' and 'foo2: app2' are deployed"
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 53
|
template_id: 53
|
||||||
attributes:
|
attributes:
|
||||||
foo1: app1
|
foo1: app1
|
||||||
|
@ -266,8 +266,8 @@ EXAMPLES = '''
|
||||||
foo1: app1
|
foo1: app1
|
||||||
foo2: app2
|
foo2: app2
|
||||||
|
|
||||||
# Enforce that 4 instances with an attribute 'bar' are deployed
|
- name: Enforce that 4 instances with an attribute 'bar' are deployed
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 53
|
template_id: 53
|
||||||
attributes:
|
attributes:
|
||||||
name: app
|
name: app
|
||||||
|
@ -278,7 +278,8 @@ EXAMPLES = '''
|
||||||
|
|
||||||
# Deploy 2 new instances with attribute 'foo: bar' and labels 'app1' and 'app2' and names in format 'fooapp-##'
|
# Deploy 2 new instances with attribute 'foo: bar' and labels 'app1' and 'app2' and names in format 'fooapp-##'
|
||||||
# Names will be: fooapp-00 and fooapp-01
|
# Names will be: fooapp-00 and fooapp-01
|
||||||
- one_vm:
|
- name: Deploy 2 new instances
|
||||||
|
one_vm:
|
||||||
template_id: 53
|
template_id: 53
|
||||||
attributes:
|
attributes:
|
||||||
name: fooapp-##
|
name: fooapp-##
|
||||||
|
@ -290,7 +291,8 @@ EXAMPLES = '''
|
||||||
|
|
||||||
# Deploy 2 new instances with attribute 'app: app1' and names in format 'fooapp-###'
|
# Deploy 2 new instances with attribute 'app: app1' and names in format 'fooapp-###'
|
||||||
# Names will be: fooapp-002 and fooapp-003
|
# Names will be: fooapp-002 and fooapp-003
|
||||||
- one_vm:
|
- name: Deploy 2 new instances
|
||||||
|
one_vm:
|
||||||
template_id: 53
|
template_id: 53
|
||||||
attributes:
|
attributes:
|
||||||
name: fooapp-###
|
name: fooapp-###
|
||||||
|
@ -299,61 +301,63 @@ EXAMPLES = '''
|
||||||
|
|
||||||
# Reboot all instances with name in format 'fooapp-#'
|
# Reboot all instances with name in format 'fooapp-#'
|
||||||
# Instances 'fooapp-00', 'fooapp-01', 'fooapp-002' and 'fooapp-003' will be rebooted
|
# Instances 'fooapp-00', 'fooapp-01', 'fooapp-002' and 'fooapp-003' will be rebooted
|
||||||
- one_vm:
|
- name: Reboot all instances with names in a certain format
|
||||||
|
one_vm:
|
||||||
attributes:
|
attributes:
|
||||||
name: fooapp-#
|
name: fooapp-#
|
||||||
state: rebooted
|
state: rebooted
|
||||||
|
|
||||||
# Enforce that only 1 instance with name in format 'fooapp-#' is deployed
|
# Enforce that only 1 instance with name in format 'fooapp-#' is deployed
|
||||||
# The task will delete oldest instances, so only the 'fooapp-003' will remain
|
# The task will delete oldest instances, so only the 'fooapp-003' will remain
|
||||||
- one_vm:
|
- name: Enforce that only 1 instance with name in a certain format is deployed
|
||||||
|
one_vm:
|
||||||
template_id: 53
|
template_id: 53
|
||||||
exact_count: 1
|
exact_count: 1
|
||||||
count_attributes:
|
count_attributes:
|
||||||
name: fooapp-#
|
name: fooapp-#
|
||||||
|
|
||||||
# Deploy an new instance with a network
|
- name: Deploy an new instance with a network
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 53
|
template_id: 53
|
||||||
networks:
|
networks:
|
||||||
- NETWORK_ID: 27
|
- NETWORK_ID: 27
|
||||||
register: vm
|
register: vm
|
||||||
|
|
||||||
# Wait for SSH to come up
|
- name: Wait for SSH to come up
|
||||||
- wait_for_connection:
|
wait_for_connection:
|
||||||
delegate_to: '{{ vm.instances[0].networks[0].ip }}'
|
delegate_to: '{{ vm.instances[0].networks[0].ip }}'
|
||||||
|
|
||||||
# Terminate VMs by ids
|
- name: Terminate VMs by ids
|
||||||
- one_vm:
|
one_vm:
|
||||||
instance_ids:
|
instance_ids:
|
||||||
- 153
|
- 153
|
||||||
- 160
|
- 160
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Reboot all VMs that have labels 'foo' and 'app1'
|
- name: Reboot all VMs that have labels 'foo' and 'app1'
|
||||||
- one_vm:
|
one_vm:
|
||||||
labels:
|
labels:
|
||||||
- foo
|
- foo
|
||||||
- app1
|
- app1
|
||||||
state: rebooted
|
state: rebooted
|
||||||
|
|
||||||
# Fetch all VMs that have name 'foo' and attribute 'app: bar'
|
- name: "Fetch all VMs that have name 'foo' and attribute 'app: bar'"
|
||||||
- one_vm:
|
one_vm:
|
||||||
attributes:
|
attributes:
|
||||||
name: foo
|
name: foo
|
||||||
app: bar
|
app: bar
|
||||||
register: results
|
register: results
|
||||||
|
|
||||||
# Deploy 2 new instances with labels 'foo1' and 'foo2'
|
- name: Deploy 2 new instances with labels 'foo1' and 'foo2'
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_name: app_template
|
template_name: app_template
|
||||||
labels:
|
labels:
|
||||||
- foo1
|
- foo1
|
||||||
- foo2
|
- foo2
|
||||||
count: 2
|
count: 2
|
||||||
|
|
||||||
# Enforce that only 1 instance with label 'foo1' will be running
|
- name: Enforce that only 1 instance with label 'foo1' will be running
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_name: app_template
|
template_name: app_template
|
||||||
labels:
|
labels:
|
||||||
- foo1
|
- foo1
|
||||||
|
@ -361,22 +365,22 @@ EXAMPLES = '''
|
||||||
count_labels:
|
count_labels:
|
||||||
- foo1
|
- foo1
|
||||||
|
|
||||||
# Terminate all instances that have attribute foo
|
- name: Terminate all instances that have attribute foo
|
||||||
- one_vm:
|
one_vm:
|
||||||
template_id: 53
|
template_id: 53
|
||||||
exact_count: 0
|
exact_count: 0
|
||||||
count_attributes:
|
count_attributes:
|
||||||
foo:
|
foo:
|
||||||
|
|
||||||
# Power-off the VM and save VM's disk with id=0 to the image with name 'foo-image'
|
- name: "Power-off the VM and save VM's disk with id=0 to the image with name 'foo-image'"
|
||||||
- one_vm:
|
one_vm:
|
||||||
instance_ids: 351
|
instance_ids: 351
|
||||||
state: poweredoff
|
state: poweredoff
|
||||||
disk_saveas:
|
disk_saveas:
|
||||||
name: foo-image
|
name: foo-image
|
||||||
|
|
||||||
# Save VM's disk with id=1 to the image with name 'bar-image'
|
- name: "Save VM's disk with id=1 to the image with name 'bar-image'"
|
||||||
- one_vm:
|
one_vm:
|
||||||
instance_ids: 351
|
instance_ids: 351
|
||||||
disk_saveas:
|
disk_saveas:
|
||||||
name: bar-image
|
name: bar-image
|
||||||
|
|
|
@ -69,9 +69,8 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Adds or modify the backend '212.1.1.1' to a
|
- name: Adds or modify the backend '212.1.1.1' to a loadbalancing 'ip-1.1.1.1'
|
||||||
# loadbalancing 'ip-1.1.1.1'
|
ovh_ip_loadbalancing:
|
||||||
- ovh_ip_loadbalancing:
|
|
||||||
name: ip-1.1.1.1
|
name: ip-1.1.1.1
|
||||||
backend: 212.1.1.1
|
backend: 212.1.1.1
|
||||||
state: present
|
state: present
|
||||||
|
@ -82,8 +81,8 @@ EXAMPLES = '''
|
||||||
application_secret: yoursecret
|
application_secret: yoursecret
|
||||||
consumer_key: yourconsumerkey
|
consumer_key: yourconsumerkey
|
||||||
|
|
||||||
# Removes a backend '212.1.1.1' from a loadbalancing 'ip-1.1.1.1'
|
- name: Removes a backend '212.1.1.1' from a loadbalancing 'ip-1.1.1.1'
|
||||||
- ovh_ip_loadbalancing:
|
ovh_ip_loadbalancing:
|
||||||
name: ip-1.1.1.1
|
name: ip-1.1.1.1
|
||||||
backend: 212.1.1.1
|
backend: 212.1.1.1
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -46,27 +46,26 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# basic usage, using auth from /etc/ovh.conf
|
- name: Basic usage, using auth from /etc/ovh.conf
|
||||||
- ovh_monthly_billing:
|
ovh_monthly_billing:
|
||||||
project_id: 0c727a20aa144485b70c44dee9123b46
|
project_id: 0c727a20aa144485b70c44dee9123b46
|
||||||
instance_id: 8fa89ad2-8f08-4220-9fa4-9695ea23e948
|
instance_id: 8fa89ad2-8f08-4220-9fa4-9695ea23e948
|
||||||
|
|
||||||
# a bit more more complex
|
# Get openstack cloud ID and instance ID, OVH use them in its API
|
||||||
# get openstack cloud ID and instance ID, OVH use them in its API
|
- name: Get openstack cloud ID and instance ID
|
||||||
- os_server_info:
|
os_server_info:
|
||||||
cloud: myProjectName
|
cloud: myProjectName
|
||||||
region_name: myRegionName
|
region_name: myRegionName
|
||||||
server: myServerName
|
server: myServerName
|
||||||
# force run even in check_mode
|
register: openstack_servers
|
||||||
check_mode: no
|
|
||||||
|
|
||||||
# use theses IDs
|
- name: Use IDs
|
||||||
- ovh_monthly_billing:
|
ovh_monthly_billing:
|
||||||
project_id: "{{ openstack_servers.0.tenant_id }}"
|
project_id: "{{ openstack_servers.0.tenant_id }}"
|
||||||
instance_id: "{{ openstack_servers.0.id }}"
|
instance_id: "{{ openstack_servers.0.id }}"
|
||||||
application_key: yourkey
|
application_key: yourkey
|
||||||
application_secret: yoursecret
|
application_secret: yoursecret
|
||||||
consumer_key: yourconsumerkey
|
consumer_key: yourconsumerkey
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = '''
|
||||||
|
|
|
@ -58,36 +58,47 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all affinity labels, which names start with C(label):
|
- name: Gather information about all affinity labels, which names start with label
|
||||||
- ovirt_affinity_label_info:
|
ovirt_affinity_label_info:
|
||||||
name: label*
|
name: label*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_affinity_labels }}"
|
msg: "{{ result.ovirt_affinity_labels }}"
|
||||||
|
|
||||||
# Gather information about all affinity labels, which are assigned to VMs
|
- name: >
|
||||||
# which names start with C(postgres):
|
Gather information about all affinity labels, which are assigned to VMs
|
||||||
- ovirt_affinity_label_info:
|
which names start with postgres
|
||||||
|
ovirt_affinity_label_info:
|
||||||
vm: postgres*
|
vm: postgres*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_affinity_labels }}"
|
msg: "{{ result.ovirt_affinity_labels }}"
|
||||||
|
|
||||||
# Gather information about all affinity labels, which are assigned to hosts
|
- name: >
|
||||||
# which names start with C(west):
|
Gather information about all affinity labels, which are assigned to hosts
|
||||||
- ovirt_affinity_label_info:
|
which names start with west
|
||||||
|
ovirt_affinity_label_info:
|
||||||
host: west*
|
host: west*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_affinity_labels }}"
|
msg: "{{ result.ovirt_affinity_labels }}"
|
||||||
|
|
||||||
# Gather information about all affinity labels, which are assigned to hosts
|
- name: >
|
||||||
# which names start with C(west) or VMs which names start with C(postgres):
|
Gather information about all affinity labels, which are assigned to hosts
|
||||||
- ovirt_affinity_label_info:
|
which names start with west or VMs which names start with postgres
|
||||||
|
ovirt_affinity_label_info:
|
||||||
host: west*
|
host: west*
|
||||||
vm: postgres*
|
vm: postgres*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_affinity_labels }}"
|
msg: "{{ result.ovirt_affinity_labels }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,12 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information oVirt API:
|
- name: Gather information oVirt API
|
||||||
- ovirt_api_info:
|
ovirt_api_info:
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_api }}"
|
msg: "{{ result.ovirt_api }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -54,12 +54,14 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all clusters which names start with C<production>:
|
- name: Gather information about all clusters which names start with production
|
||||||
- ovirt_cluster_info:
|
ovirt_cluster_info:
|
||||||
pattern:
|
pattern:
|
||||||
name: 'production*'
|
name: 'production*'
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_clusters }}"
|
msg: "{{ result.ovirt_clusters }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -38,11 +38,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all data centers which names start with C(production):
|
- name: Gather information about all data centers which names start with production
|
||||||
- ovirt_datacenter_info:
|
ovirt_datacenter_info:
|
||||||
pattern: name=production*
|
pattern: name=production*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_datacenters }}"
|
msg: "{{ result.ovirt_datacenters }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -54,11 +54,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all Disks which names start with C(centos)
|
- name: Gather information about all Disks which names start with centos
|
||||||
- ovirt_disk_info:
|
ovirt_disk_info:
|
||||||
pattern: name=centos*
|
pattern: name=centos*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_disks }}"
|
msg: "{{ result.ovirt_disks }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -57,12 +57,14 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all image external providers named C<glance>:
|
- name: Gather information about all image external providers named glance
|
||||||
- ovirt_external_provider_info:
|
ovirt_external_provider_info:
|
||||||
type: os_image
|
type: os_image
|
||||||
name: glance
|
name: glance
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_external_providers }}"
|
msg: "{{ result.ovirt_external_providers }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -53,11 +53,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all groups which names start with C(admin):
|
- name: Gather information about all groups which names start with admin
|
||||||
- ovirt_group_info:
|
ovirt_group_info:
|
||||||
pattern: name=admin*
|
pattern: name=admin*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_groups }}"
|
msg: "{{ result.ovirt_groups }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -50,19 +50,23 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all hosts which names start with C(host) and
|
- name: Gather information about all hosts which names start with host and belong to data center west
|
||||||
# belong to data center C(west):
|
ovirt_host_info:
|
||||||
- ovirt_host_info:
|
|
||||||
pattern: name=host* and datacenter=west
|
pattern: name=host* and datacenter=west
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_hosts }}"
|
msg: "{{ result.ovirt_hosts }}"
|
||||||
# All hosts with cluster version 4.2:
|
|
||||||
- ovirt_host_info:
|
- name: Gather information about all hosts with cluster version 4.2
|
||||||
|
ovirt_host_info:
|
||||||
pattern: name=host*
|
pattern: name=host*
|
||||||
cluster_version: "4.2"
|
cluster_version: "4.2"
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_hosts }}"
|
msg: "{{ result.ovirt_hosts }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -66,14 +66,16 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about HostStorages with specified target and address:
|
- name: Gather information about HostStorages with specified target and address
|
||||||
- ovirt_host_storage_info:
|
ovirt_host_storage_info:
|
||||||
host: myhost
|
host: myhost
|
||||||
iscsi:
|
iscsi:
|
||||||
target: iqn.2016-08-09.domain-01:nickname
|
target: iqn.2016-08-09.domain-01:nickname
|
||||||
address: 10.34.63.204
|
address: 10.34.63.204
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_host_storages }}"
|
msg: "{{ result.ovirt_host_storages }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -54,11 +54,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all networks which names start with C(vlan1):
|
- name: Gather information about all networks which names start with vlan1
|
||||||
- ovirt_network_info:
|
ovirt_network_info:
|
||||||
pattern: name=vlan1*
|
pattern: name=vlan1*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_networks }}"
|
msg: "{{ result.ovirt_networks }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -56,12 +56,14 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all NICs which names start with C(eth) for VM named C(centos7):
|
- name: Gather information about all NICs which names start with eth for VM named centos7
|
||||||
- ovirt_nic_info:
|
ovirt_nic_info:
|
||||||
vm: centos7
|
vm: centos7
|
||||||
name: eth*
|
name: eth*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_nics }}"
|
msg: "{{ result.ovirt_nics }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -64,12 +64,14 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all permissions of user with username C(john):
|
- name: Gather information about all permissions of user with username john
|
||||||
- ovirt_permission_info:
|
ovirt_permission_info:
|
||||||
user_name: john
|
user_name: john
|
||||||
authz_name: example.com-authz
|
authz_name: example.com-authz
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_permissions }}"
|
msg: "{{ result.ovirt_permissions }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -56,12 +56,14 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about quota named C<myquota> in Default datacenter:
|
- name: Gather information about quota named C<myquota> in Default datacenter
|
||||||
- ovirt_quota_info:
|
ovirt_quota_info:
|
||||||
data_center: Default
|
data_center: Default
|
||||||
name: myquota
|
name: myquota
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_quotas }}"
|
msg: "{{ result.ovirt_quotas }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -56,11 +56,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all scheduling policies with name InClusterUpgrade:
|
- name: Gather information about all scheduling policies with name InClusterUpgrade
|
||||||
- ovirt_scheduling_policy_info:
|
ovirt_scheduling_policy_info:
|
||||||
name: InClusterUpgrade
|
name: InClusterUpgrade
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_scheduling_policies }}"
|
msg: "{{ result.ovirt_scheduling_policies }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -44,12 +44,14 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all snapshots which description start with C(update) for VM named C(centos7):
|
- name: Gather information about all snapshots which description start with update for VM named centos7
|
||||||
- ovirt_snapshot_info:
|
ovirt_snapshot_info:
|
||||||
vm: centos7
|
vm: centos7
|
||||||
description: update*
|
description: update*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_snapshots }}"
|
msg: "{{ result.ovirt_snapshots }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -54,12 +54,15 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all storage domains which names start with C(data) and
|
- name: >
|
||||||
# belong to data center C(west):
|
Gather information about all storage domains which names
|
||||||
- ovirt_storage_domain_info:
|
start with data and belong to data center west
|
||||||
|
ovirt_storage_domain_info:
|
||||||
pattern: name=data* and datacenter=west
|
pattern: name=data* and datacenter=west
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_storage_domains }}"
|
msg: "{{ result.ovirt_storage_domains }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -61,12 +61,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all Templates which relate to a storage domain and
|
- name: Gather information about all templates which relate to a storage domain and are unregistered
|
||||||
# are unregistered:
|
ovirt_storage_template_info:
|
||||||
- ovirt_storage_template_info:
|
unregistered: yes
|
||||||
unregistered=True
|
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_storage_templates }}"
|
msg: "{{ result.ovirt_storage_templates }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -61,12 +61,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all VMs which relate to a storage domain and
|
- name: Gather information about all VMs which relate to a storage domain and are unregistered
|
||||||
# are unregistered:
|
ovirt_vms_info:
|
||||||
- ovirt_vms_info:
|
unregistered: yes
|
||||||
unregistered=True
|
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_storage_vms }}"
|
msg: "{{ result.ovirt_storage_vms }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -58,25 +58,31 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all tags, which names start with C(tag):
|
- name: Gather information about all tags, which names start with tag
|
||||||
- ovirt_tag_info:
|
ovirt_tag_info:
|
||||||
name: tag*
|
name: tag*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_tags }}"
|
msg: "{{ result.ovirt_tags }}"
|
||||||
|
|
||||||
# Gather information about all tags, which are assigned to VM C(postgres):
|
- name: Gather information about all tags, which are assigned to VM postgres
|
||||||
- ovirt_tag_info:
|
ovirt_tag_info:
|
||||||
vm: postgres
|
vm: postgres
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_tags }}"
|
msg: "{{ result.ovirt_tags }}"
|
||||||
|
|
||||||
# Gather information about all tags, which are assigned to host C(west):
|
- name: Gather information about all tags, which are assigned to host west
|
||||||
- ovirt_tag_info:
|
ovirt_tag_info:
|
||||||
host: west
|
host: west
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_tags }}"
|
msg: "{{ result.ovirt_tags }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -54,12 +54,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all templates which names start with C(centos) and
|
- name: Gather information about all templates which names start with centos and belongs to data center west
|
||||||
# belongs to data center C(west):
|
ovirt_template_info:
|
||||||
- ovirt_template_info:
|
|
||||||
pattern: name=centos* and datacenter=west
|
pattern: name=centos* and datacenter=west
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_templates }}"
|
msg: "{{ result.ovirt_templates }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -53,11 +53,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all users which first names start with C(john):
|
- name: Gather information about all users which first names start with john
|
||||||
- ovirt_user_info:
|
ovirt_user_info:
|
||||||
pattern: name=john*
|
pattern: name=john*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_users }}"
|
msg: "{{ result.ovirt_users }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -73,20 +73,23 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all VMs which names start with C(centos) and
|
- name: Gather information about all VMs which names start with centos and belong to cluster west
|
||||||
# belong to cluster C(west):
|
ovirt_vm_info:
|
||||||
- ovirt_vm_info:
|
|
||||||
pattern: name=centos* and cluster=west
|
pattern: name=centos* and cluster=west
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_vms }}"
|
msg: "{{ result.ovirt_vms }}"
|
||||||
|
|
||||||
# Gather info about next run configuration of virtual machine named myvm
|
- name: Gather info about next run configuration of virtual machine named myvm
|
||||||
- ovirt_vm_info:
|
ovirt_vm_info:
|
||||||
pattern: name=myvm
|
pattern: name=myvm
|
||||||
next_run: true
|
next_run: true
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_vms[0] }}"
|
msg: "{{ result.ovirt_vms[0] }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -53,11 +53,13 @@ EXAMPLES = '''
|
||||||
# Examples don't contain auth parameter for simplicity,
|
# Examples don't contain auth parameter for simplicity,
|
||||||
# look at ovirt_auth module to see how to reuse authentication:
|
# look at ovirt_auth module to see how to reuse authentication:
|
||||||
|
|
||||||
# Gather information about all vm pools which names start with C(centos):
|
- name: Gather information about all vm pools which names start with centos
|
||||||
- ovirt_vmpool_info:
|
ovirt_vmpool_info:
|
||||||
pattern: name=centos*
|
pattern: name=centos*
|
||||||
register: result
|
register: result
|
||||||
- debug:
|
|
||||||
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
msg: "{{ result.ovirt_vm_pools }}"
|
msg: "{{ result.ovirt_vm_pools }}"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -66,16 +66,16 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
# Store a value "bar" under the key "foo" for a cluster located "http://localhost:2379"
|
- name: Store a value "bar" under the key "foo" for a cluster located "http://localhost:2379"
|
||||||
- etcd3:
|
etcd3:
|
||||||
key: "foo"
|
key: "foo"
|
||||||
value: "baz3"
|
value: "baz3"
|
||||||
host: "localhost"
|
host: "localhost"
|
||||||
port: 2379
|
port: 2379
|
||||||
state: "present"
|
state: "present"
|
||||||
|
|
||||||
# Authenticate using user/password combination with a timeout of 10 seconds
|
- name: Authenticate using user/password combination with a timeout of 10 seconds
|
||||||
- etcd3:
|
etcd3:
|
||||||
key: "foo"
|
key: "foo"
|
||||||
value: "baz3"
|
value: "baz3"
|
||||||
state: "present"
|
state: "present"
|
||||||
|
@ -83,8 +83,8 @@ EXAMPLES = """
|
||||||
password: "password123"
|
password: "password123"
|
||||||
timeout: 10
|
timeout: 10
|
||||||
|
|
||||||
# Authenticate using TLS certificates
|
- name: Authenticate using TLS certificates
|
||||||
- etcd3:
|
etcd3:
|
||||||
key: "foo"
|
key: "foo"
|
||||||
value: "baz3"
|
value: "baz3"
|
||||||
state: "present"
|
state: "present"
|
||||||
|
|
|
@ -74,28 +74,28 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Install Elasticsearch Head plugin in Elasticsearch 2.x
|
- name: Install Elasticsearch Head plugin in Elasticsearch 2.x
|
||||||
- elasticsearch_plugin:
|
elasticsearch_plugin:
|
||||||
name: mobz/elasticsearch-head
|
name: mobz/elasticsearch-head
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Install a specific version of Elasticsearch Head in Elasticsearch 2.x
|
- name: Install a specific version of Elasticsearch Head in Elasticsearch 2.x
|
||||||
- elasticsearch_plugin:
|
elasticsearch_plugin:
|
||||||
name: mobz/elasticsearch-head
|
name: mobz/elasticsearch-head
|
||||||
version: 2.0.0
|
version: 2.0.0
|
||||||
|
|
||||||
# Uninstall Elasticsearch head plugin in Elasticsearch 2.x
|
- name: Uninstall Elasticsearch head plugin in Elasticsearch 2.x
|
||||||
- elasticsearch_plugin:
|
elasticsearch_plugin:
|
||||||
name: mobz/elasticsearch-head
|
name: mobz/elasticsearch-head
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Install a specific plugin in Elasticsearch >= 5.0
|
- name: Install a specific plugin in Elasticsearch >= 5.0
|
||||||
- elasticsearch_plugin:
|
elasticsearch_plugin:
|
||||||
name: analysis-icu
|
name: analysis-icu
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Install the ingest-geoip plugin with a forced installation
|
- name: Install the ingest-geoip plugin with a forced installation
|
||||||
- elasticsearch_plugin:
|
elasticsearch_plugin:
|
||||||
name: ingest-geoip
|
name: ingest-geoip
|
||||||
state: present
|
state: present
|
||||||
force: yes
|
force: yes
|
||||||
|
|
|
@ -54,17 +54,17 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Join's a Riak node to another node
|
- name: "Join's a Riak node to another node"
|
||||||
- riak:
|
riak:
|
||||||
command: join
|
command: join
|
||||||
target_node: riak@10.1.1.1
|
target_node: riak@10.1.1.1
|
||||||
|
|
||||||
# Wait for handoffs to finish. Use with async and poll.
|
- name: Wait for handoffs to finish. Use with async and poll.
|
||||||
- riak:
|
riak:
|
||||||
wait_for_handoffs: yes
|
wait_for_handoffs: yes
|
||||||
|
|
||||||
# Wait for riak_kv service to startup
|
- name: Wait for riak_kv service to startup
|
||||||
- riak:
|
riak:
|
||||||
wait_for_service: kv
|
wait_for_service: kv
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -59,17 +59,19 @@ author: Vedit Firat Arig (@vedit)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create a new database with name 'jackdata'
|
- name: Create a new database with name 'jackdata'
|
||||||
- mssql_db:
|
mssql_db:
|
||||||
name: jackdata
|
name: jackdata
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Copy database dump file to remote host and restore it to database 'my_db'
|
# Copy database dump file to remote host and restore it to database 'my_db'
|
||||||
- copy:
|
- name: Copy database dump file to remote host
|
||||||
|
copy:
|
||||||
src: dump.sql
|
src: dump.sql
|
||||||
dest: /tmp
|
dest: /tmp
|
||||||
|
|
||||||
- mssql_db:
|
- name: Restore the dump file to database 'my_db'
|
||||||
|
mssql_db:
|
||||||
name: my_db
|
name: my_db
|
||||||
state: import
|
state: import
|
||||||
target: /tmp/dump.sql
|
target: /tmp/dump.sql
|
||||||
|
|
|
@ -99,7 +99,8 @@ EXAMPLES = '''
|
||||||
# runtime in a single batch using the M(proxysql_manage_config) module). It
|
# runtime in a single batch using the M(proxysql_manage_config) module). It
|
||||||
# uses supplied credentials to connect to the proxysql admin interface.
|
# uses supplied credentials to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_backend_servers:
|
- name: Add a server
|
||||||
|
proxysql_backend_servers:
|
||||||
login_user: 'admin'
|
login_user: 'admin'
|
||||||
login_password: 'admin'
|
login_password: 'admin'
|
||||||
hostname: 'mysql01'
|
hostname: 'mysql01'
|
||||||
|
@ -110,7 +111,8 @@ EXAMPLES = '''
|
||||||
# dynamically loads the mysql server config to runtime. It uses credentials
|
# dynamically loads the mysql server config to runtime. It uses credentials
|
||||||
# in a supplied config file to connect to the proxysql admin interface.
|
# in a supplied config file to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_backend_servers:
|
- name: Remove a server
|
||||||
|
proxysql_backend_servers:
|
||||||
config_file: '~/proxysql.cnf'
|
config_file: '~/proxysql.cnf'
|
||||||
hostname: 'mysql02'
|
hostname: 'mysql02'
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -37,7 +37,8 @@ EXAMPLES = '''
|
||||||
# runtime. It uses supplied credentials to connect to the proxysql admin
|
# runtime. It uses supplied credentials to connect to the proxysql admin
|
||||||
# interface.
|
# interface.
|
||||||
|
|
||||||
- proxysql_global_variables:
|
- name: Set the value of a variable
|
||||||
|
proxysql_global_variables:
|
||||||
login_user: 'admin'
|
login_user: 'admin'
|
||||||
login_password: 'admin'
|
login_password: 'admin'
|
||||||
variable: 'mysql-max_connections'
|
variable: 'mysql-max_connections'
|
||||||
|
@ -46,7 +47,8 @@ EXAMPLES = '''
|
||||||
# This example gets the value of a variable. It uses credentials in a
|
# This example gets the value of a variable. It uses credentials in a
|
||||||
# supplied config file to connect to the proxysql admin interface.
|
# supplied config file to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_global_variables:
|
- name: Get the value of a variable
|
||||||
|
proxysql_global_variables:
|
||||||
config_file: '~/proxysql.cnf'
|
config_file: '~/proxysql.cnf'
|
||||||
variable: 'mysql-default_query_delay'
|
variable: 'mysql-default_query_delay'
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -61,7 +61,8 @@ EXAMPLES = '''
|
||||||
# This example saves the mysql users config from memory to disk. It uses
|
# This example saves the mysql users config from memory to disk. It uses
|
||||||
# supplied credentials to connect to the proxysql admin interface.
|
# supplied credentials to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_manage_config:
|
- name: Save the mysql users config from memory to disk
|
||||||
|
proxysql_manage_config:
|
||||||
login_user: 'admin'
|
login_user: 'admin'
|
||||||
login_password: 'admin'
|
login_password: 'admin'
|
||||||
action: "SAVE"
|
action: "SAVE"
|
||||||
|
@ -69,10 +70,11 @@ EXAMPLES = '''
|
||||||
direction: "FROM"
|
direction: "FROM"
|
||||||
config_layer: "MEMORY"
|
config_layer: "MEMORY"
|
||||||
|
|
||||||
# This example loads the mysql query rules config from memory to to runtime. It
|
# This example loads the mysql query rules config from memory to runtime. It
|
||||||
# uses supplied credentials to connect to the proxysql admin interface.
|
# uses supplied credentials to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_manage_config:
|
- name: Load the mysql query rules config from memory to runtime
|
||||||
|
proxysql_manage_config:
|
||||||
config_file: '~/proxysql.cnf'
|
config_file: '~/proxysql.cnf'
|
||||||
action: "LOAD"
|
action: "LOAD"
|
||||||
config_settings: "MYSQL QUERY RULES"
|
config_settings: "MYSQL QUERY RULES"
|
||||||
|
|
|
@ -94,7 +94,8 @@ EXAMPLES = '''
|
||||||
# runtime in a single batch using the M(proxysql_manage_config) module). It
|
# runtime in a single batch using the M(proxysql_manage_config) module). It
|
||||||
# uses supplied credentials to connect to the proxysql admin interface.
|
# uses supplied credentials to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_mysql_users:
|
- name: Add a user
|
||||||
|
proxysql_mysql_users:
|
||||||
login_user: 'admin'
|
login_user: 'admin'
|
||||||
login_password: 'admin'
|
login_password: 'admin'
|
||||||
username: 'productiondba'
|
username: 'productiondba'
|
||||||
|
@ -105,7 +106,8 @@ EXAMPLES = '''
|
||||||
# dynamically loads the mysql user config to runtime. It uses credentials
|
# dynamically loads the mysql user config to runtime. It uses credentials
|
||||||
# in a supplied config file to connect to the proxysql admin interface.
|
# in a supplied config file to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_mysql_users:
|
- name: Remove a user
|
||||||
|
proxysql_mysql_users:
|
||||||
config_file: '~/proxysql.cnf'
|
config_file: '~/proxysql.cnf'
|
||||||
username: 'mysqlboy'
|
username: 'mysqlboy'
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -153,7 +153,8 @@ EXAMPLES = '''
|
||||||
# single batch using the M(proxysql_manage_config) module). It uses supplied
|
# single batch using the M(proxysql_manage_config) module). It uses supplied
|
||||||
# credentials to connect to the proxysql admin interface.
|
# credentials to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_query_rules:
|
- name: Add a rule
|
||||||
|
proxysql_query_rules:
|
||||||
login_user: admin
|
login_user: admin
|
||||||
login_password: admin
|
login_password: admin
|
||||||
username: 'guest_ro'
|
username: 'guest_ro'
|
||||||
|
@ -169,7 +170,8 @@ EXAMPLES = '''
|
||||||
# config to runtime. It uses credentials in a supplied config file to connect
|
# config to runtime. It uses credentials in a supplied config file to connect
|
||||||
# to the proxysql admin interface.
|
# to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_query_rules:
|
- name: Remove rules
|
||||||
|
proxysql_query_rules:
|
||||||
config_file: '~/proxysql.cnf'
|
config_file: '~/proxysql.cnf'
|
||||||
username: 'guest_ro'
|
username: 'guest_ro'
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -51,7 +51,8 @@ EXAMPLES = '''
|
||||||
# M(proxysql_manage_config) module). It uses supplied credentials to connect
|
# M(proxysql_manage_config) module). It uses supplied credentials to connect
|
||||||
# to the proxysql admin interface.
|
# to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_replication_hostgroups:
|
- name: Add a replication hostgroup
|
||||||
|
proxysql_replication_hostgroups:
|
||||||
login_user: 'admin'
|
login_user: 'admin'
|
||||||
login_password: 'admin'
|
login_password: 'admin'
|
||||||
writer_hostgroup: 1
|
writer_hostgroup: 1
|
||||||
|
@ -64,7 +65,8 @@ EXAMPLES = '''
|
||||||
# credentials in a supplied config file to connect to the proxysql admin
|
# credentials in a supplied config file to connect to the proxysql admin
|
||||||
# interface.
|
# interface.
|
||||||
|
|
||||||
- proxysql_replication_hostgroups:
|
- name: Remove a replication hostgroup
|
||||||
|
proxysql_replication_hostgroups:
|
||||||
config_file: '~/proxysql.cnf'
|
config_file: '~/proxysql.cnf'
|
||||||
writer_hostgroup: 3
|
writer_hostgroup: 3
|
||||||
reader_hostgroup: 4
|
reader_hostgroup: 4
|
||||||
|
|
|
@ -75,7 +75,8 @@ EXAMPLES = '''
|
||||||
# runtime in a single batch using the M(proxysql_manage_config) module). It
|
# runtime in a single batch using the M(proxysql_manage_config) module). It
|
||||||
# uses supplied credentials to connect to the proxysql admin interface.
|
# uses supplied credentials to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_scheduler:
|
- name: Add a schedule
|
||||||
|
proxysql_scheduler:
|
||||||
login_user: 'admin'
|
login_user: 'admin'
|
||||||
login_password: 'admin'
|
login_password: 'admin'
|
||||||
interval_ms: 1000
|
interval_ms: 1000
|
||||||
|
@ -87,7 +88,8 @@ EXAMPLES = '''
|
||||||
# dynamically loads the scheduler config to runtime. It uses credentials
|
# dynamically loads the scheduler config to runtime. It uses credentials
|
||||||
# in a supplied config file to connect to the proxysql admin interface.
|
# in a supplied config file to connect to the proxysql admin interface.
|
||||||
|
|
||||||
- proxysql_scheduler:
|
- name: Remove a schedule
|
||||||
|
proxysql_scheduler:
|
||||||
config_file: '~/proxysql.cnf'
|
config_file: '~/proxysql.cnf'
|
||||||
filename: "/opt/old_script.py"
|
filename: "/opt/old_script.py"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -183,16 +183,16 @@ author: "Brice Burgess (@briceburg)"
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# fetch my.com domain records
|
- name: Fetch my.com domain records
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
state: present
|
state: present
|
||||||
register: response
|
register: response
|
||||||
|
|
||||||
# create / ensure the presence of a record
|
- name: Create a record
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -201,8 +201,8 @@ EXAMPLES = '''
|
||||||
record_type: A
|
record_type: A
|
||||||
record_value: 127.0.0.1
|
record_value: 127.0.0.1
|
||||||
|
|
||||||
# update the previously created record
|
- name: Update the previously created record
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -210,8 +210,8 @@ EXAMPLES = '''
|
||||||
record_name: test
|
record_name: test
|
||||||
record_value: 192.0.2.23
|
record_value: 192.0.2.23
|
||||||
|
|
||||||
# fetch a specific record
|
- name: Fetch a specific record
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -219,8 +219,8 @@ EXAMPLES = '''
|
||||||
record_name: test
|
record_name: test
|
||||||
register: response
|
register: response
|
||||||
|
|
||||||
# delete a record / ensure it is absent
|
- name: Delete a record
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -228,8 +228,8 @@ EXAMPLES = '''
|
||||||
state: absent
|
state: absent
|
||||||
record_name: test
|
record_name: test
|
||||||
|
|
||||||
# Add a failover
|
- name: Add a failover
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -241,7 +241,8 @@ EXAMPLES = '''
|
||||||
ip1: 127.0.0.2
|
ip1: 127.0.0.2
|
||||||
ip2: 127.0.0.3
|
ip2: 127.0.0.3
|
||||||
|
|
||||||
- dnsmadeeasy:
|
- name: Add a failover
|
||||||
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -256,8 +257,8 @@ EXAMPLES = '''
|
||||||
ip4: 127.0.0.5
|
ip4: 127.0.0.5
|
||||||
ip5: 127.0.0.6
|
ip5: 127.0.0.6
|
||||||
|
|
||||||
# Add a monitor
|
- name: Add a monitor
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -273,8 +274,8 @@ EXAMPLES = '''
|
||||||
systemDescription: Monitor Test A record
|
systemDescription: Monitor Test A record
|
||||||
contactList: my contact list
|
contactList: my contact list
|
||||||
|
|
||||||
# Add a monitor with http options
|
- name: Add a monitor with http options
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -293,8 +294,8 @@ EXAMPLES = '''
|
||||||
httpFile: example
|
httpFile: example
|
||||||
httpQueryString: some string
|
httpQueryString: some string
|
||||||
|
|
||||||
# Add a monitor and a failover
|
- name: Add a monitor and a failover
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -312,8 +313,8 @@ EXAMPLES = '''
|
||||||
systemDescription: monitoring my.com status
|
systemDescription: monitoring my.com status
|
||||||
contactList: emergencycontacts
|
contactList: emergencycontacts
|
||||||
|
|
||||||
# Remove a failover
|
- name: Remove a failover
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
@ -323,8 +324,8 @@ EXAMPLES = '''
|
||||||
record_value: 127.0.0.1
|
record_value: 127.0.0.1
|
||||||
failover: no
|
failover: no
|
||||||
|
|
||||||
# Remove a monitor
|
- name: Remove a monitor
|
||||||
- dnsmadeeasy:
|
dnsmadeeasy:
|
||||||
account_key: key
|
account_key: key
|
||||||
account_secret: secret
|
account_secret: secret
|
||||||
domain: my.com
|
domain: my.com
|
||||||
|
|
|
@ -117,68 +117,68 @@ requirements:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Install "nmap"
|
- name: Install nmap
|
||||||
- zypper:
|
zypper:
|
||||||
name: nmap
|
name: nmap
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Install apache2 with recommended packages
|
- name: Install apache2 with recommended packages
|
||||||
- zypper:
|
zypper:
|
||||||
name: apache2
|
name: apache2
|
||||||
state: present
|
state: present
|
||||||
disable_recommends: no
|
disable_recommends: no
|
||||||
|
|
||||||
# Apply a given patch
|
- name: Apply a given patch
|
||||||
- zypper:
|
zypper:
|
||||||
name: openSUSE-2016-128
|
name: openSUSE-2016-128
|
||||||
state: present
|
state: present
|
||||||
type: patch
|
type: patch
|
||||||
|
|
||||||
# Remove the "nmap" package
|
- name: Remove the nmap package
|
||||||
- zypper:
|
zypper:
|
||||||
name: nmap
|
name: nmap
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Install the nginx rpm from a remote repo
|
- name: Install the nginx rpm from a remote repo
|
||||||
- zypper:
|
zypper:
|
||||||
name: 'http://nginx.org/packages/sles/12/x86_64/RPMS/nginx-1.8.0-1.sles12.ngx.x86_64.rpm'
|
name: 'http://nginx.org/packages/sles/12/x86_64/RPMS/nginx-1.8.0-1.sles12.ngx.x86_64.rpm'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Install local rpm file
|
- name: Install local rpm file
|
||||||
- zypper:
|
zypper:
|
||||||
name: /tmp/fancy-software.rpm
|
name: /tmp/fancy-software.rpm
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Update all packages
|
- name: Update all packages
|
||||||
- zypper:
|
zypper:
|
||||||
name: '*'
|
name: '*'
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
# Apply all available patches
|
- name: Apply all available patches
|
||||||
- zypper:
|
zypper:
|
||||||
name: '*'
|
name: '*'
|
||||||
state: latest
|
state: latest
|
||||||
type: patch
|
type: patch
|
||||||
|
|
||||||
# Perform a dist-upgrade with additional arguments
|
- name: Perform a dist-upgrade with additional arguments
|
||||||
- zypper:
|
zypper:
|
||||||
name: '*'
|
name: '*'
|
||||||
state: dist-upgrade
|
state: dist-upgrade
|
||||||
extra_args: '--no-allow-vendor-change --allow-arch-change'
|
extra_args: '--no-allow-vendor-change --allow-arch-change'
|
||||||
|
|
||||||
# Refresh repositories and update package "openssl"
|
- name: Refresh repositories and update package openssl
|
||||||
- zypper:
|
zypper:
|
||||||
name: openssl
|
name: openssl
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
||||||
# Install specific version (possible comparisons: <, >, <=, >=, =)
|
- name: "Install specific version (possible comparisons: <, >, <=, >=, =)"
|
||||||
- zypper:
|
zypper:
|
||||||
name: 'docker>=1.10'
|
name: 'docker>=1.10'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Wait 20 seconds to acquire the lock before failing
|
- name: Wait 20 seconds to acquire the lock before failing
|
||||||
- zypper:
|
zypper:
|
||||||
name: mosh
|
name: mosh
|
||||||
state: present
|
state: present
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -84,34 +84,34 @@ requirements:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Add NVIDIA repository for graphics drivers
|
- name: Add NVIDIA repository for graphics drivers
|
||||||
- zypper_repository:
|
zypper_repository:
|
||||||
name: nvidia-repo
|
name: nvidia-repo
|
||||||
repo: 'ftp://download.nvidia.com/opensuse/12.2'
|
repo: 'ftp://download.nvidia.com/opensuse/12.2'
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Remove NVIDIA repository
|
- name: Remove NVIDIA repository
|
||||||
- zypper_repository:
|
zypper_repository:
|
||||||
name: nvidia-repo
|
name: nvidia-repo
|
||||||
repo: 'ftp://download.nvidia.com/opensuse/12.2'
|
repo: 'ftp://download.nvidia.com/opensuse/12.2'
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
# Add python development repository
|
- name: Add python development repository
|
||||||
- zypper_repository:
|
zypper_repository:
|
||||||
repo: 'http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo'
|
repo: 'http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11_SP3/devel:languages:python.repo'
|
||||||
|
|
||||||
# Refresh all repos
|
- name: Refresh all repos
|
||||||
- zypper_repository:
|
zypper_repository:
|
||||||
repo: '*'
|
repo: '*'
|
||||||
runrefresh: yes
|
runrefresh: yes
|
||||||
|
|
||||||
# Add a repo and add it's gpg key
|
- name: Add a repo and add its gpg key
|
||||||
- zypper_repository:
|
zypper_repository:
|
||||||
repo: 'http://download.opensuse.org/repositories/systemsmanagement/openSUSE_Leap_42.1/'
|
repo: 'http://download.opensuse.org/repositories/systemsmanagement/openSUSE_Leap_42.1/'
|
||||||
auto_import_keys: yes
|
auto_import_keys: yes
|
||||||
|
|
||||||
# Force refresh of a repository
|
- name: Force refresh of a repository
|
||||||
- zypper_repository:
|
zypper_repository:
|
||||||
repo: 'http://my_internal_ci_repo/repo'
|
repo: 'http://my_internal_ci_repo/repo'
|
||||||
name: my_ci_repo
|
name: my_ci_repo
|
||||||
state: present
|
state: present
|
||||||
|
|
|
@ -38,13 +38,15 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Gather facts about ZFS pool rpool
|
- name: Gather facts about ZFS pool rpool
|
||||||
- zpool_facts: pool=rpool
|
zpool_facts: pool=rpool
|
||||||
|
|
||||||
# Gather space usage about all imported ZFS pools
|
- name: Gather space usage about all imported ZFS pools
|
||||||
- zpool_facts: properties='free,size'
|
zpool_facts: properties='free,size'
|
||||||
|
|
||||||
- debug: msg='ZFS pool {{ item.name }} has {{ item.free }} free space out of {{ item.size }}.'
|
- name: Print gathered information
|
||||||
|
debug:
|
||||||
|
msg: 'ZFS pool {{ item.name }} has {{ item.free }} free space out of {{ item.size }}.'
|
||||||
with_items: '{{ ansible_zfs_pools }}'
|
with_items: '{{ ansible_zfs_pools }}'
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
|
@ -123,8 +123,8 @@ ifaces:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Set eth1 mtu configuration value to 8000
|
- name: Set eth1 mtu configuration value to 8000
|
||||||
- interfaces_file:
|
interfaces_file:
|
||||||
dest: /etc/network/interfaces.d/eth1.cfg
|
dest: /etc/network/interfaces.d/eth1.cfg
|
||||||
iface: eth1
|
iface: eth1
|
||||||
option: mtu
|
option: mtu
|
||||||
|
|
|
@ -65,21 +65,21 @@ author:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Modify the default user on the system to the guest_u user
|
- name: Modify the default user on the system to the guest_u user
|
||||||
- selogin:
|
selogin:
|
||||||
login: __default__
|
login: __default__
|
||||||
seuser: guest_u
|
seuser: guest_u
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Assign gijoe user on an MLS machine a range and to the staff_u user
|
- name: Assign gijoe user on an MLS machine a range and to the staff_u user
|
||||||
- selogin:
|
selogin:
|
||||||
login: gijoe
|
login: gijoe
|
||||||
seuser: staff_u
|
seuser: staff_u
|
||||||
serange: SystemLow-Secret
|
serange: SystemLow-Secret
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# Assign all users in the engineering group to the staff_u user
|
- name: Assign all users in the engineering group to the staff_u user
|
||||||
- selogin:
|
selogin:
|
||||||
login: '%engineering'
|
login: '%engineering'
|
||||||
seuser: staff_u
|
seuser: staff_u
|
||||||
state: present
|
state: present
|
||||||
|
|
|
@ -61,48 +61,48 @@ options:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Create a jenkins job using basic authentication
|
- name: Create a jenkins job using basic authentication
|
||||||
- jenkins_job:
|
jenkins_job:
|
||||||
config: "{{ lookup('file', 'templates/test.xml') }}"
|
config: "{{ lookup('file', 'templates/test.xml') }}"
|
||||||
name: test
|
name: test
|
||||||
password: admin
|
password: admin
|
||||||
url: http://localhost:8080
|
url: http://localhost:8080
|
||||||
user: admin
|
user: admin
|
||||||
|
|
||||||
# Create a jenkins job using the token
|
- name: Create a jenkins job using the token
|
||||||
- jenkins_job:
|
jenkins_job:
|
||||||
config: "{{ lookup('template', 'templates/test.xml.j2') }}"
|
config: "{{ lookup('template', 'templates/test.xml.j2') }}"
|
||||||
name: test
|
name: test
|
||||||
token: asdfasfasfasdfasdfadfasfasdfasdfc
|
token: asdfasfasfasdfasdfadfasfasdfasdfc
|
||||||
url: http://localhost:8080
|
url: http://localhost:8080
|
||||||
user: admin
|
user: admin
|
||||||
|
|
||||||
# Delete a jenkins job using basic authentication
|
- name: Delete a jenkins job using basic authentication
|
||||||
- jenkins_job:
|
jenkins_job:
|
||||||
name: test
|
name: test
|
||||||
password: admin
|
password: admin
|
||||||
state: absent
|
state: absent
|
||||||
url: http://localhost:8080
|
url: http://localhost:8080
|
||||||
user: admin
|
user: admin
|
||||||
|
|
||||||
# Delete a jenkins job using the token
|
- name: Delete a jenkins job using the token
|
||||||
- jenkins_job:
|
jenkins_job:
|
||||||
name: test
|
name: test
|
||||||
token: asdfasfasfasdfasdfadfasfasdfasdfc
|
token: asdfasfasfasdfasdfadfasfasdfasdfc
|
||||||
state: absent
|
state: absent
|
||||||
url: http://localhost:8080
|
url: http://localhost:8080
|
||||||
user: admin
|
user: admin
|
||||||
|
|
||||||
# Disable a jenkins job using basic authentication
|
- name: Disable a jenkins job using basic authentication
|
||||||
- jenkins_job:
|
jenkins_job:
|
||||||
name: test
|
name: test
|
||||||
password: admin
|
password: admin
|
||||||
enabled: False
|
enabled: False
|
||||||
url: http://localhost:8080
|
url: http://localhost:8080
|
||||||
user: admin
|
user: admin
|
||||||
|
|
||||||
# Disable a jenkins job using the token
|
- name: Disable a jenkins job using the token
|
||||||
- jenkins_job:
|
jenkins_job:
|
||||||
name: test
|
name: test
|
||||||
token: asdfasfasfasdfasdfadfasfasdfasdfc
|
token: asdfasfasfasdfasdfadfasfasdfasdfc
|
||||||
enabled: False
|
enabled: False
|
||||||
|
|
Loading…
Reference in New Issue