Skip to content

Latest commit

 

History

History
288 lines (265 loc) · 18.3 KB

cisco.sastre.list_transform_module.rst

File metadata and controls

288 lines (265 loc) · 18.3 KB
source:list_transform.py
orphan:

list_transform -- List configuration items or device certificate information from vManage or a local backup. Display as table or export as csv file.

  • The list task can be used to show items from a target vManage, or a backup directory. Matching criteria can contain item tag(s) and regular expression.When multiple filters are defined, the result is an AND of all filters.A log file is created under a "logs" directory. This "logs" directoryis relative to directory where Ansible runs.
Parameter Choices/Defaults Comments
address
string / required
vManage IP address or can also be defined via VMANAGE_IP environment variable
exclude
string
Exclude table rows matching the regular expression
include
string
Include table rows matching the regular expression, exclude all other rows
name_regex
string / required
name-regex used to transform an existing item name. Variable {name} is replaced with the original template name. Sections of the original template name can be selected using the {name <regex>} format. Where is a regular expression that must contain at least one capturing group. Capturing groups identify sections of the original name to keep. For transform option, this param is mandatory.
not_regex
string
Regular expression selecting items NOT to list, match on original item names.
password
string / required
password or can also be defined via VMANAGE_PASSWORD environment variable.
port
integer
Default:
8443
vManage port number or can also be defined via VMANAGE_PORT environment variable
regex
string
Regular expression selecting items to list, match on original item names.
save_csv
string
Export table as a csv file
save_json
string
Export table as a json file
tags
list / required
    Choices:
  • template_feature
  • policy_profile
  • policy_definition
  • all
  • policy_list
  • policy_vedge
  • policy_voice
  • policy_vsmart
  • template_device
  • policy_security
  • policy_customapp
Defines one or more tags for selecting groups of items. Multiple tags should be configured as list. Available tags are template_feature, policy_profile, policy_definition, all, policy_list, policy_vedge, policy_voice, policy_vsmart, template_device, policy_security, policy_customapp. Special tag "all" selects all items, including WAN edge certificates and device configurations.
tenant
string
tenant name, when using provider accounts in multi-tenant deployments.
timeout
integer
Default:
300
vManage REST API timeout in seconds
user
string / required
username or can also be defined via VMANAGE_USER environment variable.
workdir
string
list will read from the specified directory instead of target vManage. Either workdir or vManage address/user/password is mandatory

Note

  • Tested against 20.10
- name: List Configuration
  cisco.sastre.list_transform:
    tags:
        - template_feature
        - policy_vedge
    regex: ".*"
    include: ".*"
    workdir: backup_198.18.1.10_20210720
    name_regex: '{name}'
    save_csv: list_config_csv
    save_json: list_config_json
- name: List Configuration
  cisco.sastre.list_transform:
    tags:
        - template_feature
        - policy_vedge
    not_regex: ".*"
    include: ".*"
    exclude: ".*"
    save_csv: list_config_csv
    save_json: list_config_json
    name_regex: '{name}'
    address: 198.18.1.10
    port: 8443
    user: admin
    password: admin