In this exercise, we’ll create a playbook to run our role, create a job template for it in Ansible Controller, and deploying the application – all via automation.
Return to your code repo and create a playbook in the playbooks
directory called deploy-containerized-app.yml
with the following contents:
---
- name: deploy our containerized application
hosts: all
roles:
- ../roles/deploy_containerized_app
Once complete, be sure to commit push your changes up to the git server.
Note
Be sure to sync your project in Controller before attempting to create this job template.
In the Controller WebUI. under Resources > Templates, select Add > Add job template and enter the following information:
Parameter | Value |
---|---|
Name | Deploy Containerized Application |
Inventory | Edge Systems |
Project | Device Edge Codebase |
Execution Environment | Device Edge Workshops Execution Environment |
Playbook | playbooks/deploy-containerized-app.yml |
Credentials | |
Limit |
Remember to click Save.
Now that the job template has been created, click the Launch button if you are still within the Deploy Containerized Application Job Template. Otherwise, click on the rocket ship on the Templates page to launch the job template. Enter your device name when prompted on the limits page. Monitor the output for any errors or issues. However, hopefully the job executes successfully.
As a reminder, the output of jobs can be reviewed on the Jobs tab.
Once the playbook completes, visit http://$(your-device-ip-address):1881/ui to view the running application.
Note
For virtualized edge devices, you’ll need to use SSH tunneling or just curl the port to check for a response.
Similar to the bare metal deployment of the application, the automation could be added to the end of our provisioning workflow as soon as a device calls home.
Navigation
Previous Exercise | Next Exercise |