diff options
Diffstat (limited to 'docs/Chapter8/Ansible-JSON-Key-Value-Description.rst')
-rw-r--r-- | docs/Chapter8/Ansible-JSON-Key-Value-Description.rst | 138 |
1 files changed, 54 insertions, 84 deletions
diff --git a/docs/Chapter8/Ansible-JSON-Key-Value-Description.rst b/docs/Chapter8/Ansible-JSON-Key-Value-Description.rst index 5179518..e6b48d2 100644 --- a/docs/Chapter8/Ansible-JSON-Key-Value-Description.rst +++ b/docs/Chapter8/Ansible-JSON-Key-Value-Description.rst @@ -17,108 +17,78 @@ Ansible JSON Key Value Description ------------------------------------------------------------- The following provides the key value pairs that must be contained in the -JSON file supporting Ansible action. +JSON file supporting APPC/SDN-C Ansible action. Table B1. Ansible JSON File key value description ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -+---------------+----------------------+---------+----------------------------+ -| **Field Name**| **Description** | **Type**| **Comment** | -+===============+======================+=========+============================+ -| PlaybookName | VNF providor must |Mandatory|Currently following | -| | list name of the | |Ansible standard | -| | playbook relative | |naming, where main | -| | path used to | |playbook is always | -| | execute the VNF | |named site.yml, and | -| | action. | |directory name where | -| | | |this main playbook resides, | -| | | |is named after the | -| | | |command/action playbook | -| | | |performs, in lower case, | -| | | |example, configure. | -+---------------+----------------------+---------+----------------------------+ -| Action | Name of VNF action. | Optional| | -+---------------+----------------------+---------+----------------------------+ -| EnvParameters | A JSON dictionary | Optional|Depends on the VNF action. | -| | which should list key| | | -| | value pairs to be | |Attribute names (variable | -| | passed to the Ansible| |names) passed to Ansible | -| | playbook. These | |shall follow Ansible valid | -| | values would | |variable names: "Variable | -| | correspond to | |names should be letters, | -| | instance specific | |numbers, and underscores. | -| | parameters that a | |Variables should always | -| | playbook may need to | |start with a letter." | -| | execute an action. | | | -+---------------+----------------------+---------+----------------------------+ -| NodeList |Ansible inventory | Optional|If not provided, pre-loaded | -| |hosts file with | |(VNF) inventory hosts | -| |VNF groups and | |file must exist in the | -| |respective IP | |Ansible Server otherwise | -| |addresses or DNS | |request fails. | -| |supported FQDNs | | | -| |that the playbook must| | | -| |be executed against. | | | -+---------------+----------------------+---------+----------------------------+ -| FileParameters| A JSON dictionary | Optional| Depends on the VNF action | -| | where keys are | | and playbook design. | -| | filenames and values | | | -| | are contents of | | | -| | files. The Ansible | | | -| | Server will utilize | | | -| | this feature to | | | -| | generate files with | | | -| | keys as filenames and| | | -| | values as content. | | | -| | This attribute can be| | | -| | used to generate | | | -| | files that a playbook| | | -| | may require as part | | | -| | of execution. | | | -+---------------+----------------------+---------+----------------------------+ -| Timeout | Time (in seconds) | Optional| | -| | that a playbook is | | | -| | expected to take to | | | -| | finish execution for | | | -| | the VNF. If playbook | | | -| | execution time | | | -| | exceeds this value, | | | -| | Ansible Server will | | | -| | terminate the | | | -| | playbook process. | | | -+---------------+----------------------+---------+----------------------------+ +.. csv-table:: **TOSCA Definition** + :file: Ansible JSON File Key Value Description.csv + :header-rows: 1 + :align: center + :widths: auto Ansible JSON file example: .. code-block:: json { - "Action":"Configure", - "PlaybookName": "<VNFCode>/<Version>/ansible/configure/site.yml", - - "NodeList": ["test1.vnf_b.onap.com", "test2.vnf_b.onap.com"], - + "NodeList": [ + { + "vnfc_type": "oam", + "ne_id_vip": "vfdb9904vm001oam001", + "floating_ip_address_vip": "1xx.2yy.zzz.109", + "site": "wp0ny", + "vm_info": [ + { + "ne_id": "vfdb9904vm001oam001", + "fixed_ip_address": "1xx.2yy.zzz.109" + }, + { + "ne_id": "vfdb9904vm002oam001", + "fixed_ip_address": "1xx.2yy.zzz.110" + } + ] + }, + { + "vnfc_type": "rdb", + "site": "wp0ny", + "vm_info": [ + { + "ne_id": "vfdb9904vm003rdb001", + "fixed_ip_address": "1xx.2yy.zzz.105" + }, + { + "ne_id": "vfdb9904vm004rdb001", + "fixed_ip_address": "1xx.2yy.zzz.106" + } + ] + } + ], "Timeout": 60, - - "EnvParameters": {"Retry": 3, "Wait": 5, "ConfigFile":"config.txt"}, - + "InventoryNames": "None", + "EnvParameters": {"vnf_instance": "$vnf-instance", "Retry": 3, "Wait": 5, "ConfigFile":"config.txt", "healthcheck_type": "$healthcheck_type", "target_vm_list": ["$ne-id1","..."] }, "FileParameters": {"config.txt":"db_ip=10.1.1.1, sip_timer=10000"} - } -In the above example, the Ansible Server will: +In the above example, the Ansible Server Rest API code will: -a. Process the "FileParameters" dictionary and generate a file named - ‘config.txt’ with contents set to the value of the ‘config.txt’ key. +#. Process the "FileParameters" dictionary and generate a file named + 'config.txt' with contents set to the value of the 'config.txt' key. -b. Execute the playbook named ‘<VNFCode>/<Version>/ansible/configure/site.yml’ - on nodes with FQDNs test1.vnf\_b.onap.com and test2.vnf\_b.onap.com - respectively while providing the following key value pairs to the playbook: - Retry=3, Wait=5, ConfigFile=config.txt +#. Execute the playbook named '<xNFCode>/<Version>/ansible/configure/site.yml' + on nodes with listed IP addresses (or FQDNs) respectively while providing + the following key value pairs to the playbook: Retry=3, Wait=5, + ConfigFile=config.txt - -c. If execution time of the playbook exceeds 60 secs (across all hosts), +#. If execution time of the playbook exceeds 60 secs (across all hosts), it will be terminated. +#. Inventory hosts file to be build with only IP addresses (or FQDNs), IP + addresses and VM names, or IP addresses and xNFC names depending on + InventoryNames setting in the template(s) passed to Ansible Server as part + of the Rest API request. In a later section with Ansible examples, examples + of supported inventory hosts file formats are shared. + |