Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACI: Add missing examples to module docs #36417

Merged
merged 1 commit into from
Feb 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 38 additions & 1 deletion lib/ansible/modules/network/aci/aci_aep_to_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,44 @@
extends_documentation_fragment: aci
'''

EXAMPLES = r''' # '''
EXAMPLES = r'''
- name: Add AEP to domain binding
aci_aep_to_domain: &binding_present
host: apic
username: admin
password: SomeSecretPassword
aep: test_aep
domain: phys_dom
domain_type: phys
state: present

- name: Remove AEP to domain binding
aci_aep_to_domain: &binding_absent
host: apic
username: admin
password: SomeSecretPassword
aep: test_aep
domain: phys_dom
domain_type: phys
state: absent

- name: Query our AEP to domain binding
aci_aep_to_domain:
host: apic
username: admin
password: SomeSecretPassword
aep: test_aep
domain: phys_dom
domain_type: phys
state: query

- name: Query all AEP to domain bindings
aci_aep_to_domain: &binding_query
host: apic
username: admin
password: SomeSecretPassword
state: query
'''

RETURN = r'''
current:
Expand Down
10 changes: 5 additions & 5 deletions lib/ansible/modules/network/aci/aci_config_rollback.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@
password: SomeSecretPassword
state: preview
export_policy: config_backup
snapshot: 'run-2017-08-28T06-24-01'
snapshot: run-2017-08-28T06-24-01
compare_export_policy: config_backup
compare_snapshot: 'run-2017-08-27T23-43-56'
compare_snapshot: run-2017-08-27T23-43-56

- name: Rollback Configuration
aci_config_rollback:
Expand All @@ -109,7 +109,7 @@
state: rollback
import_policy: rollback_config
export_policy: config_backup
snapshot: 'run-2017-08-28T06-24-01'
snapshot: run-2017-08-28T06-24-01

- name: Rollback Configuration
aci_config_rollback:
Expand All @@ -119,8 +119,8 @@
state: rollback
import_policy: rollback_config
export_policy: config_backup
snapshot: 'run-2017-08-28T06-24-01'
description: 'Rollback 8-27 changes'
snapshot: run-2017-08-28T06-24-01
description: Rollback 8-27 changes
import_mode: atomic
import_type: replace
fail_on_decrypt: yes
Expand Down
46 changes: 35 additions & 11 deletions lib/ansible/modules/network/aci/aci_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,42 @@
extends_documentation_fragment: aci
'''

# FIXME: Add more, better examples
EXAMPLES = r'''
- aci_contract:
host: '{{ inventory_hostname }}'
username: '{{ username }}'
password: '{{ password }}'
contract: '{{ contract }}'
description: '{{ descr }}'
tenant: '{{ tenant }}'
scope: '{{ scope }}'
priority: '{{ priority }}'
target: '{{ target }}'
- name: Add a new contract
aci_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
description: Communication between web-servers and database
scope: application-profile
state: present

- name: Remove an existing contract
aci_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
state: absent

- name: Query a specific contract
aci_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
state: query

- name: Query all contracts
aci_contract:
host: apic
username: admin
password: SomeSecretPassword
state: query
'''

RETURN = r'''
Expand Down
49 changes: 42 additions & 7 deletions lib/ansible/modules/network/aci/aci_contract_subject_to_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,50 @@

# FIXME: Add more, better examples
EXAMPLES = r'''
- aci_subject_filter_binding:
host: '{{ inventory_hostname }}'
username: '{{ username }}'
password: '{{ password }}'
tenant: '{{ tenant }}'
contract: '{{ contract }}'
subject: '{{ subject }}'
- name: Add a new contract subject to filer binding
aci_subject_filter_binding:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
filter: '{{ filter }}'
log: '{{ log }}'
state: present

- name: Remove an existing contract subject to filter binding
aci_subject_filter_binding:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
filter: '{{ filter }}'
log: '{{ log }}'
state: present

- name: Query a specific contract subject to filter binding
aci_subject_filter_binding:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
filter: '{{ filter }}'
state: query

- name: Query all contract subject to filter bindings
aci_subject_filter_binding:
host: apic
username: admin
password: SomeSecretPassword
tenant: production
contract: web_to_db
subject: test
state: query
'''

RETURN = r'''
Expand Down
47 changes: 46 additions & 1 deletion lib/ansible/modules/network/aci/aci_domain_to_encap_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,52 @@
extends_documentation_fragment: aci
'''

EXAMPLES = r''' # '''
EXAMPLES = r'''
- name: Add domain to VLAN pool binding
aci_domain_to_encap_pool:
host: apic
username: admin
password: SomeSecretPassword
domain: phys_dom
domain_type: phys
pool: test_pool
pool_type: vlan
pool_allocation_mode: dynamic
state: present

- name: Remove domain to VLAN pool binding
aci_domain_to_encap_pool:
host: apic
username: admin
password: SomeSecretPassword
domain: phys_dom
domain_type: phys
pool: test_pool
pool_type: vlan
pool_allocation_mode: dynamic
state: absent

- name: Query our domain to VLAN pool binding
aci_domain_to_encap_pool:
host: apic
username: admin
password: SomeSecretPassword
domain: phys_dom
pool: test_pool
pool_type: vlan
pool_allocation_mode: dynamic
state: query

- name: Query all domain to VLAN pool bindings
aci_domain_to_encap_pool:
host: apic
username: admin
password: SomeSecretPassword
domain_type: phys
pool_type: vlan
pool_allocation_mode: dynamic
state: query
'''

RETURN = r'''
current:
Expand Down
46 changes: 45 additions & 1 deletion lib/ansible/modules/network/aci/aci_epg_to_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,51 @@
extends_documentation_fragment: aci
'''

EXAMPLES = r''' # '''
EXAMPLES = r'''
- name: Add a new contract to EPG binding
aci_epg_to_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
contract: anstest_http
contract_type: provider
state: present

- name: Remove an existing contract to EPG binding
aci_epg_to_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
contract: anstest_http
contract_type: provider
state: absent

- name: Query a specific contract to EPG binding
aci_epg_to_contract:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
contract: anstest_http
contract_type: provider
state: query

- name: Query all provider contract to EPG bindings
aci_epg_to_contract:
host: apic
username: admin
password: SomeSecretPassword
contract_type: provider
state: query
'''

RETURN = r'''
current:
Expand Down
45 changes: 44 additions & 1 deletion lib/ansible/modules/network/aci/aci_epg_to_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,50 @@
extends_documentation_fragment: aci
'''

EXAMPLES = r''' # '''
EXAMPLES = r'''
- name: Add a new physical domain to EPG binding
aci_epg_to_domain:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
domain: anstest
domain_type: phys
state: present

- name: Remove an existing physical domain to EPG binding
aci_epg_to_domain:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
domain: anstest
domain_type: phys
state: absent

- name: Query a specific physical domain to EPG binding
aci_epg_to_domain:
host: apic
username: admin
password: SomeSecretPassword
tenant: anstest
ap: anstest
epg: anstest
domain: anstest
domain_type: phys
state: query

- name: Query all domain to EPG bindings
aci_epg_to_domain:
host: apic
username: admin
password: SomeSecretPassword
state: query
'''

RETURN = r'''
current:
Expand Down