The ansible-mps-plugin is one of many plugins of the DeMAF project. It is designed to transform Ansible deployment models into an EDMM representation. The transformation rules are described in the TRANSFORMATION_RULES.md.
The plugin only works (without adaptions) in the context of the entire DeMAF application using the deployment-config. The documentation for setting up the entire DeMAF application locally is here.
You can run the application without the deployment-config, but it will not run as it needs to register itself at the analysis-manager.
If you want to boot it locally nevertheless use the following commands.
./mvnw spring-boot:run
or to use the built package:
./mvnw package
java -jar target/ansible-plugin-0.2.0-SNAPSHOT.jar
This plugin uses JetBrains MPS to facilitate the model-to-model transformation from Ansible to EDMM. The matching MPS project is located in another git repository and must be added as a submodule (you can also clone via https):
git submodule add git@github.com:UST-DeMAF/mps-transformation-ansible.git mps-transformation-ansible
To update the MPS application to a new version, execute:
git submodule update --remote
This plugin has some minor specialities compared to other DeMAF transformation plugins:
- No directories: Ansible projects are created in a folder structure, where it is possible to have multiple overlapping main files. Therefore, it is not possible to scan directories, but always only one main file. Of course, matching subdirectories, e.g. for roles are possible to read.
- Host-file: If available one host.yaml can be read, but it must be in the same folder as the main.yaml and be named host.y(a)ml.
- Variable replacement: Ansible uses variables to create re-usable templates. Those variables are replaced with their values after parsing the files by the ansible-mps-plugin before handing it over to MPS.
When running the project locally using e.g. IntelliJ IDEA or from the command-line, make sure that the plugin is not also running in a Docker container, launched by the deployment-config, otherwise the port is blocked.