From b960c1c4cbbc4fe855cc397b7cae274db2737223 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 05:34:52 +0000 Subject: [PATCH 01/26] crowd --- aws_crowd_dc_node.yml | 19 +++++ group_vars/aws_node_local.yml | 1 + roles/aws_common/tasks/main.yml | 2 +- roles/aws_efs_config/tasks/main.yml | 2 + roles/crowd_config/defaults/main.yml | 38 +++++++++ roles/crowd_config/tasks/main.yml | 83 +++++++++++++++++++ .../templates/cluster.properties.j2 | 2 + roles/crowd_config/templates/dbconfig.xml.j2 | 28 +++++++ roles/crowd_config/templates/server.xml.j2 | 28 +++++++ roles/crowd_install/tasks/main.yml | 0 roles/nfs_mount/tasks/main.yml | 2 + roles/product_install/defaults/main.yml | 5 +- .../tasks/crowd_extra_tasks.yml | 1 + roles/product_install/tasks/crowd_install.yml | 44 ++++++++++ .../tasks/crowd_version_latest.yml | 13 +++ roles/product_install/tasks/main.yml | 19 ++++- .../templates/crowd.varfile.j2 | 13 +++ roles/product_startup/defaults/main.yml | 2 + roles/product_startup/tasks/main.yml | 10 +++ .../templates/crowd.service.j2 | 19 +++++ 20 files changed, 327 insertions(+), 4 deletions(-) create mode 100644 aws_crowd_dc_node.yml create mode 100644 roles/crowd_config/defaults/main.yml create mode 100644 roles/crowd_config/tasks/main.yml create mode 100644 roles/crowd_config/templates/cluster.properties.j2 create mode 100644 roles/crowd_config/templates/dbconfig.xml.j2 create mode 100644 roles/crowd_config/templates/server.xml.j2 create mode 100644 roles/crowd_install/tasks/main.yml create mode 100644 roles/product_install/tasks/crowd_extra_tasks.yml create mode 100644 roles/product_install/tasks/crowd_install.yml create mode 100644 roles/product_install/tasks/crowd_version_latest.yml create mode 100644 roles/product_install/templates/crowd.varfile.j2 create mode 100644 roles/product_startup/templates/crowd.service.j2 diff --git a/aws_crowd_dc_node.yml b/aws_crowd_dc_node.yml new file mode 100644 index 0000000..5dd3260 --- /dev/null +++ b/aws_crowd_dc_node.yml @@ -0,0 +1,19 @@ +--- +- hosts: aws_node_local + become: true + + vars: + # See group_vars/aws_node_local.yml, which pull vars from the environment. + atl_product_family: "crowd" + atl_product_user: "crowd" + atl_product_edition: "crowd" + + roles: + - role: linux_common + - role: aws_common + - role: aws_efs_config + - role: product_common + - role: product_install + - role: database_init + - role: crowd_config + - role: product_startup diff --git a/group_vars/aws_node_local.yml b/group_vars/aws_node_local.yml index 699745f..f37718b 100644 --- a/group_vars/aws_node_local.yml +++ b/group_vars/aws_node_local.yml @@ -24,6 +24,7 @@ atl_product_shared_home_map: confluence: "confluence/shared-home" jira: "jira/shared" stash: "bitbucket/shared" + crowd: "crowd/shared" atl_product_home_shared: "{{ atl_shared_mountpoint }}/{{ atl_product_shared_home_map[atl_product_family] }}" atl_product_shared_plugins: "{{ atl_product_home_shared }}/plugins/installed-plugins" diff --git a/roles/aws_common/tasks/main.yml b/roles/aws_common/tasks/main.yml index 087b681..d658d80 100644 --- a/roles/aws_common/tasks/main.yml +++ b/roles/aws_common/tasks/main.yml @@ -11,4 +11,4 @@ - name: Use EC2 instance ID for cluster node ID set_fact: atl_cluster_node_id: "{{ ansible_ec2_instance_id }}" - atl_local_ipv4: "{{ ansible_ec2_local_ipv4 | default(ansible_default_ipv4.address) }}" + atl_local_ipv4: "{{ ansible_ec2_local_ipv4 | default(ansible_default_ipv4) }}" diff --git a/roles/aws_efs_config/tasks/main.yml b/roles/aws_efs_config/tasks/main.yml index df8ca09..33ab2aa 100644 --- a/roles/aws_efs_config/tasks/main.yml +++ b/roles/aws_efs_config/tasks/main.yml @@ -5,6 +5,7 @@ state: directory path: "{{ atl_shared_mountpoint }}" mode: 0755 + when: atl_product_edition!= "crowd" - name: Enable mountpoint in fstab mount: @@ -13,3 +14,4 @@ fstype: efs opts: "defaults,_netdev" state: mounted + when: atl_product_edition!= "crowd" diff --git a/roles/crowd_config/defaults/main.yml b/roles/crowd_config/defaults/main.yml new file mode 100644 index 0000000..641d4d7 --- /dev/null +++ b/roles/crowd_config/defaults/main.yml @@ -0,0 +1,38 @@ +--- + +atl_jvm_heap: "2048m" + +atl_catalina_opts: "" +atl_catalina_opts_extra: >- + -XX:+UseG1GC + -XX:+PrintAdaptiveSizePolicy + -XX:+UseGCLogFileRotation + -XX:+PrintTenuringDistribution + -Dfile.encoding=UTF-8 + +atl_tomcat_mgmt_port: "8020" +atl_tomcat_acceptcount: "10" +atl_tomcat_connectiontimeout: "20000" +atl_tomcat_enablelookups: "false" +atl_tomcat_maxthreads: "200" +atl_tomcat_minsparethreads: "10" +atl_tomcat_port: "8080" +atl_tomcat_redirectport: "8443" +atl_tomcat_secure: "true" +atl_tomcat_scheme: "https" +atl_proxy_port: "443" +atl_tomcat_protocol: "HTTP/1.1" +atl_tomcat_contextpath: "" + +atl_db_poolminsize: '20' +atl_db_poolmaxsize: '100' +atl_db_minidle: '10' +atl_db_maxidle: '20' + +atl_db_maxwaitmillis: '30000' +atl_db_timebetweenevictionrunsmillis: '30000' +atl_db_minevictableidletimemillis: '5000' +atl_db_removeabandoned: 'true' +atl_db_removeabandonedtimeout: '300' +atl_db_testwhileidle: 'true' +atl_db_testonborrow: 'false' diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml new file mode 100644 index 0000000..650e313 --- /dev/null +++ b/roles/crowd_config/tasks/main.yml @@ -0,0 +1,83 @@ +--- + + +- name: Create database config + template: + src: dbconfig.xml.j2 + dest: "{{ atl_product_home }}/dbconfig.xml" + owner: "{{ atl_product_user }}" + +- name: Create cluster config + template: + src: cluster.properties.j2 + dest: "{{ atl_product_home }}/cluster.properties" + owner: "{{ atl_product_user }}" + +- name: Create server config + template: + src: server.xml.j2 + dest: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}/apache-tomcat/conf/server.xml" + +- name: Override JVM memory settings. + # Ugly but necessary as the product installs this file so we need to make the change here. + lineinfile: + path: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}/apache-tomcat/bin/setenv.sh" + backrefs: true + regexp: "^{{ item }}=" + line: "{{ item }}=\"{{ atl_jvm_heap }}\"" + with_items: + - 'JVM_MINIMUM_MEMORY' + - 'JVM_MAXIMUM_MEMORY' + +- name: Set Crowd home directory + lineinfile: + path: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}/apache-tomcat/bin/setenv.sh" + regexp: "CROWD_HOME=" + line: 'CROWD_HOME="{{ atl_product_home }}"' + +- name: Set the Tomcat environment + lineinfile: + path: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}/apache-tomcat/bin/setenv.sh" + insertafter: "EOF" + line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"' + +- name: Create application directories + file: + path: "{{ item }}" + state: directory + mode: 0750 + owner: "{{ atl_product_user }}" + group: "{{ atl_product_user }}" + with_items: + - "{{ atl_product_home }}" + - "{{ atl_product_home_shared }}" + - "{{ atl_product_shared_plugins }}" + changed_when: false # For Molecule idempotence check + + +- name: Limit permissions on the installation directory + file: + path: "{{ atl_product_installation_versioned }}" + owner: "root" + group: "root" + mode: "u=rwX,g=rX,o=rX" + recurse: true + with_items: + - "{{ atl_installer_temp }}" + - "{{ atl_product_installation_versioned }}" + - "{{ atl_product_version_cache_dir }}" + changed_when: false # For Molecule idempotence check + +- name: Grant access to the product working directories + file: + path: "{{ item }}" + state: directory + mode: "u=rwX,g=rX,o-rwx" + owner: "{{ atl_product_user }}" + group: "{{ atl_product_user }}" + recurse: true + with_items: + - "{{ atl_product_installation_versioned }}/logs" + - "{{ atl_product_installation_versioned }}/temp" + - "{{ atl_product_installation_versioned }}/work" + changed_when: false # For Molecule idempotence check diff --git a/roles/crowd_config/templates/cluster.properties.j2 b/roles/crowd_config/templates/cluster.properties.j2 new file mode 100644 index 0000000..d7774bc --- /dev/null +++ b/roles/crowd_config/templates/cluster.properties.j2 @@ -0,0 +1,2 @@ +crowd.node.id = {{ atl_cluster_node_id }} +crowd.shared.home = {{ atl_product_home_shared }} diff --git a/roles/crowd_config/templates/dbconfig.xml.j2 b/roles/crowd_config/templates/dbconfig.xml.j2 new file mode 100644 index 0000000..18c9ed7 --- /dev/null +++ b/roles/crowd_config/templates/dbconfig.xml.j2 @@ -0,0 +1,28 @@ + + + + defaultDS + default + postgres72 + public + + {{ atl_jdbc_url }} + {{ atl_jdbc_user }} + {{ atl_jdbc_password }} + {{ atl_db_driver }} + + {{ atl_db_poolminsize }} + {{ atl_db_poolmaxsize }} + {{ atl_db_minidle }} + {{ atl_db_maxidle }} + + {{ atl_db_maxwaitmillis }} + select 1 + {{ atl_db_timebetweenevictionrunsmillis }} + {{ atl_db_minevictableidletimemillis }} + {{ atl_db_removeabandoned }} + {{ atl_db_removeabandonedtimeout }} + {{ atl_db_testwhileidle }} + {{ atl_db_testonborrow }} + + diff --git a/roles/crowd_config/templates/server.xml.j2 b/roles/crowd_config/templates/server.xml.j2 new file mode 100644 index 0000000..b882ff8 --- /dev/null +++ b/roles/crowd_config/templates/server.xml.j2 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/roles/crowd_install/tasks/main.yml b/roles/crowd_install/tasks/main.yml new file mode 100644 index 0000000..e69de29 diff --git a/roles/nfs_mount/tasks/main.yml b/roles/nfs_mount/tasks/main.yml index 9e170e4..f810659 100644 --- a/roles/nfs_mount/tasks/main.yml +++ b/roles/nfs_mount/tasks/main.yml @@ -7,6 +7,7 @@ mode: 0755 owner: "{{ atl_product_user }}" group: "{{ atl_product_user }}" + when: atl_product_edition!= "crowd" - name: Enable mountpoint in fstab mount: @@ -15,3 +16,4 @@ fstype: nfs opts: "rw,nfsvers=4.1,lookupcache=pos,noatime,intr,rsize=32768,wsize=32768,_netdev" state: mounted + when: atl_product_edition!= "crowd" diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index 9b26675..592635e 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -10,10 +10,13 @@ atl_product_version_cache: "{{ atl_product_home_shared }}/{{ atl_product_edition atl_release_base_url: "https://product-downloads.atlassian.com/software" atl_product_base_url: "{{ atl_release_base_url }}/{{ atl_product_family }}/downloads" -atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}-x64.bin" +atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}-x64.bin " +atl_crowd_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}.tar.gz" +atl_crowd_latest_url: "https://www.atlassian.com/software/crowd/downloads/binary/crowd-standalone-distribution-{{atl_latest_version}}.tar.gz" atl_product_download_filename: "{{ atl_download_edition | default(atl_product_edition) }}.{{ atl_product_version }}.bin" atl_product_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}" +atl_crowd_download: "{{ atl_installer_temp }}" atl_product_varfile: "{{ atl_installer_temp }}/{{ atl_product_family }}.varfile" atl_marketplace_base: "https://marketplace.atlassian.com" diff --git a/roles/product_install/tasks/crowd_extra_tasks.yml b/roles/product_install/tasks/crowd_extra_tasks.yml new file mode 100644 index 0000000..6b96fe0 --- /dev/null +++ b/roles/product_install/tasks/crowd_extra_tasks.yml @@ -0,0 +1 @@ +no_op.yml diff --git a/roles/product_install/tasks/crowd_install.yml b/roles/product_install/tasks/crowd_install.yml new file mode 100644 index 0000000..492ed54 --- /dev/null +++ b/roles/product_install/tasks/crowd_install.yml @@ -0,0 +1,44 @@ +- debug: + msg: "atl_latest_version - {{atl_latest_version}}" + +- name: Fetch crowd installer + get_url: + url: "{{atl_crowd_download_url}}" + dest: "{{atl_crowd_download}}" + mode: 0755 + force: false + when: not atl_latest_version + +- name: Fetch latest crowd installer + get_url: + url: "{{ atl_crowd_latest_url }}" + dest: "{{atl_crowd_download}}" + mode: 0755 + force: false + when: atl_latest_version != "" + + +- name: locate installer + find: paths="{{ atl_crowd_download }}" patterns="*crowd*.tar.gz" + register: find_result + +- debug: msg = " {{find_result }}" + +- name: unarchive + become: true + unarchive: + src: "{{ item.path }}" + dest: "{{atl_product_installation_versioned}}" +# remote_src: yes + with_items: "{{ find_result.files }}" + +#- name: unpack crowd +# shell: tar -xvzf {{atl_crowd_download}}/*crowd*{{atl_product_version}}.tar.gz . + +- name: Symlink the installed version to current + file: + src: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}" + dest: "{{ atl_product_installation_current }}" + state: link + force: true + diff --git a/roles/product_install/tasks/crowd_version_latest.yml b/roles/product_install/tasks/crowd_version_latest.yml new file mode 100644 index 0000000..9c77711 --- /dev/null +++ b/roles/product_install/tasks/crowd_version_latest.yml @@ -0,0 +1,13 @@ +--- + +# This is the process for most products (except ServiceDesk +# basically). Symlink this to _version_latest.yml for each +# product that supports the standard marketplace API. + +- name: Fetch the latest version from URL + set_fact: + atl_product_version_json: "{{ lookup('url', '{{ atl_product_latest_version_url }}') }}" + +- name: Set the local var to retrieved version + set_fact: + atl_latest_version: "{{ atl_product_version_json.version }}" diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 67a5251..bb784eb 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -1,5 +1,3 @@ ---- - - name: Check for existing version cache file stat: path: "{{ atl_product_version_cache }}" @@ -97,11 +95,18 @@ set_fact: atl_product_version: "{{ atl_download_version }}" +#- set_fact: +# atl_product_version: '3.4.4' + ###################################################################### +#- debug: +# msg: "{{ atl_product_edition }}_extra_tasks.yml" - name: Perform any additional per-edition version setup include_tasks: "{{ atl_product_edition }}_extra_tasks.yml" + when: atl_product_edition!= "crowd" + - name: Create installation directories @@ -118,6 +123,8 @@ - "{{ atl_product_version_cache_dir }}" changed_when: false # For Molecule idempotence check +- debug: + msg: "atl_installer_temp - {{atl_installer_temp}} atl_product_home - {{atl_product_home}} atl_product_installation_versioned- {{atl_product_installation_versioned}} atl_product_version_cache_dir- {{atl_product_version_cache_dir}}" # At this point atl_product_version should be set, cache if necessary. - name: Write override cached version when specified @@ -136,12 +143,14 @@ dest: "{{ atl_product_download }}" mode: 0755 force: false + when: atl_product_edition!= "crowd" - name: Create installer varfile template: src: "{{ atl_product_family }}.varfile.j2" dest: "{{ atl_product_varfile }}" mode: 0755 + when: atl_product_edition!= "crowd" # NOTE: We run the installer as the user rather than root to limit its # actions. For example, if root and the 'jira' user exists then it @@ -153,6 +162,11 @@ creates: "{{ atl_product_installation_versioned }}/.install4j/" become: true become_user: "{{ atl_product_user }}" + when: atl_product_edition!= "crowd" + + +- import_tasks: crowd_install.yml + when: atl_product_edition == "crowd" - name: Symlink the installed version to current file: @@ -160,3 +174,4 @@ dest: "{{ atl_product_installation_current }}" state: link force: true + when: atl_product_edition != "crowd" diff --git a/roles/product_install/templates/crowd.varfile.j2 b/roles/product_install/templates/crowd.varfile.j2 new file mode 100644 index 0000000..5fff588 --- /dev/null +++ b/roles/product_install/templates/crowd.varfile.j2 @@ -0,0 +1,13 @@ +launch.application$Boolean=false +rmiPort$Long={{ atl_tomcat_mgmt_port | default('8020') }} +app.jiraHome={{ atl_product_home }} +app.install.service$Boolean=false +app.service.account={{ atl_product_user }} +existingInstallationDir={{ atl_product_installation_versioned }} +sys.confirmedUpdateInstallationString=false +sys.languageId=en +sys.installationDir={{ atl_product_installation_versioned }} +executeLauncherAction$Boolean=true +httpPort$Long={{ atl_tomcat_port | default('8080') }} +portChoice=default +executeLauncherAction$Boolean=false diff --git a/roles/product_startup/defaults/main.yml b/roles/product_startup/defaults/main.yml index dee6aae..48b9dc0 100644 --- a/roles/product_startup/defaults/main.yml +++ b/roles/product_startup/defaults/main.yml @@ -8,7 +8,9 @@ atl_startup_script_map: jira: "start-jira.sh" confluence: "start-confluence.sh" stash: "start-bitbucket.sh" + crowd: "start_crowd.sh" +crowd_startup_exec_path: "{{ atl_product_installation_current }}/{{ atl_startup_script_map[atl_product_family] }}" atl_startup_exec_path: "{{ atl_product_installation_current }}/bin/{{ atl_startup_script_map[atl_product_family] }}" atl_startup_exec_options: ["-fg"] atl_startup_systemd_params: [] diff --git a/roles/product_startup/tasks/main.yml b/roles/product_startup/tasks/main.yml index 4922627..5483922 100644 --- a/roles/product_startup/tasks/main.yml +++ b/roles/product_startup/tasks/main.yml @@ -4,6 +4,16 @@ template: src: "product.service.j2" dest: "/etc/systemd/system/{{ atl_systemd_service_name }}" + when: atl_product_edition != "crowd" + notify: + - Enable Product + - Restart Product + +- name: "Install systemd service file for crowd" + template: + src: "crowd.service.j2" + dest: "/etc/systemd/system/{{ atl_systemd_service_name }}" + when: atl_product_edition == "crowd" notify: - Enable Product - Restart Product diff --git a/roles/product_startup/templates/crowd.service.j2 b/roles/product_startup/templates/crowd.service.j2 new file mode 100644 index 0000000..5c71d27 --- /dev/null +++ b/roles/product_startup/templates/crowd.service.j2 @@ -0,0 +1,19 @@ +[Unit] +Description=Atlassian {{ atl_product_edition }} +After=network-online.target + +[Service] +User={{ atl_product_user }} +Group={{ atl_product_user }} + +{% for p in atl_startup_systemd_params -%} + {{ p }} +{% endfor %} + +ExecStart={{ crowd_startup_exec_path }}{% for c in atl_startup_exec_options %} {{ c }}{% endfor %} + +Restart=on-failure + +[Install] +WantedBy=multi-target.target + From 12c31d5c5924b8522e648ec6aee01d771fee1cc1 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 05:37:23 +0000 Subject: [PATCH 02/26] changes --- roles/aws_common/tasks/main.yml | 2 +- roles/crowd_install/tasks/main.yml | 0 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 roles/crowd_install/tasks/main.yml diff --git a/roles/aws_common/tasks/main.yml b/roles/aws_common/tasks/main.yml index d658d80..087b681 100644 --- a/roles/aws_common/tasks/main.yml +++ b/roles/aws_common/tasks/main.yml @@ -11,4 +11,4 @@ - name: Use EC2 instance ID for cluster node ID set_fact: atl_cluster_node_id: "{{ ansible_ec2_instance_id }}" - atl_local_ipv4: "{{ ansible_ec2_local_ipv4 | default(ansible_default_ipv4) }}" + atl_local_ipv4: "{{ ansible_ec2_local_ipv4 | default(ansible_default_ipv4.address) }}" diff --git a/roles/crowd_install/tasks/main.yml b/roles/crowd_install/tasks/main.yml deleted file mode 100644 index e69de29..0000000 From 8fbf76ab3e201a9780afc8a36b0cf4de9a2f9f8e Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 05:45:24 +0000 Subject: [PATCH 03/26] changes --- roles/crowd_config/templates/dbconfig.xml.j2 | 4 ++-- roles/crowd_config/templates/server.xml.j2 | 2 +- roles/product_install/defaults/main.yml | 2 +- roles/product_install/tasks/main.yml | 11 ++--------- roles/product_install/templates/crowd.varfile.j2 | 2 +- roles/product_startup/tasks/main.yml | 8 ++++---- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/roles/crowd_config/templates/dbconfig.xml.j2 b/roles/crowd_config/templates/dbconfig.xml.j2 index 18c9ed7..1b96cef 100644 --- a/roles/crowd_config/templates/dbconfig.xml.j2 +++ b/roles/crowd_config/templates/dbconfig.xml.j2 @@ -1,6 +1,6 @@ - + defaultDS default postgres72 @@ -25,4 +25,4 @@ {{ atl_db_testwhileidle }} {{ atl_db_testonborrow }} - + diff --git a/roles/crowd_config/templates/server.xml.j2 b/roles/crowd_config/templates/server.xml.j2 index b882ff8..a904c24 100644 --- a/roles/crowd_config/templates/server.xml.j2 +++ b/roles/crowd_config/templates/server.xml.j2 @@ -5,7 +5,7 @@ - + diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index 592635e..feaf5dc 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -10,7 +10,7 @@ atl_product_version_cache: "{{ atl_product_home_shared }}/{{ atl_product_edition atl_release_base_url: "https://product-downloads.atlassian.com/software" atl_product_base_url: "{{ atl_release_base_url }}/{{ atl_product_family }}/downloads" -atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}-x64.bin " +atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}-x64.bin" atl_crowd_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}.tar.gz" atl_crowd_latest_url: "https://www.atlassian.com/software/crowd/downloads/binary/crowd-standalone-distribution-{{atl_latest_version}}.tar.gz" diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index bb784eb..a289367 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -1,3 +1,5 @@ +--- + - name: Check for existing version cache file stat: path: "{{ atl_product_version_cache }}" @@ -95,14 +97,8 @@ set_fact: atl_product_version: "{{ atl_download_version }}" -#- set_fact: -# atl_product_version: '3.4.4' - ###################################################################### -#- debug: -# msg: "{{ atl_product_edition }}_extra_tasks.yml" - - name: Perform any additional per-edition version setup include_tasks: "{{ atl_product_edition }}_extra_tasks.yml" when: atl_product_edition!= "crowd" @@ -123,9 +119,6 @@ - "{{ atl_product_version_cache_dir }}" changed_when: false # For Molecule idempotence check -- debug: - msg: "atl_installer_temp - {{atl_installer_temp}} atl_product_home - {{atl_product_home}} atl_product_installation_versioned- {{atl_product_installation_versioned}} atl_product_version_cache_dir- {{atl_product_version_cache_dir}}" - # At this point atl_product_version should be set, cache if necessary. - name: Write override cached version when specified template: diff --git a/roles/product_install/templates/crowd.varfile.j2 b/roles/product_install/templates/crowd.varfile.j2 index 5fff588..94b0c99 100644 --- a/roles/product_install/templates/crowd.varfile.j2 +++ b/roles/product_install/templates/crowd.varfile.j2 @@ -1,6 +1,6 @@ launch.application$Boolean=false rmiPort$Long={{ atl_tomcat_mgmt_port | default('8020') }} -app.jiraHome={{ atl_product_home }} +app.crowdHome={{ atl_product_home }} app.install.service$Boolean=false app.service.account={{ atl_product_user }} existingInstallationDir={{ atl_product_installation_versioned }} diff --git a/roles/product_startup/tasks/main.yml b/roles/product_startup/tasks/main.yml index 0d8dfe4..b2ef75a 100644 --- a/roles/product_startup/tasks/main.yml +++ b/roles/product_startup/tasks/main.yml @@ -4,7 +4,9 @@ template: src: "product.service.j2" dest: "/etc/systemd/system/{{ atl_systemd_service_name }}" -<<<<<<< HEAD + owner: root + group: root + mode: 0640 when: atl_product_edition != "crowd" notify: - Enable Product @@ -14,12 +16,10 @@ template: src: "crowd.service.j2" dest: "/etc/systemd/system/{{ atl_systemd_service_name }}" - when: atl_product_edition == "crowd" -======= owner: root group: root mode: 0640 ->>>>>>> origin/master + when: atl_product_edition == "crowd" notify: - Enable Product - Restart Product From 89dce3ccfa53e9a7338d1990e642d87da31cf61b Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 06:18:28 +0000 Subject: [PATCH 04/26] Changes after review --- roles/aws_efs_config/tasks/main.yml | 2 -- roles/crowd_config/defaults/main.yml | 2 +- roles/crowd_config/tasks/main.yml | 7 ----- roles/crowd_config/templates/dbconfig.xml.j2 | 28 -------------------- 4 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 roles/crowd_config/templates/dbconfig.xml.j2 diff --git a/roles/aws_efs_config/tasks/main.yml b/roles/aws_efs_config/tasks/main.yml index 33ab2aa..df8ca09 100644 --- a/roles/aws_efs_config/tasks/main.yml +++ b/roles/aws_efs_config/tasks/main.yml @@ -5,7 +5,6 @@ state: directory path: "{{ atl_shared_mountpoint }}" mode: 0755 - when: atl_product_edition!= "crowd" - name: Enable mountpoint in fstab mount: @@ -14,4 +13,3 @@ fstype: efs opts: "defaults,_netdev" state: mounted - when: atl_product_edition!= "crowd" diff --git a/roles/crowd_config/defaults/main.yml b/roles/crowd_config/defaults/main.yml index 641d4d7..3de162a 100644 --- a/roles/crowd_config/defaults/main.yml +++ b/roles/crowd_config/defaults/main.yml @@ -19,7 +19,7 @@ atl_tomcat_minsparethreads: "10" atl_tomcat_port: "8080" atl_tomcat_redirectport: "8443" atl_tomcat_secure: "true" -atl_tomcat_scheme: "https" +atl_tomcat_scheme: "http" atl_proxy_port: "443" atl_tomcat_protocol: "HTTP/1.1" atl_tomcat_contextpath: "" diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index 650e313..37ae45c 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -1,12 +1,5 @@ --- - -- name: Create database config - template: - src: dbconfig.xml.j2 - dest: "{{ atl_product_home }}/dbconfig.xml" - owner: "{{ atl_product_user }}" - - name: Create cluster config template: src: cluster.properties.j2 diff --git a/roles/crowd_config/templates/dbconfig.xml.j2 b/roles/crowd_config/templates/dbconfig.xml.j2 deleted file mode 100644 index 1b96cef..0000000 --- a/roles/crowd_config/templates/dbconfig.xml.j2 +++ /dev/null @@ -1,28 +0,0 @@ - - - - defaultDS - default - postgres72 - public - - {{ atl_jdbc_url }} - {{ atl_jdbc_user }} - {{ atl_jdbc_password }} - {{ atl_db_driver }} - - {{ atl_db_poolminsize }} - {{ atl_db_poolmaxsize }} - {{ atl_db_minidle }} - {{ atl_db_maxidle }} - - {{ atl_db_maxwaitmillis }} - select 1 - {{ atl_db_timebetweenevictionrunsmillis }} - {{ atl_db_minevictableidletimemillis }} - {{ atl_db_removeabandoned }} - {{ atl_db_removeabandonedtimeout }} - {{ atl_db_testwhileidle }} - {{ atl_db_testonborrow }} - - From 626d41d76db11744f2093097811ce8088cbe2603 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 06:36:08 +0000 Subject: [PATCH 05/26] Removing 'crowd' hard coding --- roles/product_install/tasks/crowd_install.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/roles/product_install/tasks/crowd_install.yml b/roles/product_install/tasks/crowd_install.yml index 492ed54..a11658c 100644 --- a/roles/product_install/tasks/crowd_install.yml +++ b/roles/product_install/tasks/crowd_install.yml @@ -19,7 +19,7 @@ - name: locate installer - find: paths="{{ atl_crowd_download }}" patterns="*crowd*.tar.gz" + find: paths="{{ atl_crowd_download }}" patterns="*{{atl_product_edition}}*.tar.gz" register: find_result - debug: msg = " {{find_result }}" @@ -29,11 +29,8 @@ unarchive: src: "{{ item.path }}" dest: "{{atl_product_installation_versioned}}" -# remote_src: yes with_items: "{{ find_result.files }}" -#- name: unpack crowd -# shell: tar -xvzf {{atl_crowd_download}}/*crowd*{{atl_product_version}}.tar.gz . - name: Symlink the installed version to current file: From 3cfc6ad1a1f9d0e93fbd92a775fd968eba8d2792 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 06:37:43 +0000 Subject: [PATCH 06/26] update heap --- roles/crowd_config/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/crowd_config/defaults/main.yml b/roles/crowd_config/defaults/main.yml index 3de162a..79c3143 100644 --- a/roles/crowd_config/defaults/main.yml +++ b/roles/crowd_config/defaults/main.yml @@ -1,6 +1,6 @@ --- -atl_jvm_heap: "2048m" +atl_jvm_heap: "512m" atl_catalina_opts: "" atl_catalina_opts_extra: >- From 6de244cb71d0d48c22ecc2db551b9e41ff7b46e0 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 06:48:44 +0000 Subject: [PATCH 07/26] Ordered alphabetically --- roles/crowd_config/defaults/main.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/roles/crowd_config/defaults/main.yml b/roles/crowd_config/defaults/main.yml index 79c3143..37af9a6 100644 --- a/roles/crowd_config/defaults/main.yml +++ b/roles/crowd_config/defaults/main.yml @@ -10,29 +10,30 @@ atl_catalina_opts_extra: >- -XX:+PrintTenuringDistribution -Dfile.encoding=UTF-8 -atl_tomcat_mgmt_port: "8020" atl_tomcat_acceptcount: "10" atl_tomcat_connectiontimeout: "20000" +atl_tomcat_contextpath: "" atl_tomcat_enablelookups: "false" +atl_tomcat_port: "8080" atl_tomcat_maxthreads: "200" atl_tomcat_minsparethreads: "10" -atl_tomcat_port: "8080" -atl_tomcat_redirectport: "8443" -atl_tomcat_secure: "true" -atl_tomcat_scheme: "http" -atl_proxy_port: "443" +atl_tomcat_mgmt_port: "8020" atl_tomcat_protocol: "HTTP/1.1" -atl_tomcat_contextpath: "" +atl_tomcat_redirectport: "8443" +atl_tomcat_scheme: "http" +atl_tomcat_secure: "true" + +atl_proxy_port: "443" -atl_db_poolminsize: '20' -atl_db_poolmaxsize: '100' atl_db_minidle: '10' atl_db_maxidle: '20' +atl_db_poolminsize: '20' +atl_db_poolmaxsize: '100' atl_db_maxwaitmillis: '30000' -atl_db_timebetweenevictionrunsmillis: '30000' atl_db_minevictableidletimemillis: '5000' atl_db_removeabandoned: 'true' atl_db_removeabandonedtimeout: '300' atl_db_testwhileidle: 'true' atl_db_testonborrow: 'false' +atl_db_timebetweenevictionrunsmillis: '30000' From fe97b9aa3b85772e00e13f8eebe9329cdae99511 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 06:56:55 +0000 Subject: [PATCH 08/26] remove extra var atl_crowd_download --- roles/product_install/defaults/main.yml | 1 - roles/product_install/tasks/crowd_install.yml | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index feaf5dc..b81fd0c 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -16,7 +16,6 @@ atl_crowd_latest_url: "https://www.atlassian.com/software/crowd/downloads/binary atl_product_download_filename: "{{ atl_download_edition | default(atl_product_edition) }}.{{ atl_product_version }}.bin" atl_product_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}" -atl_crowd_download: "{{ atl_installer_temp }}" atl_product_varfile: "{{ atl_installer_temp }}/{{ atl_product_family }}.varfile" atl_marketplace_base: "https://marketplace.atlassian.com" diff --git a/roles/product_install/tasks/crowd_install.yml b/roles/product_install/tasks/crowd_install.yml index a11658c..12a51c2 100644 --- a/roles/product_install/tasks/crowd_install.yml +++ b/roles/product_install/tasks/crowd_install.yml @@ -4,7 +4,7 @@ - name: Fetch crowd installer get_url: url: "{{atl_crowd_download_url}}" - dest: "{{atl_crowd_download}}" + dest: "{{atl_installer_temp}}" mode: 0755 force: false when: not atl_latest_version @@ -12,14 +12,14 @@ - name: Fetch latest crowd installer get_url: url: "{{ atl_crowd_latest_url }}" - dest: "{{atl_crowd_download}}" + dest: "{{atl_installer_temp}}" mode: 0755 force: false when: atl_latest_version != "" - name: locate installer - find: paths="{{ atl_crowd_download }}" patterns="*{{atl_product_edition}}*.tar.gz" + find: paths="{{ atl_installer_temp }}" patterns="*{{atl_product_edition}}*.tar.gz" register: find_result - debug: msg = " {{find_result }}" From b6eb4db57308f92509959c4e090b3ff2741b71d3 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 08:28:02 +0000 Subject: [PATCH 09/26] changes after review --- roles/nfs_mount/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/nfs_mount/tasks/main.yml b/roles/nfs_mount/tasks/main.yml index f810659..9e170e4 100644 --- a/roles/nfs_mount/tasks/main.yml +++ b/roles/nfs_mount/tasks/main.yml @@ -7,7 +7,6 @@ mode: 0755 owner: "{{ atl_product_user }}" group: "{{ atl_product_user }}" - when: atl_product_edition!= "crowd" - name: Enable mountpoint in fstab mount: @@ -16,4 +15,3 @@ fstype: nfs opts: "rw,nfsvers=4.1,lookupcache=pos,noatime,intr,rsize=32768,wsize=32768,_netdev" state: mounted - when: atl_product_edition!= "crowd" From 5adc577d3d503138b2e3e19fe06a72596c58b9dd Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 08:31:50 +0000 Subject: [PATCH 10/26] removed crowd.varfile.j2 --- roles/product_install/templates/crowd.varfile.j2 | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 roles/product_install/templates/crowd.varfile.j2 diff --git a/roles/product_install/templates/crowd.varfile.j2 b/roles/product_install/templates/crowd.varfile.j2 deleted file mode 100644 index 94b0c99..0000000 --- a/roles/product_install/templates/crowd.varfile.j2 +++ /dev/null @@ -1,13 +0,0 @@ -launch.application$Boolean=false -rmiPort$Long={{ atl_tomcat_mgmt_port | default('8020') }} -app.crowdHome={{ atl_product_home }} -app.install.service$Boolean=false -app.service.account={{ atl_product_user }} -existingInstallationDir={{ atl_product_installation_versioned }} -sys.confirmedUpdateInstallationString=false -sys.languageId=en -sys.installationDir={{ atl_product_installation_versioned }} -executeLauncherAction$Boolean=true -httpPort$Long={{ atl_tomcat_port | default('8080') }} -portChoice=default -executeLauncherAction$Boolean=false From 4e86e4627dfb13442885dccf2b679eea7491cd43 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 08:37:56 +0000 Subject: [PATCH 11/26] create no_op symlink for crowd --- roles/product_install/tasks/crowd_extra_tasks.yml | 2 +- .../product_install/tasks/crowd_version_latest.yml | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) mode change 100644 => 120000 roles/product_install/tasks/crowd_extra_tasks.yml mode change 100644 => 120000 roles/product_install/tasks/crowd_version_latest.yml diff --git a/roles/product_install/tasks/crowd_extra_tasks.yml b/roles/product_install/tasks/crowd_extra_tasks.yml deleted file mode 100644 index 6b96fe0..0000000 --- a/roles/product_install/tasks/crowd_extra_tasks.yml +++ /dev/null @@ -1 +0,0 @@ -no_op.yml diff --git a/roles/product_install/tasks/crowd_extra_tasks.yml b/roles/product_install/tasks/crowd_extra_tasks.yml new file mode 120000 index 0000000..55832eb --- /dev/null +++ b/roles/product_install/tasks/crowd_extra_tasks.yml @@ -0,0 +1 @@ +no_op.yml \ No newline at end of file diff --git a/roles/product_install/tasks/crowd_version_latest.yml b/roles/product_install/tasks/crowd_version_latest.yml deleted file mode 100644 index 9c77711..0000000 --- a/roles/product_install/tasks/crowd_version_latest.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -# This is the process for most products (except ServiceDesk -# basically). Symlink this to _version_latest.yml for each -# product that supports the standard marketplace API. - -- name: Fetch the latest version from URL - set_fact: - atl_product_version_json: "{{ lookup('url', '{{ atl_product_latest_version_url }}') }}" - -- name: Set the local var to retrieved version - set_fact: - atl_latest_version: "{{ atl_product_version_json.version }}" diff --git a/roles/product_install/tasks/crowd_version_latest.yml b/roles/product_install/tasks/crowd_version_latest.yml new file mode 120000 index 0000000..d80ce2f --- /dev/null +++ b/roles/product_install/tasks/crowd_version_latest.yml @@ -0,0 +1 @@ +product_version_latest.yml \ No newline at end of file From 89c595efdf9d38cb88d51edbb63600e63a91d2f3 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 08:40:10 +0000 Subject: [PATCH 12/26] symlinked to no_op.yml --- roles/product_install/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index a289367..9ae3ce8 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -101,8 +101,6 @@ - name: Perform any additional per-edition version setup include_tasks: "{{ atl_product_edition }}_extra_tasks.yml" - when: atl_product_edition!= "crowd" - - name: Create installation directories From cbe52025f23514966325c383950458b686a3c026 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 08:42:40 +0000 Subject: [PATCH 13/26] linked no_op From 4a57ea57badb3e0f1b217f0ddea50b424012fd3a Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 10:29:44 +0000 Subject: [PATCH 14/26] Removed cluster.properties.j2 --- roles/crowd_config/tasks/main.yml | 6 ------ roles/crowd_config/templates/cluster.properties.j2 | 2 -- 2 files changed, 8 deletions(-) delete mode 100644 roles/crowd_config/templates/cluster.properties.j2 diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index 37ae45c..ffe8d62 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -1,11 +1,5 @@ --- -- name: Create cluster config - template: - src: cluster.properties.j2 - dest: "{{ atl_product_home }}/cluster.properties" - owner: "{{ atl_product_user }}" - - name: Create server config template: src: server.xml.j2 diff --git a/roles/crowd_config/templates/cluster.properties.j2 b/roles/crowd_config/templates/cluster.properties.j2 deleted file mode 100644 index d7774bc..0000000 --- a/roles/crowd_config/templates/cluster.properties.j2 +++ /dev/null @@ -1,2 +0,0 @@ -crowd.node.id = {{ atl_cluster_node_id }} -crowd.shared.home = {{ atl_product_home_shared }} From 65cb5f66f59175437ba5fa8cd5a44303f49d3bf6 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Thu, 11 Jul 2019 14:08:52 +0000 Subject: [PATCH 15/26] setting atl_use_system_jdk to true --- aws_crowd_dc_node.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/aws_crowd_dc_node.yml b/aws_crowd_dc_node.yml index 5dd3260..aadb30c 100644 --- a/aws_crowd_dc_node.yml +++ b/aws_crowd_dc_node.yml @@ -7,6 +7,7 @@ atl_product_family: "crowd" atl_product_user: "crowd" atl_product_edition: "crowd" + atl_use_system_jdk: true roles: - role: linux_common From 1c46b3cca4a5c1fcc8c59b00f476cf3b77b7d2fa Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Fri, 12 Jul 2019 04:29:47 +0000 Subject: [PATCH 16/26] Removed crowd_startup_exec_path --- roles/product_startup/defaults/main.yml | 3 +-- roles/product_startup/tasks/main.yml | 13 ------------- .../templates/crowd.service.j2 | 19 ------------------- 3 files changed, 1 insertion(+), 34 deletions(-) delete mode 100644 roles/product_startup/templates/crowd.service.j2 diff --git a/roles/product_startup/defaults/main.yml b/roles/product_startup/defaults/main.yml index 48b9dc0..391d11c 100644 --- a/roles/product_startup/defaults/main.yml +++ b/roles/product_startup/defaults/main.yml @@ -8,9 +8,8 @@ atl_startup_script_map: jira: "start-jira.sh" confluence: "start-confluence.sh" stash: "start-bitbucket.sh" - crowd: "start_crowd.sh" + crowd: "../start_crowd.sh" -crowd_startup_exec_path: "{{ atl_product_installation_current }}/{{ atl_startup_script_map[atl_product_family] }}" atl_startup_exec_path: "{{ atl_product_installation_current }}/bin/{{ atl_startup_script_map[atl_product_family] }}" atl_startup_exec_options: ["-fg"] atl_startup_systemd_params: [] diff --git a/roles/product_startup/tasks/main.yml b/roles/product_startup/tasks/main.yml index b2ef75a..706bee3 100644 --- a/roles/product_startup/tasks/main.yml +++ b/roles/product_startup/tasks/main.yml @@ -7,19 +7,6 @@ owner: root group: root mode: 0640 - when: atl_product_edition != "crowd" - notify: - - Enable Product - - Restart Product - -- name: "Install systemd service file for crowd" - template: - src: "crowd.service.j2" - dest: "/etc/systemd/system/{{ atl_systemd_service_name }}" - owner: root - group: root - mode: 0640 - when: atl_product_edition == "crowd" notify: - Enable Product - Restart Product diff --git a/roles/product_startup/templates/crowd.service.j2 b/roles/product_startup/templates/crowd.service.j2 deleted file mode 100644 index 5c71d27..0000000 --- a/roles/product_startup/templates/crowd.service.j2 +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=Atlassian {{ atl_product_edition }} -After=network-online.target - -[Service] -User={{ atl_product_user }} -Group={{ atl_product_user }} - -{% for p in atl_startup_systemd_params -%} - {{ p }} -{% endfor %} - -ExecStart={{ crowd_startup_exec_path }}{% for c in atl_startup_exec_options %} {{ c }}{% endfor %} - -Restart=on-failure - -[Install] -WantedBy=multi-target.target - From 8f506a16cc792941ee24800e835c1f18b7efe25e Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Mon, 15 Jul 2019 06:24:23 +0000 Subject: [PATCH 17/26] Changes after tarball PR was merged --- roles/crowd_config/tasks/main.yml | 24 +++++++++++++++---- roles/crowd_config/templates/crowd.cfg.xml.j2 | 21 ++++++++++++++++ roles/product_install/defaults/main.yml | 7 +++--- roles/product_install/tasks/main.yml | 9 ++----- roles/product_startup/defaults/main.yml | 10 ++++---- 5 files changed, 51 insertions(+), 20 deletions(-) create mode 100644 roles/crowd_config/templates/crowd.cfg.xml.j2 diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index ffe8d62..c9ae989 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -1,14 +1,19 @@ --- +- name: Create crowd.cfg.xml + template: + src: crowd.cfg.xml.j2 + dest: "{{ atl_product_home_shared }}/crowd.cfg.xml" + - name: Create server config template: src: server.xml.j2 - dest: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}/apache-tomcat/conf/server.xml" + dest: "{{ atl_product_installation_versioned }}/apache-tomcat/conf/server.xml" - name: Override JVM memory settings. # Ugly but necessary as the product installs this file so we need to make the change here. lineinfile: - path: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}/apache-tomcat/bin/setenv.sh" + path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" backrefs: true regexp: "^{{ item }}=" line: "{{ item }}=\"{{ atl_jvm_heap }}\"" @@ -18,16 +23,27 @@ - name: Set Crowd home directory lineinfile: - path: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}/apache-tomcat/bin/setenv.sh" + path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" regexp: "CROWD_HOME=" line: 'CROWD_HOME="{{ atl_product_home }}"' +- name: Set Crowd home directory in crowd-init.properties file + lineinfile: + path: "{{ atl_product_installation_versioned }}/crowd-webapp/WEB-INF/classes/crowd-init.properties" + line: 'crowd.home="{{ atl_product_home }}"' + - name: Set the Tomcat environment lineinfile: - path: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}/apache-tomcat/bin/setenv.sh" + path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" insertafter: "EOF" line: 'export CATALINA_OPTS="${CATALINA_OPTS} {{ atl_catalina_opts }} {{ atl_catalina_opts_extra }}"' +- name: Set JAVA_HOME + lineinfile: + path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" + insertafter: "EOF" + line: 'export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk-1.8.0.201.b09-0.amzn2.x86_64' + - name: Create application directories file: path: "{{ item }}" diff --git a/roles/crowd_config/templates/crowd.cfg.xml.j2 b/roles/crowd_config/templates/crowd.cfg.xml.j2 new file mode 100644 index 0000000..70c0e4f --- /dev/null +++ b/roles/crowd_config/templates/crowd.cfg.xml.j2 @@ -0,0 +1,21 @@ + + + + complete + install.xml + + true + 1 + 100 + 30 + 0 + 0 + 30 + org.postgresql.Driver + {{ atl_jdbc_password }} + {{ atl_jdbc_url }} + {{ atl_jdbc_password }} + org.hibernate.dialect.PostgreSQLDialect + true + + diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index b3c5cec..2a04023 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -8,17 +8,16 @@ atl_product_latest_version_url: "https://marketplace.atlassian.com/rest/2/applic atl_product_version_cache_dir: "{{ atl_product_home_shared }}" atl_product_version_cache: "{{ atl_product_home_shared }}/{{ atl_product_edition }}.version" -atl_download_format: 'installer' +atl_download_format: 'tarball' atl_download_format_suffix_map: installer: '-x64.bin' tarball: '.tar.gz' atl_download_suffix: "{{ atl_download_format_suffix_map[atl_download_format] }}" +atl_crowd_suffix: "{{ atl_download_format_suffix_map[atl_download_format] }}" atl_release_base_url: "https://product-downloads.atlassian.com/software" atl_product_base_url: "{{ atl_release_base_url }}/{{ atl_product_family }}/downloads" -#atl_crowd_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}.tar.gz" -#atl_crowd_latest_url: "https://www.atlassian.com/software/crowd/downloads/binary/crowd-standalone-distribution-{{atl_latest_version}}.tar.gz" -atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}{{ atl_download_suffix }}" +atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}{{ atl_crowd_suffix }}" atl_product_download_filename: "{{ atl_download_edition | default(atl_product_edition) }}.{{ atl_product_version }}{{ atl_download_suffix }}" atl_product_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}" diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 6be897f..e0bf7e7 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -1,5 +1,6 @@ --- + - name: Check for existing version cache file stat: path: "{{ atl_product_version_cache }}" @@ -124,6 +125,7 @@ dest: "{{ atl_product_version_cache }}" force: true + # Note: We don't the cache binary in the shared drive to the complexity # around download race-conditions if multiple nodes are starting at # the same time. When downloading from product-downloads.atlassian.com @@ -134,14 +136,12 @@ dest: "{{ atl_product_download }}" mode: 0755 force: false - when: atl_product_edition!= "crowd" - name: Create installer varfile template: src: "{{ atl_product_family }}.varfile.j2" dest: "{{ atl_product_varfile }}" mode: 0755 - when: atl_product_edition!= "crowd" # NOTE: We run the installer as the user rather than root to limit its # actions. For example, if root and the 'jira' user exists then it @@ -155,10 +155,6 @@ become_user: "{{ atl_product_user }}" when: atl_product_edition!= "crowd" - -- import_tasks: crowd_install.yml - when: atl_product_edition == "crowd" - - name: Unpack the downloaded application depending on format include_tasks: "unpack_{{ atl_download_format }}.yml" @@ -168,4 +164,3 @@ dest: "{{ atl_product_installation_current }}" state: link force: true - when: atl_product_edition != "crowd" diff --git a/roles/product_startup/defaults/main.yml b/roles/product_startup/defaults/main.yml index 391d11c..1261a60 100644 --- a/roles/product_startup/defaults/main.yml +++ b/roles/product_startup/defaults/main.yml @@ -5,12 +5,12 @@ atl_startup_enable: true atl_startup_restart: true atl_startup_script_map: - jira: "start-jira.sh" - confluence: "start-confluence.sh" - stash: "start-bitbucket.sh" - crowd: "../start_crowd.sh" + jira: "/bin/start-jira.sh" + confluence: "bin/start-confluence.sh" + stash: "bin/start-bitbucket.sh" + crowd: "start_crowd.sh" -atl_startup_exec_path: "{{ atl_product_installation_current }}/bin/{{ atl_startup_script_map[atl_product_family] }}" +atl_startup_exec_path: "{{ atl_product_installation_current }}/{{ atl_startup_script_map[atl_product_family] }}" atl_startup_exec_options: ["-fg"] atl_startup_systemd_params: [] From 6224ecfbad92d50da349d8c0bea5d0f8c2501a43 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Mon, 15 Jul 2019 06:28:17 +0000 Subject: [PATCH 18/26] removed crowd_install.yml --- roles/product_install/tasks/crowd_install.yml | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 roles/product_install/tasks/crowd_install.yml diff --git a/roles/product_install/tasks/crowd_install.yml b/roles/product_install/tasks/crowd_install.yml deleted file mode 100644 index 12a51c2..0000000 --- a/roles/product_install/tasks/crowd_install.yml +++ /dev/null @@ -1,41 +0,0 @@ -- debug: - msg: "atl_latest_version - {{atl_latest_version}}" - -- name: Fetch crowd installer - get_url: - url: "{{atl_crowd_download_url}}" - dest: "{{atl_installer_temp}}" - mode: 0755 - force: false - when: not atl_latest_version - -- name: Fetch latest crowd installer - get_url: - url: "{{ atl_crowd_latest_url }}" - dest: "{{atl_installer_temp}}" - mode: 0755 - force: false - when: atl_latest_version != "" - - -- name: locate installer - find: paths="{{ atl_installer_temp }}" patterns="*{{atl_product_edition}}*.tar.gz" - register: find_result - -- debug: msg = " {{find_result }}" - -- name: unarchive - become: true - unarchive: - src: "{{ item.path }}" - dest: "{{atl_product_installation_versioned}}" - with_items: "{{ find_result.files }}" - - -- name: Symlink the installed version to current - file: - src: "{{ atl_product_installation_versioned }}/atlassian-crowd-{{atl_product_version}}" - dest: "{{ atl_product_installation_current }}" - state: link - force: true - From 20b0b3db89bb7e9344ea10cba74924b97a21d35d Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Mon, 15 Jul 2019 06:54:58 +0000 Subject: [PATCH 19/26] Overwrite atl_download_format for crowd --- aws_crowd_dc_node.yml | 1 + roles/product_install/defaults/main.yml | 5 ++--- roles/product_install/tasks/main.yml | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/aws_crowd_dc_node.yml b/aws_crowd_dc_node.yml index aadb30c..f2755e0 100644 --- a/aws_crowd_dc_node.yml +++ b/aws_crowd_dc_node.yml @@ -8,6 +8,7 @@ atl_product_user: "crowd" atl_product_edition: "crowd" atl_use_system_jdk: true + atl_download_format: "tarball" roles: - role: linux_common diff --git a/roles/product_install/defaults/main.yml b/roles/product_install/defaults/main.yml index 2a04023..211e76e 100644 --- a/roles/product_install/defaults/main.yml +++ b/roles/product_install/defaults/main.yml @@ -8,16 +8,15 @@ atl_product_latest_version_url: "https://marketplace.atlassian.com/rest/2/applic atl_product_version_cache_dir: "{{ atl_product_home_shared }}" atl_product_version_cache: "{{ atl_product_home_shared }}/{{ atl_product_edition }}.version" -atl_download_format: 'tarball' +atl_download_format: 'installer' atl_download_format_suffix_map: installer: '-x64.bin' tarball: '.tar.gz' atl_download_suffix: "{{ atl_download_format_suffix_map[atl_download_format] }}" -atl_crowd_suffix: "{{ atl_download_format_suffix_map[atl_download_format] }}" atl_release_base_url: "https://product-downloads.atlassian.com/software" atl_product_base_url: "{{ atl_release_base_url }}/{{ atl_product_family }}/downloads" -atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}{{ atl_crowd_suffix }}" +atl_product_download_url: "{{ atl_product_base_url }}/atlassian-{{ atl_download_edition | default(atl_product_edition) }}-{{ atl_product_version }}{{ atl_download_suffix }}" atl_product_download_filename: "{{ atl_download_edition | default(atl_product_edition) }}.{{ atl_product_version }}{{ atl_download_suffix }}" atl_product_download: "{{ atl_installer_temp }}/{{ atl_product_download_filename }}" diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index e0bf7e7..5278658 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -142,6 +142,7 @@ src: "{{ atl_product_family }}.varfile.j2" dest: "{{ atl_product_varfile }}" mode: 0755 + when: atl_product_edition!= "crowd" # NOTE: We run the installer as the user rather than root to limit its # actions. For example, if root and the 'jira' user exists then it @@ -155,6 +156,10 @@ become_user: "{{ atl_product_user }}" when: atl_product_edition!= "crowd" + +- debug: + msg: "FORMAT - {{ atl_download_format }}" + - name: Unpack the downloaded application depending on format include_tasks: "unpack_{{ atl_download_format }}.yml" From 25addf355dc2a5e5a5fcf98b190111b6b478be9d Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Mon, 15 Jul 2019 09:37:23 +0000 Subject: [PATCH 20/26] Enable GC logging --- roles/crowd_config/defaults/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/crowd_config/defaults/main.yml b/roles/crowd_config/defaults/main.yml index 37af9a6..fefbb04 100644 --- a/roles/crowd_config/defaults/main.yml +++ b/roles/crowd_config/defaults/main.yml @@ -6,7 +6,13 @@ atl_catalina_opts: "" atl_catalina_opts_extra: >- -XX:+UseG1GC -XX:+PrintAdaptiveSizePolicy + -Xloggc:{{ atl_product_installation_versioned }}/apache-tomcat/logs/`date +%F_%H-%M-%S`-gc.log + -XX:+PrintGCDetails + -XX:+PrintGCDateStamps + -XX:+PrintGCCause -XX:+UseGCLogFileRotation + -XX:NumberOfGCLogFiles=10 + -XX:GCLogFileSize=5M -XX:+PrintTenuringDistribution -Dfile.encoding=UTF-8 From f2393e2795f97a62375ccbff11b1204056fb676f Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Mon, 15 Jul 2019 09:51:35 +0000 Subject: [PATCH 21/26] Removed changes after incorporating Steve's changes --- roles/product_install/tasks/main.yml | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/roles/product_install/tasks/main.yml b/roles/product_install/tasks/main.yml index 5278658..77371fa 100644 --- a/roles/product_install/tasks/main.yml +++ b/roles/product_install/tasks/main.yml @@ -137,29 +137,6 @@ mode: 0755 force: false -- name: Create installer varfile - template: - src: "{{ atl_product_family }}.varfile.j2" - dest: "{{ atl_product_varfile }}" - mode: 0755 - when: atl_product_edition!= "crowd" - -# NOTE: We run the installer as the user rather than root to limit its -# actions. For example, if root and the 'jira' user exists then it -# will create 'jira1'; this potentially creates idempotency/upgrade -# issues down the line. -- name: Run the installer - command: /bin/sh "{{ atl_product_download }}" -q -varfile "{{ atl_product_varfile }}" - args: - creates: "{{ atl_product_installation_versioned }}/.install4j/" - become: true - become_user: "{{ atl_product_user }}" - when: atl_product_edition!= "crowd" - - -- debug: - msg: "FORMAT - {{ atl_download_format }}" - - name: Unpack the downloaded application depending on format include_tasks: "unpack_{{ atl_download_format }}.yml" From c0bf45efbc980da3afe1085c31102258654484f1 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Mon, 15 Jul 2019 09:53:05 +0000 Subject: [PATCH 22/26] crowd.cfg.xml gets generated during crowd setup --- roles/crowd_config/templates/crowd.cfg.xml.j2 | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 roles/crowd_config/templates/crowd.cfg.xml.j2 diff --git a/roles/crowd_config/templates/crowd.cfg.xml.j2 b/roles/crowd_config/templates/crowd.cfg.xml.j2 deleted file mode 100644 index 70c0e4f..0000000 --- a/roles/crowd_config/templates/crowd.cfg.xml.j2 +++ /dev/null @@ -1,21 +0,0 @@ - - - - complete - install.xml - - true - 1 - 100 - 30 - 0 - 0 - 30 - org.postgresql.Driver - {{ atl_jdbc_password }} - {{ atl_jdbc_url }} - {{ atl_jdbc_password }} - org.hibernate.dialect.PostgreSQLDialect - true - - From 591dd6d55f9aa6c402e75999f702ab11c8f524e4 Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Tue, 16 Jul 2019 05:15:05 +0000 Subject: [PATCH 23/26] Removed crowd.config.xml --- roles/crowd_config/tasks/main.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index c9ae989..e244a8b 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -1,10 +1,5 @@ --- -- name: Create crowd.cfg.xml - template: - src: crowd.cfg.xml.j2 - dest: "{{ atl_product_home_shared }}/crowd.cfg.xml" - - name: Create server config template: src: server.xml.j2 From f6b0c044519fd2f23788250926a3ec4a343d133b Mon Sep 17 00:00:00 2001 From: Azra Sulthana Date: Wed, 17 Jul 2019 08:44:18 +0530 Subject: [PATCH 24/26] Symlink Crowd shared home directory, updated working directories, unset Crowd home directory from setenv.sh --- roles/crowd_config/tasks/main.yml | 21 ++++---- roles/crowd_config/templates/server.xml.j2 | 59 +++++++++++++++++++--- 2 files changed, 65 insertions(+), 15 deletions(-) diff --git a/roles/crowd_config/tasks/main.yml b/roles/crowd_config/tasks/main.yml index e244a8b..aa41479 100644 --- a/roles/crowd_config/tasks/main.yml +++ b/roles/crowd_config/tasks/main.yml @@ -16,12 +16,6 @@ - 'JVM_MINIMUM_MEMORY' - 'JVM_MAXIMUM_MEMORY' -- name: Set Crowd home directory - lineinfile: - path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" - regexp: "CROWD_HOME=" - line: 'CROWD_HOME="{{ atl_product_home }}"' - - name: Set Crowd home directory in crowd-init.properties file lineinfile: path: "{{ atl_product_installation_versioned }}/crowd-webapp/WEB-INF/classes/crowd-init.properties" @@ -75,7 +69,16 @@ group: "{{ atl_product_user }}" recurse: true with_items: - - "{{ atl_product_installation_versioned }}/logs" - - "{{ atl_product_installation_versioned }}/temp" - - "{{ atl_product_installation_versioned }}/work" + - "{{ atl_product_installation_versioned }}/apache-tomcat/logs" + - "{{ atl_product_installation_versioned }}/apache-tomcat/temp" + - "{{ atl_product_installation_versioned }}/apache-tomcat/work" + changed_when: false # For Molecule idempotence check + +- name: Symlink Crowd shared home directory + file: + src: "{{ atl_product_home_shared }}" + dest: "{{ atl_product_home }}/shared" + state: link + owner: "{{ atl_product_user }}" + group: "{{ atl_product_user }}" changed_when: false # For Molecule idempotence check diff --git a/roles/crowd_config/templates/server.xml.j2 b/roles/crowd_config/templates/server.xml.j2 index a904c24..6f9751b 100644 --- a/roles/crowd_config/templates/server.xml.j2 +++ b/roles/crowd_config/templates/server.xml.j2 @@ -1,19 +1,66 @@ - + + + - + + - - + + + + + + + - + + +