mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-14 00:43:06 -06:00
Merged in feature/ITOPS-2059-add-clone-support (pull request #17)
Feature/ITOPS-2059 add clone support Approved-by: Steve Smith <ssmith@atlassian.com>
This commit is contained in:
17
aws_clone_nfs.yml
Normal file
17
aws_clone_nfs.yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
- hosts: aws_node_local
|
||||||
|
become: true
|
||||||
|
|
||||||
|
vars:
|
||||||
|
# See group_vars/aws_node_local.yml, which pull vars from the environment.
|
||||||
|
atl_product_family: "nfs_server"
|
||||||
|
atl_product_edition: "nfs_server"
|
||||||
|
atl_product_user: "atlassian"
|
||||||
|
|
||||||
|
atl_nfs_mountpoint: "{{ atl_shared_mountpoint }}/{{ atl_product_user }}/shared"
|
||||||
|
atl_nfs_target: "{{ atl_shared_mountpoint }}/{{ atl_product_user }}/shared"
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- role: linux_common
|
||||||
|
- role: aws_common
|
||||||
|
- role: nfs_server
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: linux_common
|
- role: linux_common
|
||||||
- role: aws_common
|
- role: aws_common
|
||||||
- role: aws_efs_config
|
- role: aws_shared_fs_config
|
||||||
- role: product_common
|
- role: product_common
|
||||||
- role: product_install
|
- role: product_install
|
||||||
- role: database_init
|
- role: database_init
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: linux_common
|
- role: linux_common
|
||||||
- role: aws_common
|
- role: aws_common
|
||||||
- role: aws_efs_config
|
- role: aws_shared_fs_config
|
||||||
- role: product_common
|
- role: product_common
|
||||||
- role: product_install
|
- role: product_install
|
||||||
- role: confluence_common
|
- role: confluence_common
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: linux_common
|
- role: linux_common
|
||||||
- role: aws_common
|
- role: aws_common
|
||||||
- role: aws_efs_config
|
- role: aws_shared_fs_config
|
||||||
- role: product_common
|
- role: product_common
|
||||||
- role: product_install
|
- role: product_install
|
||||||
- role: database_init
|
- role: database_init
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: linux_common
|
- role: linux_common
|
||||||
- role: aws_common
|
- role: aws_common
|
||||||
- role: aws_efs_config
|
- role: aws_shared_fs_config
|
||||||
- role: product_common
|
- role: product_common
|
||||||
- role: product_install
|
- role: product_install
|
||||||
- role: database_init
|
- role: database_init
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ git_version: "2.14.4"
|
|||||||
atl_shared_mountpoint: "/media/atl"
|
atl_shared_mountpoint: "/media/atl"
|
||||||
|
|
||||||
# Simplify NFS mapping by using a fixed UID
|
# Simplify NFS mapping by using a fixed UID
|
||||||
atl_product_user_uid: '2001'
|
atl_product_user_uid: "{{ lookup('env', 'ATL_PRODUCT_USER_UID') or '2001' }}"
|
||||||
|
|
||||||
# FIXME: Some of these should be overridden from the environment?
|
# FIXME: Some of these should be overridden from the environment?
|
||||||
atl_home_base: "/var/atlassian/application-data"
|
atl_home_base: "/var/atlassian/application-data"
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
efs_target: "{{ atl_efs_id }}"
|
|
||||||
5
roles/aws_shared_fs_config/defaults/main.yml
Normal file
5
roles/aws_shared_fs_config/defaults/main.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
efs_target: "{{ atl_efs_id }}"
|
||||||
|
efs_type: "{{ lookup('env', 'ATL_EFS_TYPE') or 'efs' }}"
|
||||||
|
efs_src_dir: "{{ lookup('env', 'ATL_EFS_SRC_DIR') or '/' }}"
|
||||||
|
efs_mount_options: "{{ lookup('env', 'ATL_EFS_MOUNT_OPTIONS') or 'defaults,_netdev' }}"
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
- name: Enable mountpoint in fstab
|
- name: Enable mountpoint in fstab
|
||||||
mount:
|
mount:
|
||||||
path: "{{ atl_shared_mountpoint }}"
|
path: "{{ atl_shared_mountpoint }}"
|
||||||
src: "{{ efs_target }}:/"
|
src: "{{ efs_target }}:{{ efs_src_dir }}"
|
||||||
fstype: efs
|
fstype: "{{ efs_type }}"
|
||||||
opts: "defaults,_netdev"
|
opts: "{{ efs_mount_options }}"
|
||||||
state: mounted
|
state: mounted
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
insertafter: "EOF"
|
insertafter: "EOF"
|
||||||
line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"'
|
line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"'
|
||||||
|
|
||||||
- name: Set JAVA_HOME
|
- name: Set JAVA_HOME #FIXME
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh"
|
path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh"
|
||||||
insertafter: "EOF"
|
insertafter: "EOF"
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
name: "{{ atl_jdbc_user }}"
|
name: "{{ atl_jdbc_user }}"
|
||||||
password: "{{ atl_jdbc_password }}"
|
password: "{{ atl_jdbc_password }}"
|
||||||
expires: 'infinity'
|
expires: 'infinity'
|
||||||
|
tags:
|
||||||
|
- new_only
|
||||||
|
|
||||||
- name: Update root privs for new user
|
- name: Update root privs for new user
|
||||||
postgresql_privs:
|
postgresql_privs:
|
||||||
@@ -19,6 +21,8 @@
|
|||||||
roles: "{{ atl_db_root_user }}"
|
roles: "{{ atl_db_root_user }}"
|
||||||
objs: "{{ atl_jdbc_user }}"
|
objs: "{{ atl_jdbc_user }}"
|
||||||
type: group
|
type: group
|
||||||
|
tags:
|
||||||
|
- new_only
|
||||||
|
|
||||||
- name: Create application database
|
- name: Create application database
|
||||||
postgresql_db:
|
postgresql_db:
|
||||||
@@ -32,3 +36,5 @@
|
|||||||
lc_collate: "{{ atl_jdbc_collation }}"
|
lc_collate: "{{ atl_jdbc_collation }}"
|
||||||
lc_ctype: "{{ atl_jdbc_ctype }}"
|
lc_ctype: "{{ atl_jdbc_ctype }}"
|
||||||
template: "{{ atl_jdbc_template }}"
|
template: "{{ atl_jdbc_template }}"
|
||||||
|
tags:
|
||||||
|
- new_only
|
||||||
|
|||||||
@@ -15,8 +15,14 @@
|
|||||||
- fontconfig
|
- fontconfig
|
||||||
- python-psycopg2
|
- python-psycopg2
|
||||||
|
|
||||||
|
- name: Create product group
|
||||||
|
group:
|
||||||
|
name: "{{ atl_product_user }}"
|
||||||
|
gid: "{{ atl_product_user_uid }}"
|
||||||
|
|
||||||
- name: Create product user
|
- name: Create product user
|
||||||
user:
|
user:
|
||||||
name: "{{ atl_product_user }}"
|
name: "{{ atl_product_user }}"
|
||||||
uid: "{{ atl_product_user_uid }}"
|
uid: "{{ atl_product_user_uid }}"
|
||||||
|
group: "{{ atl_product_user }}"
|
||||||
comment: "Product runtime user"
|
comment: "Product runtime user"
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
atl_nfs_server_device: "{{ lookup('env', 'ATL_NFS_SERVER_DEVICE') }}"
|
atl_nfs_server_device: "{{ lookup('env', 'ATL_NFS_SERVER_DEVICE') }}"
|
||||||
atl_nfs_fs_type: "xfs"
|
atl_nfs_fs_type: "{{ lookup('env', 'ATL_NFS_FS_TYPE') or 'xfs' }}"
|
||||||
atl_nfs_fs_label: "BB-Shared"
|
atl_nfs_fs_label: "{{ lookup('env', 'ATL_NFS_FS_LABEL') or 'BB-Shared' }}"
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
number: 1
|
number: 1
|
||||||
flags:
|
flags:
|
||||||
- "{{ atl_nfs_fs_type }}"
|
- "{{ atl_nfs_fs_type }}"
|
||||||
|
tags:
|
||||||
|
- new_only
|
||||||
|
|
||||||
|
|
||||||
- name: Create the filesystem
|
- name: Create the filesystem
|
||||||
@@ -24,6 +26,8 @@
|
|||||||
dev: "{{ atl_nfs_server_device }}"
|
dev: "{{ atl_nfs_server_device }}"
|
||||||
fstype: "{{ atl_nfs_fs_type }}"
|
fstype: "{{ atl_nfs_fs_type }}"
|
||||||
opts: "-L {{ atl_nfs_fs_label }}"
|
opts: "-L {{ atl_nfs_fs_label }}"
|
||||||
|
tags:
|
||||||
|
- new_only
|
||||||
|
|
||||||
- name: Setup fstab and mount the filesystem
|
- name: Setup fstab and mount the filesystem
|
||||||
mount:
|
mount:
|
||||||
@@ -33,13 +37,15 @@
|
|||||||
state: mounted
|
state: mounted
|
||||||
|
|
||||||
|
|
||||||
- name: Create the shared home as BB mounts this directly
|
- name: Create the shared home
|
||||||
file:
|
file:
|
||||||
path: "{{ atl_shared_mountpoint }}/bitbucket/shared"
|
path: "{{ atl_shared_mountpoint }}/{{ atl_product_user }}/shared"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ atl_product_user }}"
|
owner: "{{ atl_product_user }}"
|
||||||
group: "{{ atl_product_user }}"
|
group: "{{ atl_product_user }}"
|
||||||
mode: 0750
|
mode: 0750
|
||||||
|
tags:
|
||||||
|
- new_only
|
||||||
|
|
||||||
|
|
||||||
- name: Create the NFS export file
|
- name: Create the NFS export file
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
# Created by Ansible
|
# Created by Ansible
|
||||||
/media/atl *(rw,no_root_squash)
|
/media/atl *(rw,no_root_squash,no_subtree_check,sync)
|
||||||
|
|||||||
Reference in New Issue
Block a user