This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: apps/v1 | |
kind: StatefulSet | |
metadata: | |
name: jira | |
spec: | |
serviceName: jira | |
replicas: 3 | |
selector: | |
matchLabels: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
vars: | |
accounts: | |
dev: | |
account: 123 | |
contact: Jackie@123.com | |
uat: | |
account: 456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
atl_db_root_password: "{{ (lookup('aws_secret', '/jira/database/master', region='ap-southeast-2')| from_json).get('password') }}" | |
current_epoch_time_sec: "{{ ansible_date_time.epoch }}" | |
delete_threshold_hours: '24' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# a3 = Automate Atlassian Addons | |
def get_server_info(server, auth): | |
''' Check application version on the server ''' | |
print("\n>>> Checking server information") | |
server_application = server.split('.')[0].split('-')[0] | |
url = "https://{}/rest/applinks/1.0/manifest".format(server) | |
headers = {'content-type': 'application/xml'} | |
response = requests.get(url, auth=auth, headers=headers) | |
response.raise_for_status() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "MyTestDataBucketReadAccess", | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Install dependencies for snappy | |
yum: | |
name: | |
- gcc | |
- gcc-c++ | |
- automake | |
- snappy | |
- snappy-devel | |
- git | |
when: atl_product_family == "jira" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Wait for index files folder ready | |
wait_for: | |
path: "{{ atl_product_home }}/caches/indexesV1" | |
delay: 60 | |
sleep: 10 | |
timeout: 120 | |
ignore_errors: yes | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Delete old jira node operation records from replicatedindexoperation table | |
postgresql_query: | |
login_host: "{{ atl_db_host }}" | |
port: "{{ atl_db_port }}" | |
login_user: "{{ atl_db_root_user }}" | |
login_password: "{{ atl_db_root_password }}" | |
db: "{{ atl_jdbc_db_name }}" | |
query: DELETE FROM replicatedindexoperation AS Rep WHERE Rep.node_id NOT IN (SELECT node_id from clusternode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Check if this is a new cluster that has not been initialized | |
stat: | |
path: "{{ atl_product_home_shared }}/export/indexsnapshots" | |
register: snapshotfolder | |
- name: Remove offline jira nodes from clusternode table | |
postgresql_query: | |
login_host: "{{ atl_db_host }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import logging | |
import time | |
import boto3 | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
sts_client = boto3.client("sts") |