Ansible role to install and configure Grafana observability platform.
Building and improving this Ansible role have been sponsored by my current and previous employers like Cloudpunks GmbH and Proact Deutschland GmbH.
- Requirements
- Default Variables
- grafana_admin_disable
- grafana_admin_enable
- grafana_admins
- grafana_allow_insecure_email_lookup
- grafana_allow_signup
- grafana_anonymous_auth
- grafana_assign_auto
- grafana_assign_org
- grafana_assign_role
- grafana_cpu_shares
- grafana_datasources
- grafana_db_host
- grafana_db_name
- grafana_db_password
- grafana_db_path
- grafana_db_type
- grafana_db_username
- grafana_default_folders
- grafana_default_labels
- grafana_default_publish
- grafana_default_volumes
- grafana_disable_signin
- grafana_disable_signout
- grafana_domain
- grafana_email
- grafana_extra_folders
- grafana_extra_labels
- grafana_extra_publish
- grafana_extra_volumes
- grafana_image
- grafana_install_plugins
- grafana_installation
- grafana_instance
- grafana_keycloak_client
- grafana_keycloak_roles
- grafana_keycloak_scopes
- grafana_keycloak_secret
- grafana_keycloak_url
- grafana_keyring
- grafana_manage_admins
- grafana_manage_orgs
- grafana_memory_limit
- grafana_memory_soft_limit
- grafana_memory_swap
- grafana_network
- grafana_number_of_cpus
- grafana_oauth2_allow_assign_admin
- grafana_oauth2_allow_signup
- grafana_oauth2_api_url
- grafana_oauth2_auth_url
- grafana_oauth2_client
- grafana_oauth2_email_attribute
- grafana_oauth2_enable
- grafana_oauth2_login_attribute
- grafana_oauth2_name
- grafana_oauth2_name_attribute
- grafana_oauth2_redirect_url
- grafana_oauth2_roles
- grafana_oauth2_scopes
- grafana_oauth2_secret
- grafana_oauth2_token_url
- grafana_org_create
- grafana_organization
- grafana_organizations
- grafana_password
- grafana_providers
- grafana_pull_image
- grafana_repo_release
- grafana_secret
- grafana_smtp_address
- grafana_smtp_enabled
- grafana_smtp_host
- grafana_smtp_name
- grafana_smtp_password
- grafana_smtp_user
- grafana_username
- grafana_version
- Discovered Tags
- Dependencies
- License
- Author
- Minimum Ansible version:
2.10
Roles mapping for Keycloak authentication
grafana_admin_disable:
isGrafanaAdmin: false
Payload used to promote admins
grafana_admin_enable:
isGrafanaAdmin: true
List of admin users
grafana_admins: []
Allow insecure email lookup for OAuth2 authentication
grafana_allow_insecure_email_lookup: false
Allow signup of new users
grafana_allow_signup: false
Allow anonymous users access
grafana_anonymous_auth: false
Automatically assign an organization to users
grafana_assign_auto: true
OD of the organization to automatically assign
grafana_assign_org: 1
Standard role which gets automatically assigned
grafana_assign_role: Viewer
CPU shares with Docker deployment
grafana_cpu_shares:
grafana_cpu_shares: '512'
List of datasources to integrate
grafana_datasources: []
grafana_datasources:
- name: prometheus
type: prometheus
access: proxy
url: http://localhost:9090
orgId: 1
isDefault: True
editable: False
Host for the database connection
grafana_db_host:
Database used for the database connection
grafana_db_name:
Password for the database connection
grafana_db_password:
Path to SQLite3 database
grafana_db_path:
Type of database to use
grafana_db_type: mysql
Username for the database connection
grafana_db_username:
List of default folders to create
grafana_default_folders:
- /etc/grafana
- /etc/grafana/provisioning
- /etc/grafana/provisioning/dashboards
- /etc/grafana/provisioning/datasources
- /etc/grafana/provisioning/plugins
- /etc/grafana/provisioning/alerting
- /etc/grafana/provisioning/notifiers
- /var/lib/grafana
- /var/lib/grafana/plugins
- /var/lib/grafana/dashboards
List of default labels to assign to docker
grafana_default_labels: []
List of default port publishing for docker
grafana_default_publish: []
grafana_default_publish:
- 127.0.0.1:3000:3000
List of default volumes to mount for docker
grafana_default_volumes:
- /var/lib/grafana:/var/lib/grafana
- /etc/grafana:/etc/grafana
Disable the regular signin of users
grafana_disable_signin: false
Disable the regular signout of users
grafana_disable_signout: false
Domain for external access
grafana_domain:
grafana_domain: grafana.example.com
Email for initial admin
grafana_email:
grafana_email: [email protected]
List of extra folders to create
grafana_extra_folders: []
grafana_extra_folders:
- /path/to/host/folder1
- /path/to/host/folder2
- /path/to/host/folder3
List of extra labels to assign to docker
grafana_extra_labels: []
List of extra port publishing for docker
grafana_extra_publish: []
grafana_extra_publish:
- 127.0.0.1:3000:3000
List of extra volumes to mount for docker
grafana_extra_volumes: []
grafana_extra_volumes:
- /path/to/host/folder1:/path/within/container1
- /path/to/host/folder2:/path/within/container2
- /path/to/host/folder3:/path/within/container3
Docker image to use for deployment
grafana_image: grafana/grafana:{{ grafana_version }}
List of plugins to install
grafana_install_plugins:
- grafana-piechart-panel
Select installation method, could be native or docker
grafana_installation: native
Name of the Grafana instance
grafana_instance:
grafana_instance: Example
Client id for Keycloak authentication
grafana_keycloak_client:
grafana_keycloak_roles:
Scope used by Keycloak authentication
grafana_keycloak_scopes: openid profile email
Client secret for Keycloak authentication
grafana_keycloak_secret:
Keycloak URL for OAuth2 authentication
grafana_keycloak_url:
Path for the repository keyring
grafana_keyring: /usr/share/keyrings/grafana-archive-keyring.gpg
Enable management of admins
grafana_manage_admins: false
Enable management of organizations
grafana_manage_orgs: false
Memory limit with Docker deployment
grafana_memory_limit:
grafana_memory_limit: 1024m
Soft memory limit with Docker deployment
grafana_memory_soft_limit:
grafana_memory_soft_limit: 512m
Swap usage with Docker deployment
grafana_memory_swap:
grafana_memory_swap: 2048m
Optional docker network to attach
grafana_network:
Number of CPUs with Docker deployment
grafana_number_of_cpus:
grafana_number_of_cpus: '1.0'
Allow to assign Grafana admin via OAuth2 authentication
grafana_oauth2_allow_assign_admin: true
Allow signup via OAuth2 authentication
grafana_oauth2_allow_signup: true
API URL for OAuth2 authentication
grafana_oauth2_api_url:
Auth URL for OAuth2 authentication
grafana_oauth2_auth_url:
Client for OAuth2 authentication
grafana_oauth2_client:
Email attribute for OAuth2 authentication
grafana_oauth2_email_attribute: email
Enable generic OAuth2 authentication
grafana_oauth2_enable: false
Login attribute for OAuth2 authentication
grafana_oauth2_login_attribute: preferred_username
Name for OAuth2 authentication
grafana_oauth2_name:
Name attribute for OAuth2 authentication
grafana_oauth2_name_attribute: name
Redirect URL for OAuth2 authentication
grafana_oauth2_redirect_url:
Roles mapping for OAuth2 authentication
grafana_oauth2_roles:
Scopes used by OAuth2 authentication
grafana_oauth2_scopes: openid profile email
Secret for OAuth2 authentication
grafana_oauth2_secret:
Token URL for OAuth2 authentication
grafana_oauth2_token_url:
Allow users to create organizations
grafana_org_create: false
Name of the primary organization
grafana_organization:
grafana_organization: Example
List of organizations
grafana_organizations: []
grafana_organizations:
- Org1
- Org2
- Org3
Password for initial admin
grafana_password:
grafana_password: p455w0rd
List of providers to integrate
grafana_providers:
- name: default
orgId: 1
folder: ''
folderUid: ''
type: file
disableDeletion: false
updateIntervalSeconds: 10
options:
path: /var/lib/grafana/dashboards
Pull image as part of the tasks
grafana_pull_image: true
Enforce another release for the repo
grafana_repo_release: stable
Secret for initial admin
grafana_secret:
grafana_secret: s3cr37
Address for sending mails via SMTP
grafana_smtp_address:
Enable sending mails via SMTP
grafana_smtp_enabled: true
Host for sending mails via SMTP
grafana_smtp_host:
Name for sending mails via SMTP
grafana_smtp_name: Grafana
Password for sending mails via SMTP
grafana_smtp_password:
Username for sending mails via SMTP
grafana_smtp_user:
Username for initial admin
grafana_username:
grafana_username: admin
Version of docker release to use
grafana_version: 11.4.0
grafana
Apache-2.0