Skip to content

Commit

Permalink
use FQCN in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Rene Moser committed Apr 12, 2020
1 parent afd434f commit a3d0499
Show file tree
Hide file tree
Showing 53 changed files with 195 additions and 326 deletions.
17 changes: 7 additions & 10 deletions plugins/modules/cs_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

EXAMPLES = '''
- name: create an account in domain 'CUSTOMERS'
cs_account:
ngine_io.cloudstack.cs_account:
name: customer_xy
username: customer_xy
password: S3Cur3
Expand All @@ -109,42 +109,39 @@
domain: CUSTOMERS
role: Domain Admin
- name: Lock an existing account in domain 'CUSTOMERS'
cs_account:
ngine_io.cloudstack.cs_account:
name: customer_xy
domain: CUSTOMERS
state: locked
- name: Disable an existing account in domain 'CUSTOMERS'
cs_account:
ngine_io.cloudstack.cs_account:
name: customer_xy
domain: CUSTOMERS
state: disabled
- name: Enable an existing account in domain 'CUSTOMERS'
cs_account:
ngine_io.cloudstack.cs_account:
name: customer_xy
domain: CUSTOMERS
state: enabled
- name: Remove an account in domain 'CUSTOMERS'
cs_account:
ngine_io.cloudstack.cs_account:
name: customer_xy
domain: CUSTOMERS
state: absent
- name: Create a single user LDAP account in domain 'CUSTOMERS'
cs_account:
ngine_io.cloudstack.cs_account:
name: customer_xy
username: customer_xy
domain: CUSTOMERS
ldap_domain: cn=customer_xy,cn=team_xy,ou=People,dc=domain,dc=local
- name: Create a LDAP account in domain 'CUSTOMERS' and bind it to a LDAP group
cs_account:
ngine_io.cloudstack.cs_account:
name: team_xy
username: customer_xy
domain: CUSTOMERS
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/cs_affinitygroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@

EXAMPLES = '''
- name: Create a affinity group
cs_affinitygroup:
ngine_io.cloudstack.cs_affinitygroup:
name: haproxy
affinity_type: host anti-affinity
- name: Remove a affinity group
cs_affinitygroup:
ngine_io.cloudstack.cs_affinitygroup:
name: haproxy
state: absent
'''
Expand Down
11 changes: 4 additions & 7 deletions plugins/modules/cs_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,26 @@

EXAMPLES = '''
- name: Ensure a cluster is present
cs_cluster:
ngine_io.cloudstack.cs_cluster:
name: kvm-cluster-01
zone: ch-zrh-ix-01
hypervisor: KVM
cluster_type: CloudManaged
- name: Ensure a cluster is disabled
cs_cluster:
ngine_io.cloudstack.cs_cluster:
name: kvm-cluster-01
zone: ch-zrh-ix-01
state: disabled
- name: Ensure a cluster is enabled
cs_cluster:
ngine_io.cloudstack.cs_cluster:
name: kvm-cluster-01
zone: ch-zrh-ix-01
state: enabled
- name: Ensure a cluster is absent
cs_cluster:
ngine_io.cloudstack.cs_cluster:
name: kvm-cluster-01
zone: ch-zrh-ix-01
state: absent
Expand Down
11 changes: 4 additions & 7 deletions plugins/modules/cs_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,24 @@

