mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 08:23: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:
|
||||
- role: linux_common
|
||||
- role: aws_common
|
||||
- role: aws_efs_config
|
||||
- role: aws_shared_fs_config
|
||||
- role: product_common
|
||||
- role: product_install
|
||||
- role: database_init
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
roles:
|
||||
- role: linux_common
|
||||
- role: aws_common
|
||||
- role: aws_efs_config
|
||||
- role: aws_shared_fs_config
|
||||
- role: product_common
|
||||
- role: product_install
|
||||
- role: confluence_common
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
roles:
|
||||
- role: linux_common
|
||||
- role: aws_common
|
||||
- role: aws_efs_config
|
||||
- role: aws_shared_fs_config
|
||||
- role: product_common
|
||||
- role: product_install
|
||||
- role: database_init
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
roles:
|
||||
- role: linux_common
|
||||
- role: aws_common
|
||||
- role: aws_efs_config
|
||||
- role: aws_shared_fs_config
|
||||
- role: product_common
|
||||
- role: product_install
|
||||
- role: database_init
|
||||
|
||||
@@ -15,7 +15,7 @@ git_version: "2.14.4"
|
||||
atl_shared_mountpoint: "/media/atl"
|
||||
|
||||
# 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?
|
||||
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
|
||||
mount:
|
||||
path: "{{ atl_shared_mountpoint }}"
|
||||
src: "{{ efs_target }}:/"
|
||||
fstype: efs
|
||||
opts: "defaults,_netdev"
|
||||
src: "{{ efs_target }}:{{ efs_src_dir }}"
|
||||
fstype: "{{ efs_type }}"
|
||||
opts: "{{ efs_mount_options }}"
|
||||
state: mounted
|
||||
@@ -27,7 +27,7 @@
|
||||
insertafter: "EOF"
|
||||
line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"'
|
||||
|
||||
- name: Set JAVA_HOME
|
||||
- name: Set JAVA_HOME #FIXME
|
||||
lineinfile:
|
||||
path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh"
|
||||
insertafter: "EOF"
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
name: "{{ atl_jdbc_user }}"
|
||||
password: "{{ atl_jdbc_password }}"
|
||||
expires: 'infinity'
|
||||
tags:
|
||||
- new_only
|
||||
|
||||
- name: Update root privs for new user
|
||||
postgresql_privs:
|
||||
@@ -19,6 +21,8 @@
|
||||
roles: "{{ atl_db_root_user }}"
|
||||
objs: "{{ atl_jdbc_user }}"
|
||||
type: group
|
||||
tags:
|
||||
- new_only
|
||||
|
||||
- name: Create application database
|
||||
postgresql_db:
|
||||
@@ -32,3 +36,5 @@
|
||||
lc_collate: "{{ atl_jdbc_collation }}"
|
||||
lc_ctype: "{{ atl_jdbc_ctype }}"
|
||||
template: "{{ atl_jdbc_template }}"
|
||||
tags:
|
||||
- new_only
|
||||
|
||||
@@ -15,8 +15,14 @@
|
||||
- fontconfig
|
||||
- python-psycopg2
|
||||
|
||||
- name: Create product group
|
||||
group:
|
||||
name: "{{ atl_product_user }}"
|
||||
gid: "{{ atl_product_user_uid }}"
|
||||
|
||||
- name: Create product user
|
||||
user:
|
||||
name: "{{ atl_product_user }}"
|
||||
uid: "{{ atl_product_user_uid }}"
|
||||
comment: "Product runtime user"
|
||||
group: "{{ atl_product_user }}"
|
||||
comment: "Product runtime user"
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
|
||||
atl_nfs_server_device: "{{ lookup('env', 'ATL_NFS_SERVER_DEVICE') }}"
|
||||
atl_nfs_fs_type: "xfs"
|
||||
atl_nfs_fs_label: "BB-Shared"
|
||||
atl_nfs_fs_type: "{{ lookup('env', 'ATL_NFS_FS_TYPE') or 'xfs' }}"
|
||||
atl_nfs_fs_label: "{{ lookup('env', 'ATL_NFS_FS_LABEL') or 'BB-Shared' }}"
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
number: 1
|
||||
flags:
|
||||
- "{{ atl_nfs_fs_type }}"
|
||||
tags:
|
||||
- new_only
|
||||
|
||||
|
||||
- name: Create the filesystem
|
||||
@@ -24,6 +26,8 @@
|
||||
dev: "{{ atl_nfs_server_device }}"
|
||||
fstype: "{{ atl_nfs_fs_type }}"
|
||||
opts: "-L {{ atl_nfs_fs_label }}"
|
||||
tags:
|
||||
- new_only
|
||||
|
||||
- name: Setup fstab and mount the filesystem
|
||||
mount:
|
||||
@@ -33,13 +37,15 @@
|
||||
state: mounted
|
||||
|
||||
|
||||
- name: Create the shared home as BB mounts this directly
|
||||
- name: Create the shared home
|
||||
file:
|
||||
path: "{{ atl_shared_mountpoint }}/bitbucket/shared"
|
||||
path: "{{ atl_shared_mountpoint }}/{{ atl_product_user }}/shared"
|
||||
state: directory
|
||||
owner: "{{ atl_product_user }}"
|
||||
group: "{{ atl_product_user }}"
|
||||
mode: 0750
|
||||
tags:
|
||||
- new_only
|
||||
|
||||
|
||||
- name: Create the NFS export file
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# 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