Skip to content

Commit

Permalink
feat: add meta/argument_specs.yml file (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
antmelekhin authored Aug 14, 2024
1 parent 2333444 commit 8c9374b
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/||')
Expand All @@ -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}"
Expand Down
31 changes: 3 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}"
117 changes: 117 additions & 0 deletions meta/argument_specs.yml
Original file line number Diff line number Diff line change
@@ -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') }}"

0 comments on commit 8c9374b

Please sign in to comment.