This wiki provides documentation regarding the design, capabilities and usage of the Saltstack Extension for APP-C. Saltstack is a an open-source config management tool that can be used in VNF management framework that allows provide an almost cli like set of tools in a structured form. Here Saltstack Server is called as salt master and clients are called as salt minions which run as agents in the client machine, Salt uses YAML config files, organized into templates or packages called states. In the target VNF it is necessary to have a) an SSH server, b) salt minions and dependencies and d) any necessary software that is specific to the VNF to run its functions. Many actions such as configure, restart, health check can be executed on the VNF by constructing a salt-states (set of sls files) that is executed by an Saltstack server on the VNF via SSH.
...
Table 2: Output Variables set by Ansible Saltstack DG | |
---|---|
Variable Name | Description |
output.status.code | Result of the request : 400 if SUCCESS , 200 if FAILURE.The ansible playbook may have multiple sub-tasks, playbooks etc and may run on multiple VMs of a host. The request is considered to fail if even one of the tasks is incomplete. |
output.status.message | If Salt finished execution, set to corresponding message. If abnormal error, reported in message |
output.status.results | A JSON dictionary with results corresponding to Saltstack execution.. |
2. APP-C Ansible saltstack Adapter : The App-C Ansible saltstack Adapter is an OSGI bundle which essentially makes REST calls to the Ansible saltstack Server. It exposes three methods that can be invoked by the Service Logic Interpreter (SLI) via Directed Graphs
...
- void reqExecSLSFile(Map<String, String> params, SvcLogicContext ctx) throws SvcLogicException : A method to retreive the logs from a request (not used in the Ansible saltstack DG currently).
Method to execute a single sls on SaltState server (Where the SLS file is located in the adaptor). The param entered will only be the SLS file location on the APPC/ODL container and this is automatically uploaded to server and executed, where the output from server will be in JSON format automatically. The response from Saltstack comes in json format and it is automatically put to context for DGs access, with a certain request-ID as prefix. If request Id (Id) is not passed as part of input param, then a random Id will be generated and put to properties in "org.onap.appc.adapter.saltstack.Id" field. All the output message from the execution will be appended with reqId.
Currently, the "Input Parameters to the Saltstack Directed Graph" defined above is only for reqExecSLS method. DG for using all the methods will be provided in the future when its scope arises, as depicted in the image above. . However, current DG provided for saltstack will only perform reqExecSLS execution.
In order to communicate with the Ansible saltstack Server, it is currently assumed that :
...