diff --git a/README.md b/README.md index d9ec98f..a91dd99 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ You should also configure OAuth: ```yaml grafana_oauth_id: '123qwe123qwe123' grafana_oauth_secret: 'qweasdqweasdqweasdqweasd +grafana_oauth_gh_org: 'evil-corp' +grafana_oauth_gh_team_ids: [ 1234, 5678 ] ``` Optional email configuration might be useful: ```yaml diff --git a/defaults/main.yml b/defaults/main.yml index 45b632b..e9e1d54 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -23,6 +23,8 @@ grafana_password: ~ # OAuth secrets grafana_oauth_id: ~ grafana_oauth_secret: ~ +grafana_oauth_gh_org: 'status-im' +grafana_oauth_gh_team_ids: [] # SMTP for invite emails grafana_smtp_enabled: false diff --git a/templates/grafana.ini.j2 b/templates/grafana.ini.j2 index c7eaa80..2bef943 100644 --- a/templates/grafana.ini.j2 +++ b/templates/grafana.ini.j2 @@ -51,4 +51,7 @@ token_url = https://github.com/login/oauth/access_token api_url = https://api.github.com/user allow_sign_up = true # space-delimited organization names -allowed_organizations = status-im +allowed_organizations = {{ grafana_oauth_gh_org }} +{% if (grafana_oauth_gh_team_ids | length) > 0 %} +team_ids = {{ grafana_oauth_gh_team_ids | join(",") }} +{% endif %}