Moved VES Specs to VNF Requirements Appendices
[vnfrqts/requirements.git] / docs / Chapter8 / Ansible-JSON-Key-Value-Description.rst
1 .. Modifications Copyright © 2017-2018 AT&T Intellectual Property.
2
3 .. Licensed under the Creative Commons License, Attribution 4.0 Intl.
4    (the "License"); you may not use this documentation except in compliance
5    with the License. You may obtain a copy of the License at
6
7 .. https://creativecommons.org/licenses/by/4.0/
8
9 .. Unless required by applicable law or agreed to in writing, software
10    distributed under the License is distributed on an "AS IS" BASIS,
11    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12    See the License for the specific language governing permissions and
13    limitations under the License.
14
15
16 Ansible JSON Key Value Description
17 -------------------------------------------------------------
18
19 The following provides the key value pairs that must be contained in the
20 JSON file supporting APPC/SDN-C Ansible action.
21
22 Table B1. Ansible JSON File key value description
23 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
25 .. csv-table:: **TOSCA Definition**
26    :file: Ansible JSON File Key Value Description.csv
27    :header-rows: 1
28    :align: center
29    :widths: auto
30
31 Ansible JSON file example:
32
33 .. code-block:: json
34
35   {
36     "Action":"Configure",
37     "PlaybookName": "<VNFCode>/<Version>/ansible/configure/site.yml",
38     "NodeList": [
39       {
40         "vnfc_type": "oam",
41         "ne_id_vip": "vfdb9904vm001oam001",
42         "floating_ip_address_vip": "1xx.2yy.zzz.109",
43         "site": "wp0ny",
44         "vm_info": [
45           {
46             "ne_id": "vfdb9904vm001oam001",
47             "fixed_ip_address": "1xx.2yy.zzz.109"
48           },
49           {
50             "ne_id": "vfdb9904vm002oam001",
51             "fixed_ip_address": "1xx.2yy.zzz.110"
52           }
53         ]
54       },
55       {
56         "vnfc_type": "rdb",
57         "site": "wp0ny",
58         "vm_info": [
59           {
60             "ne_id": "vfdb9904vm003rdb001",
61             "fixed_ip_address": "1xx.2yy.zzz.105"
62           },
63           {
64             "ne_id": "vfdb9904vm004rdb001",
65             "fixed_ip_address": "1xx.2yy.zzz.106"
66           }
67         ]
68       }
69     ],
70     "Timeout": 60,
71     "InventoryNames": "None",
72     "EnvParameters": {"vnf_instance": "$vnf-instance", "Retry": 3, "Wait": 5, "ConfigFile":"config.txt", "healthcheck_type": "$healthcheck_type",  "target_vm_list": ["$ne-id1","..."] },
73     "FileParameters": {"config.txt":"db_ip=10.1.1.1, sip_timer=10000"}
74   }
75
76 In the above example, the Ansible Server Rest API code will:
77
78 #. Process the "FileParameters" dictionary and generate a file named
79    'config.txt' with contents set to the value of the 'config.txt' key.
80
81 #. Execute the playbook named '<VNFCode>/<Version>/ansible/configure/site.yml'
82    on nodes with listed IP addresses (or FQDNs) respectively while providing
83    the following key value pairs to the playbook: Retry=3, Wait=5,
84    ConfigFile=config.txt
85
86 #. If execution time of the playbook exceeds 60 secs (across all hosts),
87    it will be terminated.
88
89 #. Inventory hosts file to be build with only IP addresses (or FQDNs), IP
90    addresses and VM names, or IP addresses and VNFC names depending on
91    InventoryNames setting in the template(s) passed to Ansible Server as part
92    of the Rest API request. In a later section with Ansible examples, examples
93    of supported inventory hosts file formats are shared.
94