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: []