No description
| defaults | ||
| files | ||
| handlers | ||
| meta | ||
| tasks | ||
| tests | ||
| vars | ||
| README.md | ||
Demo FastAPI
This role deploys a FastAPI demo container.
Requirements
The Docker image demofastapi:simple must be present on the machine.
Role Variables
| Variable name | Required | Default value (if any) | Description |
|---|---|---|---|
state |
✅️ | Set to present or absent depending on the desired state of the application |
Example Playbook
Here is a playbook to deploy this role locally
---
# Name of the playbook
- name: Start demo app
# List of machines on which the playbook wil run
hosts: localhost
# List of tasks the playbook will run
tasks:
# Instead of listing tasks, we call a role
- name: Call to role
ansible.builtin.include_role:
# By default, ansible will look for the role in a directory named roles
name: demofastapi
# We specify the input variables expected by the role
vars:
state: present
License
WTFPL
Author Information
Role written by Charly Collin as an example for a class at Rennes's Cyberschool.