1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00

cleanup variable name and values

Variable names cleanup
added ternary('true', 'false') where needed
default value for new variables now the same than the official docs
This commit is contained in:
L3D 2023-08-30 01:08:02 +02:00
parent 5b11e8b2d5
commit 9a306158c2
No known key found for this signature in database
GPG key ID: AD65B920933B4B20
5 changed files with 40 additions and 22 deletions

View file

@ -221,6 +221,16 @@ Either you define exactly which release you install. Or you use the option ``lat
| `gitea_only_allow_external_registration` | `false` | Set to true to force registration only using third-party services (true/false) |
| `gitea_enable_notify_mail` | `false` | Enable this to send e-mail to watchers of a repository when something happens, like creating issues (true/false) |
| `gitea_auto_watch_new_repos` | `true` | Enable this to let all organisation users watch new repos when they are created (true/false) |
| `gitea_autowatch_on_change` | `true` | Enable this to make users watch a repository after their first commit to it (true/false) |
| `gitea_register_manual_confirm` | `false` | Enable this to manually confirm new registrations. Requires REGISTER_EMAIL_CONFIRM to be disabled. |
| `gitea_default_allow_create_organization` | `true` | Allow new users to create organizations by default (true/false) |
| `gitea_email_domain_allowlist` | | If non-empty, comma separated list of domain names that can only be used to register on this instance, wildcard is supported. |
| `gitea_default_user_visibility` | `public` | Set default visibility mode for users, either "public", "limited" or "private". |
| `gitea_default_org_visibility` | `public` | Set default visibility mode for organisations, either "public", "limited" or "private". |
| `gitea_allow_only_internal_registration` | `false` | Set to true to force registration only via Gitea. |
| `gitea_allow_only_external_registration` | `false` | Set to true to force registration only using third-party services. |
| `gitea_show_milestones_dashboard_page` | `true` | Enable this to show the milestones dashboard page - a view of all the user's milestones |
| `gitea_default_user_is_restricted` | `false` | Give new users restricted permissions by default (true/false) |
| `gitea_service_extra_config` | | you can use this variable to pass additional config parameters in the `[service]` section of the config. |
### Mailer ([mailer](https://docs.gitea.io/en-us/config-cheat-sheet/#mailer-mailer))

View file

@ -156,25 +156,24 @@ gitea_security_extra_config: ''
# -> https://docs.gitea.io/en-us/config-cheat-sheet/#service-service
gitea_disable_registration: false
gitea_register_email_confirm: false
gitea_register_manual_confirm: false
gitea_require_signin: true
gitea_default_keep_mail_private: true
gitea_enable_captcha: true
gitea_show_registration_button: true
gitea_only_allow_external_registration: false
gitea_enable_notify_mail: false
gitea_service_extra_config: ''
gitea_auto_watch_new_repos: false
gitea_autowatch_on_change: true
# make sure, that register_email_confirm is false when register_manual_confirm is set to true
gitea_register_manual_confirm: true
gitea_auto_watch_new_repos: true
gitea_autowatch_on_change: false
gitea_default_allow_create_organization: false
gitea_default_user_is_restricted: true
gitea_default_user_is_restricted: false
gitea_email_domain_allowlist: ""
gitea_default_user_visibility: limited
gitea_default_org_visibility: limited
gitea_allow_only_internal_registration: true
gitea_show_mailstones_dashboard: true
# gitea_email_domain_allowlist: ""
gitea_default_user_visibility: public
gitea_default_org_visibility: public
gitea_allow_only_internal_registration: false
gitea_allow_only_external_registration: false
gitea_show_milestones_dashboard_page: true
gitea_service_extra_config: ''
# Mailer [mailer]
# -> https://docs.gitea.io/en-us/config-cheat-sheet/#mailer-mailer

View file

@ -1,4 +1,12 @@
---
- name: Make sure gitea_register_email_confirm is false when gitea_register_manual_confirm is true
ansible.builtin.fail:
msg: |
To manually confirm registrations,
gitea_register_email_confirm needs to be false
and gitea_register_manual_confirm should be true.
when: gitea_register_manual_confirm | bool and gitea_register_email_confirm | bool
- name: "Configure gitea"
become: true
ansible.builtin.template:

View file

@ -175,17 +175,18 @@ DEFAULT_KEEP_EMAIL_PRIVATE = {{ gitea_default_keep_mail_private | ternary('true'
SHOW_REGISTRATION_BUTTON = {{ gitea_show_registration_button | ternary('true', 'false') }}
AUTO_WATCH_NEW_REPOS = {{ gitea_auto_watch_new_repos | ternary('true', 'false') }}
ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_only_allow_external_registration | ternary('true', 'false') }}
AUTO_WATCH_ON_CHANGES = {{ gitea_autowatch_on_change }}
SHOW_MILESTONES_DASHBOARD_PAGE = {{ gitea_show_mailstones_dashboard }}
REGISTER_MANUAL_CONFIRM = {{ gitea_register_manual_confirm }}
DEFAULT_ALLOW_CREATE_ORGANIZATION = {{ gitea_default_allow_create_organization }}
DEFAULT_USER_IS_RESTRICTED = {{ gitea_default_user_is_restricted }}
{% if gitea_email_domain_allowlist is defined and gitea_email_domain_allowlist|length %}
AUTO_WATCH_ON_CHANGES = {{ gitea_autowatch_on_change | ternary('true', 'false') }}
SHOW_MILESTONES_DASHBOARD_PAGE = {{ gitea_show_milestones_dashboard_page | ternary('true', 'false') }}
REGISTER_MANUAL_CONFIRM = {{ gitea_register_manual_confirm | ternary('true', 'false') }}
DEFAULT_ALLOW_CREATE_ORGANIZATION = {{ gitea_default_allow_create_organization | ternary('true', 'false') }}
DEFAULT_USER_IS_RESTRICTED = {{ gitea_default_user_is_restricted | ternary('true', 'false') }}
{% if gitea_email_domain_allowlist is defined and gitea_email_domain_allowlist | length %}
EMAIL_DOMAIN_ALLOWLIST = {{ gitea_email_domain_allowlist }}
{% endif %}
DEFAULT_USER_VISIBILITY = {{ gitea_default_user_visibility }}
DEFAULT_ORG_VISIBILITY = {{ gitea_default_org_visibility }}
ALLOW_ONLY_INTERNAL_REGISTRATION = {{ gitea_allow_only_internal_registration }}
DEFAULT_USER_VISIBILITY = {{ gitea_default_user_visibility | ternary('true', 'false') }}
DEFAULT_ORG_VISIBILITY = {{ gitea_default_org_visibility | ternary('true', 'false') }}
ALLOW_ONLY_INTERNAL_REGISTRATION = {{ gitea_allow_only_internal_registration | ternary('true', 'false') }}
ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_allow_only_external_registration | ternary('true', 'false') }}
{{ gitea_service_extra_config }}
;
;
@ -308,4 +309,4 @@ ENABLE_FEED = {{ gitea_other_enable_feed | ternary('true', 'false') }}
;
;
; Optional additional config
{{ gitea_extra_config }}
{{ gitea_extra_config }}

View file

@ -62,5 +62,5 @@ transfer_custom_footer:
- 'files/gitea_footer/extra_links_footer.tmpl'
- 'files/extra_links_footer.tmpl'
playbook_version_number: 49 # should be int
playbook_version_number: 50 # should be int
playbook_version_path: 'do1jlr.gitea.version'