diff --git a/.github/scripts/update-version.sh b/.github/scripts/update-version.sh index 91848c9..4b41309 100755 --- a/.github/scripts/update-version.sh +++ b/.github/scripts/update-version.sh @@ -33,7 +33,7 @@ fi # Update latest version sed -i "s/_version:.*$/_version: '${LATEST_VERSION}'/" 'defaults/main.yml' -sed -i "s/${CURRENT_VERSION}/${LATEST_VERSION}/" 'README.md' +yq eval -i ".argument_specs.main.options.jira_version.default = \"${LATEST_VERSION}\"" 'meta/argument_specs.yml' # Repository variables REPO_NAME=$(git config --get remote.origin.url | sed -e 's|^https://github.com/||') @@ -49,7 +49,7 @@ if [ "${REMOTE_BRANCH}" == null ] ; then git checkout -b "${UPDATE_VERSION_BRANCH}" # Push new version - git add defaults/main.yml README.md + git add defaults/main.yml meta/argument_specs.yml git commit --signoff -m "${UPDATE_VERSION_COMMIT}" echo -e "${GREEN}Pushing to ${UPDATE_VERSION_BRANCH} branch.${NO_COLOR}" diff --git a/README.md b/README.md index 8f2bcc2..9106640 100644 --- a/README.md +++ b/README.md @@ -24,34 +24,9 @@ Requirements Role Variables -------------- -- `jira_product` Jira product. Available values are: `software` (default), `core`. -- `jira_version` The version of Jira to download (default: `9.12.11`). -- `jira_archive_name` Jira archive name (default: `atlassian-jira-software-9.12.11.tar.gz`). -- `jira_download_url` URL to download the Jira archive (default: `https://www.atlassian.com/software/jira/downloads/binary`). -- `jira_checksum_url` The Jira checksum file URL (default: `{{ jira_download_url }}/{{ jira_archive_name }}.sha256`). -- `jira_download_path` Local path to download and extract the archive (default: `/tmp`). -- `jira_user` and `jira_group` System user and group that will be created (default: `jira`). -- `jira_root_path` The Jira installation directory (default: `/opt/atlassian/jira`). -- `jira_home_path` The Jira home directory (default: `/var/atlassian/application-data/jira`). -- `jira_min_nofiles_limit` If the limit of files that Jira can open is too low, it will be set to this value (default: `16384`). -- `jira_jvm_support_recommends_args` Occasionally Atlassian Support may recommend that you set some specific JVM arguments (default: `null`). -- `jira_jvm_gc_args` You can use variable below to modify garbage collector settings (default: `-XX:+ExplicitGCInvokesConcurrent`). -- `jira_jvm_minimum_memory` and `jira_jvm_maximum_memory` The minimum and maximum size of the heap (default: `384m` and `2048m`). -- `jira_jvm_initial_code_cache_size` and `jira_jvm_reserved_code_cache_size` The size of JVM code cache (default: `32m` and `512m`). A high value of reserved size allows Jira to work with more installed apps. -- `jira_jvm_required_args` The following are the required arguments for Jira. -- `jira_db_configuration` DB connection configuration (default: `false`). -- `jira_db_address` Hostname or IP address of your database server. -- `jira_db_port` TCP port number for your database server. -- `jira_db_name` DB name. -- `jira_db_username` and `jira_db_password` Database username and password to be passed to the JDBC driver. -- `jira_catalina_connector_proxyname` Fqdn server name. If you don't use a reverse proxy, then you'll need to leave this variable without value. -- `jira_catalina_connector_scheme` Connection scheme. Available values are: `http` (default), `https`. - - **Attention** If you use `https` value, you'll need to install SSL sertificate on server with reverse proxy. - -- `jira_catalina_connector_proxyport` Server port (default: `80` or `443`). - - `80` sets automatically if value in `jira_catalina_connector_scheme` is `http`. - - `443` sets automatically if value in `jira_catalina_connector_scheme` is `https`. +All variables that can be overridden are stored in the [defaults/main.yml](https://github.com/antmelekhin/ansible-role-jira/blob/main/defaults/main.yml) file. +Please refer to the [meta/argument_specs.yml](https://github.com/antmelekhin/ansible-role-jira/blob/main/meta/argument_specs.yml) file for a description of the available variables. +Similarly, descriptions and defaults for preset variables can be found in the [vars/main.yml](https://github.com/antmelekhin/ansible-role-jira/blob/main/vars/main.yml) file. Dependencies ------------ diff --git a/defaults/main.yml b/defaults/main.yml index 361dac5..3a262e7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -34,4 +34,4 @@ jira_db_password: '' # The Jira proxy settings jira_catalina_connector_proxyname: '' jira_catalina_connector_scheme: 'http' -jira_catalina_connector_proxyport: '{{ (jira_catalina_connector_scheme | lower == "http") | ternary("80", "443") }}' +jira_catalina_connector_proxyport: "{{ (jira_catalina_connector_scheme | lower == 'http') | ternary('80', '443') }}" diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml new file mode 100644 index 0000000..951b71b --- /dev/null +++ b/meta/argument_specs.yml @@ -0,0 +1,117 @@ +--- +argument_specs: + main: + short_description: 'Jira' + description: + - 'An Ansible role to install, configure and update L(Jira,https://www.atlassian.com/ru/software/jira).' + author: + - 'Melekhin Anton' + options: + jira_product: + type: 'str' + description: 'Jira product.' + choices: + - 'core' + - 'software' + default: 'software' + jira_version: + type: 'str' + description: 'The version of Jira to download.' + default: '9.12.11' + jira_archive_name: + type: 'str' + description: 'Jira archive name.' + default: 'atlassian-jira-{{ jira_product }}-{{ jira_version }}.tar.gz' + jira_download_url: + type: 'str' + description: 'URL to download the Jira archive.' + default: 'https://www.atlassian.com/software/jira/downloads/binary' + jira_checksum_url: + type: 'str' + description: 'The Jira checksum file URL.' + default: '{{ jira_download_url }}/{{ jira_archive_name }}.sha256' + jira_download_path: + type: 'path' + description: 'Local path to download and extract the archive.' + default: '/tmp' + jira_user: + type: 'str' + description: 'System user that will be created.' + default: 'jira' + jira_group: + type: 'str' + description: 'System group that will be created.' + default: '{{ jira_user }}' + jira_root_path: + type: 'path' + description: 'The Jira installation directory.' + default: '/opt/atlassian/jira' + jira_home_path: + type: 'path' + description: 'The Jira home directory.' + default: '/var/atlassian/application-data/jira' + jira_min_nofiles_limit: + type: 'int' + description: 'If the limit of files that Jira can open is too low, it will be set to this value.' + default: 16384 + jira_jvm_support_recommends_args: + type: 'str' + description: 'Occasionally Atlassian Support may recommend that you set some specific JVM arguments.' + jira_jvm_gc_args: + type: 'str' + description: 'You can use variable below to modify garbage collector settings.' + default: '-XX:+ExplicitGCInvokesConcurrent' + jira_jvm_minimum_memory: + type: 'str' + description: 'The minimum size of the heap.' + default: '384m' + jira_jvm_maximum_memory: + type: 'str' + description: 'The maximum size of the heap.' + default: '2048m' + jira_jvm_initial_code_cache_size: + type: 'str' + description: 'The size of JVM code cache.' + default: '32m' + jira_jvm_reserved_code_cache_size: + type: 'str' + description: 'The size of JVM code cache. A high value of reserved size allows Jira to work with more installed apps.' + default: '512m' + jira_db_configuration: + type: 'bool' + description: 'DB connection configuration.' + default: false + jira_db_host: + type: 'str' + description: 'Hostname or IP address of your database server.' + jira_db_port: + type: 'str' + description: 'TCP port number for your database server.' + jira_db_name: + type: 'str' + description: 'DB name.' + jira_db_username: + type: 'str' + description: 'Database username to be passed to the JDBC driver.' + jira_db_password: + type: 'str' + description: 'Database password to be passed to the JDBC driver.' + jira_catalina_connector_proxyname: + type: 'str' + description: "Fqdn server name. If you don't use a reverse proxy, then you'll need to leave this variable without value." + jira_catalina_connector_scheme: + type: 'str' + description: + - 'Connection scheme.' + - "If you use C(https) value, you'll need to install SSL sertificate on server with reverse proxy." + choices: + - 'http' + - 'https' + default: 'http' + jira_catalina_connector_proxyport: + type: 'int' + description: + - 'Server port.' + - '80 port sets automatically if value in C(jira_catalina_connector_scheme) variable is C(http).' + - '443 port sets automatically if value in C(jira_catalina_connector_scheme) variable is C(https).' + default: "{{ (jira_catalina_connector_scheme | lower == 'http') | ternary('80', '443') }}"