mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-17 02:13:06 -06:00
DCD-1123: Add nginx server for standalones.
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
atl_product_user: "jira"
|
atl_product_user: "jira"
|
||||||
atl_product_edition: "jira-software"
|
atl_product_edition: "jira-software"
|
||||||
atl_product_version: "8.13.0"
|
atl_product_version: "8.13.0"
|
||||||
|
atl_enable_clustering: false
|
||||||
|
|
||||||
atl_db_host: "localhost"
|
atl_db_host: "localhost"
|
||||||
atl_jdbc_user: "jira"
|
atl_jdbc_user: "jira"
|
||||||
@@ -25,12 +26,15 @@
|
|||||||
atl_jdbc_ctype: 'C'
|
atl_jdbc_ctype: 'C'
|
||||||
atl_jdbc_template: 'template0'
|
atl_jdbc_template: 'template0'
|
||||||
|
|
||||||
|
atl_jvm_heap: "12288m"
|
||||||
atl_use_system_jdk: true
|
atl_use_system_jdk: true
|
||||||
atl_download_format: "tarball"
|
atl_download_format: "tarball"
|
||||||
atl_systemd_service_name: "jira.service"
|
atl_systemd_service_name: "jira.service"
|
||||||
|
|
||||||
atl_write_tags: false
|
atl_write_tags: false
|
||||||
atl_enable_clustering: false
|
|
||||||
|
atl_proxy_map:
|
||||||
|
"": "http://localhost:8080"
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- role: linux_common
|
- role: linux_common
|
||||||
@@ -41,3 +45,4 @@
|
|||||||
- role: product_install
|
- role: product_install
|
||||||
- role: jira_config
|
- role: jira_config
|
||||||
- role: product_startup
|
- role: product_startup
|
||||||
|
- role: nginx
|
||||||
|
|||||||
3
roles/nginx/defaults/main.yml
Normal file
3
roles/nginx/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
atl_proxy_map: {}
|
||||||
12
roles/nginx/handlers/main.yml
Normal file
12
roles/nginx/handlers/main.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Restart nginx
|
||||||
|
command: systemctl restart nginx.service
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: Enable nginx
|
||||||
|
command: systemctl enable nginx.service
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: Reload systemd units
|
||||||
|
command: systemctl daemon-reload
|
||||||
17
roles/nginx/tasks/amazon.yml
Normal file
17
roles/nginx/tasks/amazon.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Enable nginx from 'extras'
|
||||||
|
command: amazon-linux-extras install -y "nginx1"
|
||||||
|
args:
|
||||||
|
creates: /sbin/nginx
|
||||||
|
environment:
|
||||||
|
PYTHON: /bin/python
|
||||||
|
|
||||||
|
- name: Reload systemd units
|
||||||
|
command: systemctl daemon-reload
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: Enable nginx
|
||||||
|
command: systemctl enable nginx.service
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
10
roles/nginx/tasks/main.yml
Normal file
10
roles/nginx/tasks/main.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
- name: Install distro-specific prerequisites
|
||||||
|
include_tasks: "{{ ansible_distribution|lower }}.yml"
|
||||||
|
|
||||||
|
- name: Create nginx configuration
|
||||||
|
template:
|
||||||
|
src: proxy.conf.j2
|
||||||
|
dest: /etc/nginx/default.d/proxy.conf
|
||||||
|
notify: Restart nginx
|
||||||
16
roles/nginx/templates/proxy.conf.j2
Normal file
16
roles/nginx/templates/proxy.conf.j2
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
{% for ctx, backend in atl_proxy_map.items() %}
|
||||||
|
location /{{ctx}} {
|
||||||
|
proxy_pass {{backend}};
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $http_connection;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Scheme $scheme;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
}
|
||||||
|
{% endfor %}
|
||||||
Reference in New Issue
Block a user