EXAMPLES = '''
- name: Ensure global configuration
cs_configuration:
ngine_io.cloudstack.cs_configuration:
name: router.reboot.when.outofband.migrated
value: false
- name: Ensure zone configuration
cs_configuration:
ngine_io.cloudstack.cs_configuration:
name: router.reboot.when.outofband.migrated
zone: ch-gva-01
value: true
- name: Ensure storage configuration
cs_configuration:
ngine_io.cloudstack.cs_configuration:
name: storage.overprovisioning.factor
storage: storage01
value: 2.0
- name: Ensure account configuration
cs_configuration:
ngine_io.cloudstack.cs_configuration:
name: allow.public.user.templates
value: false
account: acme inc
Expand Down
8 changes: 3 additions & 5 deletions plugins/modules/cs_disk_offering.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,22 @@

EXAMPLES = '''
- name: Create a disk offering with local storage
cs_disk_offering:
ngine_io.cloudstack.cs_disk_offering:
name: small
display_text: Small 10GB
disk_size: 10
storage_type: local
- name: Create or update a disk offering with shared storage
cs_disk_offering:
ngine_io.cloudstack.cs_disk_offering:
name: small
display_text: Small 10GB
disk_size: 10
storage_type: shared
storage_tags: SAN01
- name: Remove a disk offering
cs_disk_offering:
ngine_io.cloudstack.cs_disk_offering:
name: small
state: absent
'''
Expand Down
8 changes: 3 additions & 5 deletions plugins/modules/cs_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,17 @@

EXAMPLES = '''
- name: Create a domain
cs_domain:
ngine_io.cloudstack.cs_domain:
path: ROOT/customers
network_domain: customers.example.com
- name: Create another subdomain
cs_domain:
ngine_io.cloudstack.cs_domain:
path: ROOT/customers/xy
network_domain: xy.customers.example.com
- name: Remove a domain
cs_domain:
ngine_io.cloudstack.cs_domain:
path: ROOT/customers/xy
state: absent
'''
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/cs_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
EXAMPLES = '''
# Gather all facts on instances
- name: Gather cloudstack facts
cs_facts:
ngine_io.cloudstack.cs_facts:
# Gather specific fact on instances
- name: Gather cloudstack facts
cs_facts: filter=cloudstack_instance_id
ngine_io.cloudstack.cs_facts: filter=cloudstack_instance_id
# Gather specific fact on instances with a given meta_data_host
- name: Gather cloudstack facts
cs_facts:
ngine_io.cloudstack.cs_facts:
filter: cloudstack_instance_id
meta_data_host: 169.254.169.254
'''
Expand Down
14 changes: 5 additions & 9 deletions plugins/modules/cs_firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,40 +107,36 @@

EXAMPLES = '''
- name: Allow inbound port 80/tcp from 1.2.3.4 to 4.3.2.1
cs_firewall:
ngine_io.cloudstack.cs_firewall:
ip_address: 4.3.2.1
port: 80
cidr: 1.2.3.4/32
- name: Allow inbound tcp/udp port 53 to 4.3.2.1
cs_firewall:
ngine_io.cloudstack.cs_firewall:
ip_address: 4.3.2.1
port: 53
protocol: '{{ item }}'
with_items:
- tcp
- udp
- name: Ensure firewall rule is removed
cs_firewall:
ngine_io.cloudstack.cs_firewall:
ip_address: 4.3.2.1
start_port: 8000
end_port: 8888
cidr: 17.0.0.0/8
state: absent
- name: Allow all outbound traffic
cs_firewall:
ngine_io.cloudstack.cs_firewall:
network: my_network
type: egress
protocol: all
- name: Allow only HTTP outbound traffic for an IP
cs_firewall:
ngine_io.cloudstack.cs_firewall:
network: my_network
type: egress
port: 80
Expand Down
11 changes: 4 additions & 7 deletions plugins/modules/cs_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

EXAMPLES = '''
- name: Ensure a host is present but disabled
cs_host:
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
cluster: vcenter.example.com/zone01/cluster01
pod: pod01
Expand All @@ -91,23 +91,20 @@
- perf
- gpu
- name: Ensure an existing host is disabled
cs_host:
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
zone: zone01
allocation_state: disabled
- name: Ensure an existing host is enabled
cs_host:
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
zone: zone01
allocation_state: enabled
- name: Ensure a host is absent
cs_host:
ngine_io.cloudstack.cs_host:
name: pod01.zone01.example.com
zone: zone01
state: absent
Expand Down
7 changes: 3 additions & 4 deletions plugins/modules/cs_image_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

EXAMPLES = '''
- name: Add a Image Store (NFS)
cs_image_store:
ngine_io.cloudstack.cs_image_store:
zone: zone-01
name: nfs-01
provider: NFS
Expand All @@ -70,16 +70,15 @@
# Change the NFS share URL and force a Image Store recreation
- name: Change the NFS url
cs_image_store:
ngine_io.cloudstack.cs_image_store:
zone: zone-01
name: nfs-01
provider: NFS
force_recreate: yes
url: nfs://192.168.21.10/shares/secondary
- name: delete the image store
cs_image_store:
ngine_io.cloudstack.cs_image_store:
name: nfs-01
zone: zone-01
state: absent
Expand Down
20 changes: 7 additions & 13 deletions plugins/modules/cs_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
EXAMPLES = '''
# NOTE: Names of offerings and ISOs depending on the CloudStack configuration.
- name: create a instance from an ISO
cs_instance:
ngine_io.cloudstack.cs_instance:
name: web-vm-1
iso: Linux Debian 7 64-bit
hypervisor: VMware
Expand All @@ -209,19 +209,17 @@
- Sync Integration
- Storage Integration
- name: for changing a running instance, use the 'force' parameter
cs_instance:
ngine_io.cloudstack.cs_instance:
name: web-vm-1
display_name: web-vm-01.example.com
iso: Linux Debian 7 64-bit
service_offering: 2cpu_2gb
force: yes
# NOTE: user_data can be used to kickstart the instance using cloud-init yaml config.
- name: create or update a instance on Exoscale's public cloud using display_name.
cs_instance:
ngine_io.cloudstack.cs_instance:
display_name: web-vm-1
template: Linux Debian 7 64-bit
service_offering: Tiny
Expand All @@ -236,9 +234,8 @@
packages:
- nginx
- name: create an instance with multiple interfaces specifying the IP addresses
cs_instance:
ngine_io.cloudstack.cs_instance:
name: web-vm-1
template: Linux Debian 7 64-bit
service_offering: Tiny
Expand All @@ -248,21 +245,18 @@
- network: NetworkB
ip: 192.0.2.1
- name: ensure an instance is stopped
cs_instance:
ngine_io.cloudstack.cs_instance:
name: web-vm-1
state: stopped
- name: ensure an instance is running
cs_instance:
ngine_io.cloudstack.cs_instance:
name: web-vm-1
state: started
- name: remove an instance
cs_instance:
ngine_io.cloudstack.cs_instance:
name: web-vm-1
state: absent
'''
Expand Down
Loading

0 comments on commit a3d0499

Please sign in to comment.