use collections; use FQCN for all tasks

This commit is contained in:
Lee Goolsbee
2022-09-07 15:59:15 -05:00
parent e1f5521652
commit 694f1c2874
47 changed files with 243 additions and 230 deletions

View File

@@ -1,14 +1,14 @@
--- ---
- name: Enable CloudWatch Agent - name: Enable CloudWatch Agent
systemd: ansible.builtin.systemd:
name: "amazon-cloudwatch-agent.service" name: "amazon-cloudwatch-agent.service"
daemon_reload: true daemon_reload: true
enabled: true enabled: true
when: atl_aws_agent_restart when: atl_aws_agent_restart
- name: Restart CloudWatch Agent - name: Restart CloudWatch Agent
systemd: ansible.builtin.systemd:
name: "amazon-cloudwatch-agent.service" name: "amazon-cloudwatch-agent.service"
enabled: true enabled: true
state: restarted state: restarted

View File

@@ -1,18 +1,22 @@
--- ---
- name: Install AWS support packages - name: Install AWS support packages
yum: ansible.builtin.yum:
name: name:
- amazon-efs-utils - amazon-efs-utils
- amazon-ssm-agent - amazon-ssm-agent
- awscli - awscli
- git - git
- ec2-utils - ec2-utils
vars:
ansible_python_interpreter: /usr/bin/python2
- name: Install CloudWatch Agent - name: Install CloudWatch Agent
yum: ansible.builtin.yum:
name: name:
- "{{ aws_cloudwatch_agent_rpm }}" - "{{ aws_cloudwatch_agent_rpm }}"
when: atl_aws_enable_cloudwatch is defined and atl_aws_enable_cloudwatch when: atl_aws_enable_cloudwatch is defined and atl_aws_enable_cloudwatch
notify: notify:
- Enable CloudWatch Agent - Enable CloudWatch Agent
vars:
ansible_python_interpreter: /usr/bin/python2

View File

@@ -1,20 +1,20 @@
--- ---
- name: Fetch local EC2 metadata - name: Fetch local EC2 metadata
ec2_metadata_facts: amazon.aws.ec2_metadata_facts:
tags: tags:
- notest - notest
- name: Install distro-specific prerequisites - name: Install distro-specific prerequisites
include_tasks: "{{ ansible_distribution|lower }}.yml" ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}.yml"
- name: Use EC2 instance ID for cluster node ID - name: Use EC2 instance ID for cluster node ID
set_fact: ansible.builtin.set_fact:
atl_cluster_node_id: "{{ ansible_ec2_instance_id }}" 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.address) }}"
- name: Generate CloudWatch config - name: Generate CloudWatch config
template: ansible.builtin.template:
src: "amazon-cloudwatch-agent.json.j2" src: "amazon-cloudwatch-agent.json.j2"
dest: "/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json" dest: "/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json"
owner: root owner: root
@@ -25,7 +25,7 @@
- Restart CloudWatch Agent - Restart CloudWatch Agent
- name: Store some metadata about this run - name: Store some metadata about this run
include_tasks: "write-tags.yml" ansible.builtin.include_tasks: "write-tags.yml"
- name: Initiate the startup of any new AWS services now - name: Initiate the startup of any new AWS services now
meta: flush_handlers ansible.builtin.meta: flush_handlers

View File

@@ -1,7 +1,7 @@
--- ---
- name: Retrieve all available EC2 tags - name: Retrieve all available EC2 tags
ec2_tag: amazon.aws.ec2_tag:
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
state: list state: list
@@ -11,18 +11,18 @@
- notest - notest
- name: Retrieve autoscaling group - name: Retrieve autoscaling group
set_fact: ansible.builtin.set_fact:
ec2_autoscaling_group: "{{ ec2_instance_tags.tags['aws:autoscaling:groupName'] | default('') }}" ec2_autoscaling_group: "{{ ec2_instance_tags.tags['aws:autoscaling:groupName'] | default('') }}"
- block: - block:
# No existing timestamp, so this is a first run. Persist some metadata into the ASG. # No existing timestamp, so this is a first run. Persist some metadata into the ASG.
- name: Fetch the git revision for this repo - name: Fetch the git revision for this repo
command: ansible.builtin.command:
cmd: git rev-parse HEAD cmd: git rev-parse HEAD
register: git_out register: git_out
- name: Setup the new ASG tags - name: Setup the new ASG tags
set_fact: ansible.builtin.set_fact:
deployment_firstrun_meta: deployment_firstrun_meta:
- ResourceType: "auto-scaling-group" - ResourceType: "auto-scaling-group"
ResourceId: "{{ ec2_autoscaling_group }}" ResourceId: "{{ ec2_autoscaling_group }}"
@@ -41,14 +41,14 @@
# ignore errors as it's possible we don't have the permissions, # ignore errors as it's possible we don't have the permissions,
# and we can't check up-front. # and we can't check up-front.
- name: Set the first-run tags on the ASG ("FAIL" is not critical) - name: Set the first-run tags on the ASG ("FAIL" is not critical)
command: "aws autoscaling ansible.builtin.command: "aws autoscaling
create-or-update-tags create-or-update-tags
--region {{ ansible_ec2_placement_region }} --region {{ ansible_ec2_placement_region }}
--tags '{{ deployment_firstrun_meta | to_json }}'" --tags '{{ deployment_firstrun_meta | to_json }}'"
ignore_errors: true ignore_errors: true
- name: Set the tags on the local instance ("FAIL" is not critical) - name: Set the tags on the local instance ("FAIL" is not critical)
ec2_tag: amazon.aws.ec2_tag:
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
tags: tags:

View File

@@ -1,13 +1,13 @@
--- ---
- name: Create mountpoint - name: Create mountpoint
file: ansible.builtin.file:
state: directory state: directory
path: "{{ atl_shared_mountpoint }}" path: "{{ atl_shared_mountpoint }}"
mode: 0755 mode: 0755
- name: Enable mountpoint in fstab - name: Enable mountpoint in fstab
mount: ansible.posix.mount:
path: "{{ atl_shared_mountpoint }}" path: "{{ atl_shared_mountpoint }}"
src: "{{ efs_target }}:{{ efs_src_dir }}" src: "{{ efs_target }}:{{ efs_src_dir }}"
fstype: "{{ efs_type }}" fstype: "{{ efs_type }}"

View File

@@ -1,7 +1,7 @@
--- ---
- name: Create Bitbucket shared dir if necessary - name: Create Bitbucket shared dir if necessary
file: ansible.builtin.file:
path: "{{ atl_product_home_shared }}" path: "{{ atl_product_home_shared }}"
owner: "{{ atl_product_user }}" owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}" group: "{{ atl_product_user }}"
@@ -9,14 +9,14 @@
state: directory state: directory
- name: Create Bitbucket config file - name: Create Bitbucket config file
template: ansible.builtin.template:
src: bitbucket.properties.j2 src: bitbucket.properties.j2
dest: "{{ atl_product_home_shared }}/bitbucket.properties" dest: "{{ atl_product_home_shared }}/bitbucket.properties"
owner: "{{ atl_product_user }}" owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}" group: "{{ atl_product_user }}"
- name: Remove write permissions from installation directory - name: Remove write permissions from installation directory
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}" path: "{{ atl_product_installation_versioned }}"
owner: "root" owner: "root"
group: "root" group: "root"
@@ -25,7 +25,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Create conf/Catalina directory so catalina.out logging works - name: Create conf/Catalina directory so catalina.out logging works
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}/conf/Catalina" path: "{{ atl_product_installation_versioned }}/conf/Catalina"
state: directory state: directory
mode: "u=rwX,g=rX,o-rwx" mode: "u=rwX,g=rX,o-rwx"

View File

@@ -1,24 +1,24 @@
--- ---
- name: Force all notified handlers to run at this point, not waiting for normal sync points - name: Force all notified handlers to run at this point, not waiting for normal sync points
meta: flush_handlers ansible.builtin.meta: flush_handlers
- name: wait for port 7990 to be up - name: wait for port 7990 to be up
wait_for: ansible.builtin.wait_for:
port: 7990 port: 7990
delay: 60 delay: 60
- name: wait for path to become available - name: wait for path to become available
wait_for: ansible.builtin.wait_for:
path: "{{ atl_product_home_shared }}/data/migration/import" path: "{{ atl_product_home_shared }}/data/migration/import"
delay: 60 delay: 60
- name: Copy Bitbucket dataset from s3 - name: Copy Bitbucket dataset from s3
get_url: ansible.builtin.get_url:
url: "{{ atl_bitbucket_dataset_url }}" url: "{{ atl_bitbucket_dataset_url }}"
dest: "{{ atl_product_home_shared }}/data/migration/import" dest: "{{ atl_product_home_shared }}/data/migration/import"
- name: Invoke Import API - name: Invoke Import API
uri: ansible.builtin.uri:
url: "{{ atl_bitbucket_baseurl }}/rest/api/1.0/migration/imports" url: "{{ atl_bitbucket_baseurl }}/rest/api/1.0/migration/imports"
user: admin user: admin
password: "{{ atl_bitbucket_admin_password }}" password: "{{ atl_bitbucket_admin_password }}"
@@ -36,7 +36,7 @@
failed_when: output is defined and output.json is defined and output.json.state != 'INITIALISING' failed_when: output is defined and output.json is defined and output.json.state != 'INITIALISING'
- name: get import status - name: get import status
uri: ansible.builtin.uri:
url: "{{ atl_bitbucket_baseurl }}/rest/api/1.0/migration/imports/{{ output.json.id }}" url: "{{ atl_bitbucket_baseurl }}/rest/api/1.0/migration/imports/{{ output.json.id }}"
user: admin user: admin
password: "{{ atl_bitbucket_admin_password }}" password: "{{ atl_bitbucket_admin_password }}"
@@ -50,7 +50,7 @@
delay: 10 delay: 10
- name: create lock file - name: create lock file
file: ansible.builtin.file:
path: "{{ atl_product_home_shared }}/data/migration/import/lock.file" path: "{{ atl_product_home_shared }}/data/migration/import/lock.file"
state: touch state: touch
when: import_status.json.state == 'COMPLETED' when: import_status.json.state == 'COMPLETED'

View File

@@ -1,13 +1,15 @@
--- ---
- name: Install Google Noto fonts for language coverage - name: Install Google Noto fonts for language coverage
yum: ansible.builtin.yum:
name: name:
- "google-noto-*" - "google-noto-*"
vars:
ansible_python_interpreter: /usr/bin/python2
- name: Link the language fonts into the JDK - name: Link the language fonts into the JDK
# Not idiomatic, but cleaner than messing with nested lookups... # Not idiomatic, but cleaner than messing with nested lookups...
shell: ansible.builtin.shell:
cmd: "ln -sf /usr/share/fonts/google-noto*/* {{ item }}/" cmd: "ln -sf /usr/share/fonts/google-noto*/* {{ item }}/"
creates: "{{ item }}/NotoSansJavanese-Regular.ttf" creates: "{{ item }}/NotoSansJavanese-Regular.ttf"
warn: false warn: false

View File

@@ -1,7 +1,7 @@
--- ---
- name: Create application directories - name: Create application directories
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
mode: 0750 mode: 0750
@@ -17,7 +17,7 @@
# Create symlink to force single (unclustered) Confluence to store # Create symlink to force single (unclustered) Confluence to store
# shared-data and attachments in the shared drive. # shared-data and attachments in the shared drive.
- name: Symlink local attachments to shared storage - name: Symlink local attachments to shared storage
file: ansible.builtin.file:
src: "{{ item.0 }}" src: "{{ item.0 }}"
dest: "{{ item.1 }}" dest: "{{ item.1 }}"
force: false force: false
@@ -33,12 +33,12 @@
- "{{ links }}" - "{{ links }}"
- name: Create Tomcat server config - name: Create Tomcat server config
template: ansible.builtin.template:
src: server.xml.j2 src: server.xml.j2
dest: "{{ atl_product_installation_versioned }}/conf/server.xml" dest: "{{ atl_product_installation_versioned }}/conf/server.xml"
- name: Override JVM memory settings. - name: Override JVM memory settings.
replace: ansible.builtin.replace:
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
regexp: "-{{ item }}\\d+m " regexp: "-{{ item }}\\d+m "
replace: "-{{ item }}{{ atl_jvm_heap }} " replace: "-{{ item }}{{ atl_jvm_heap }} "
@@ -47,30 +47,30 @@
- 'Xms' - 'Xms'
- name: Set the Tomcat environment - name: Set the Tomcat environment
lineinfile: ansible.builtin.lineinfile:
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
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: Configure login properties - name: Configure login properties
template: ansible.builtin.template:
src: seraph-config.xml.j2 src: seraph-config.xml.j2
dest: "{{ atl_product_installation_versioned }}/confluence/WEB-INF/classes/seraph-config.xml" dest: "{{ atl_product_installation_versioned }}/confluence/WEB-INF/classes/seraph-config.xml"
- name: Configure Confluence home directory - name: Configure Confluence home directory
template: ansible.builtin.template:
src: confluence-init.properties.j2 src: confluence-init.properties.j2
dest: "{{ atl_product_installation_versioned }}/confluence/WEB-INF/classes/confluence-init.properties" dest: "{{ atl_product_installation_versioned }}/confluence/WEB-INF/classes/confluence-init.properties"
- name: Create Confluence configuration - name: Create Confluence configuration
template: ansible.builtin.template:
src: confluence.cfg.xml.j2 src: confluence.cfg.xml.j2
dest: "{{ atl_product_home }}/confluence.cfg.xml" dest: "{{ atl_product_home }}/confluence.cfg.xml"
owner: "{{ atl_product_user }}" owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}" group: "{{ atl_product_user }}"
- name: Limit permissions on the installation directory - name: Limit permissions on the installation directory
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}" path: "{{ atl_product_installation_versioned }}"
owner: "root" owner: "root"
group: "root" group: "root"
@@ -83,7 +83,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Grant access to the product working directories - name: Grant access to the product working directories
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
mode: "u=rwX,g=rX,o-rwx" mode: "u=rwX,g=rX,o-rwx"
@@ -97,7 +97,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Create conf/Catalina directory owned by product so catalina.out logging works - name: Create conf/Catalina directory owned by product so catalina.out logging works
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}/conf/Catalina" path: "{{ atl_product_installation_versioned }}/conf/Catalina"
state: directory state: directory
mode: "u=rwX,g=rX,o-rwx" mode: "u=rwX,g=rX,o-rwx"
@@ -106,7 +106,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Assert baseurl to same as atl_proxy_name - name: Assert baseurl to same as atl_proxy_name
postgresql_query: community.postgresql.postgresql_query:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_jdbc_user }}" login_user: "{{ atl_jdbc_user }}"
login_password: "{{ atl_jdbc_password }}" login_password: "{{ atl_jdbc_password }}"
@@ -126,11 +126,11 @@
ignore_errors: yes # For Molecule as it has no db test framework included ignore_errors: yes # For Molecule as it has no db test framework included
- name: Create JVM font fallback directories - name: Create JVM font fallback directories
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
mode: 0755 mode: 0755
with_items: "{{ atl_fonts_fallback_dirs }}" with_items: "{{ atl_fonts_fallback_dirs }}"
- name: Install & configure distro language fonts - name: Install & configure distro language fonts
include_tasks: "{{ ansible_distribution|lower }}_fonts.yml" ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}_fonts.yml"

View File

@@ -1,13 +1,13 @@
--- ---
- name: Install Google Noto fonts for language coverage - name: Install Google Noto fonts for language coverage
package: ansible.builtin.package:
name: name:
- "fonts-noto" - "fonts-noto"
- name: Link the language fonts into the JDK - name: Link the language fonts into the JDK
# Not idiomatic, but cleaner than messing with nested lookups... # Not idiomatic, but cleaner than messing with nested lookups...
shell: ansible.builtin.shell:
cmd: "ln -sf /usr/share/fonts/truetype/noto/* {{ item }}/" cmd: "ln -sf /usr/share/fonts/truetype/noto/* {{ item }}/"
creates: "{{ item }}/NotoSansJavanese-Regular.ttf" creates: "{{ item }}/NotoSansJavanese-Regular.ttf"
warn: false warn: false

View File

@@ -1,60 +1,60 @@
--- ---
- name: Create server config - name: Create server config
template: ansible.builtin.template:
src: server.xml.j2 src: server.xml.j2
dest: "{{ atl_product_installation_versioned }}/apache-tomcat/conf/server.xml" dest: "{{ atl_product_installation_versioned }}/apache-tomcat/conf/server.xml"
- name: Set the minimum heap size (Xms) - name: Set the minimum heap size (Xms)
lineinfile: ansible.builtin.lineinfile:
path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh"
regexp: '^(.*)Xms(\d+\w)(\s.*)$' regexp: '^(.*)Xms(\d+\w)(\s.*)$'
line: '\1Xms{{ atl_jvm_heap }}\3' line: '\1Xms{{ atl_jvm_heap }}\3'
backrefs: yes backrefs: yes
- name: Set the maxmimum heap size (Xmx) - name: Set the maxmimum heap size (Xmx)
lineinfile: ansible.builtin.lineinfile:
path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh"
regexp: '^(.*)Xmx(\d+\w)(\s.*)$' regexp: '^(.*)Xmx(\d+\w)(\s.*)$'
line: '\1Xmx{{ atl_jvm_heap }}\3' line: '\1Xmx{{ atl_jvm_heap }}\3'
backrefs: yes backrefs: yes
- name: Set Crowd home directory in crowd-init.properties file - name: Set Crowd home directory in crowd-init.properties file
lineinfile: ansible.builtin.lineinfile:
path: "{{ atl_product_installation_versioned }}/crowd-webapp/WEB-INF/classes/crowd-init.properties" path: "{{ atl_product_installation_versioned }}/crowd-webapp/WEB-INF/classes/crowd-init.properties"
line: 'crowd.home={{ atl_product_home }}' line: 'crowd.home={{ atl_product_home }}'
- name: Export CATALINA_OPTS in setenv.sh - name: Export CATALINA_OPTS in setenv.sh
lineinfile: ansible.builtin.lineinfile:
path: '{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh' path: '{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh'
line: 'export CATALINA_OPTS' line: 'export CATALINA_OPTS'
- name: CATALINA_OPTS to list - name: CATALINA_OPTS to list
set_fact: ansible.builtin.set_fact:
catalina_ops_list: "{{ catalina_ops_list|default([]) }} + {{ (item | trim | regex_replace('^-')).split(' -') }}" catalina_ops_list: "{{ catalina_ops_list|default([]) }} + {{ (item | trim | regex_replace('^-')).split(' -') }}"
loop: loop:
- '{{ atl_catalina_opts }}' - '{{ atl_catalina_opts }}'
- '{{ atl_catalina_opts_extra }}' - '{{ atl_catalina_opts_extra }}'
- name: CATALINA_OPTS unique and sorted - name: CATALINA_OPTS unique and sorted
set_fact: ansible.builtin.set_fact:
catalina_opts: "{{ query('flattened', catalina_ops_list) | reject('equalto', '') | unique | sort }}" catalina_opts: "{{ query('flattened', catalina_ops_list) | reject('equalto', '') | unique | sort }}"
- name: Set CATALINA_OPTS in setenv.sh - name: Set CATALINA_OPTS in setenv.sh
blockinfile: ansible.builtin.blockinfile:
block: "{{ lookup('template', 'templates/catalina_opts.j2') }}" block: "{{ lookup('template', 'templates/catalina_opts.j2') }}"
path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/apache-tomcat/bin/setenv.sh"
insertbefore: "^export CATALINA_OPTS$" insertbefore: "^export CATALINA_OPTS$"
marker: "# {mark} ANSIBLE MANAGED CATALINA_OPTS" marker: "# {mark} ANSIBLE MANAGED CATALINA_OPTS"
- name: Set JAVA_HOME - name: Set JAVA_HOME
lineinfile: ansible.builtin.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"
line: "export JAVA_HOME={{ atl_java_home }}" line: "export JAVA_HOME={{ atl_java_home }}"
- name: Create application directories - name: Create application directories
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
mode: 0750 mode: 0750
@@ -67,7 +67,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Limit permissions on the installation directory - name: Limit permissions on the installation directory
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}" path: "{{ atl_product_installation_versioned }}"
owner: "{{ atl_product_user }}" owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}" group: "{{ atl_product_user }}"
@@ -80,7 +80,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Grant access to the product working directories - name: Grant access to the product working directories
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
mode: "u=rwX,g=rX,o-rwx" mode: "u=rwX,g=rX,o-rwx"
@@ -94,7 +94,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Create conf/Catalina directory owned by product so catalina.out logging works - name: Create conf/Catalina directory owned by product so catalina.out logging works
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}/conf/Catalina" path: "{{ atl_product_installation_versioned }}/conf/Catalina"
state: directory state: directory
mode: "u=rwX,g=rX,o-rwx" mode: "u=rwX,g=rX,o-rwx"
@@ -103,7 +103,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Symlink Crowd shared home directory - name: Symlink Crowd shared home directory
file: ansible.builtin.file:
src: "{{ atl_product_home_shared }}" src: "{{ atl_product_home_shared }}"
dest: "{{ atl_product_home }}/shared" dest: "{{ atl_product_home }}/shared"
state: link state: link
@@ -112,7 +112,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Assert baseurl to same as atl_proxy_name - name: Assert baseurl to same as atl_proxy_name
postgresql_query: community.postgresql.postgresql_query:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_jdbc_user }}" login_user: "{{ atl_jdbc_user }}"
login_password: "{{ atl_jdbc_password }}" login_password: "{{ atl_jdbc_password }}"
@@ -131,32 +131,32 @@
ignore_errors: yes # For Molecule as it has no db test framework included ignore_errors: yes # For Molecule as it has no db test framework included
- name: Check that crowd.cfg.xml exists - name: Check that crowd.cfg.xml exists
stat: ansible.builtin.stat:
path: "{{ atl_product_home_shared }}/crowd.cfg.xml" path: "{{ atl_product_home_shared }}/crowd.cfg.xml"
register: crowd_cfg_stat_result register: crowd_cfg_stat_result
- block: - block:
- name: Assert JDBC password to same as atl_jdbc_password - name: Assert JDBC password to same as atl_jdbc_password
xml: community.general.xml:
path: "{{ atl_product_home_shared }}/crowd.cfg.xml" path: "{{ atl_product_home_shared }}/crowd.cfg.xml"
xpath: "/application-configuration/properties/property[@name='hibernate.connection.password']" xpath: "/application-configuration/properties/property[@name='hibernate.connection.password']"
value: "{{ atl_jdbc_password }}" value: "{{ atl_jdbc_password }}"
- name: Assert JDBC url to same as atl_jdbc_url - name: Assert JDBC url to same as atl_jdbc_url
xml: community.general.xml:
path: "{{ atl_product_home_shared }}/crowd.cfg.xml" path: "{{ atl_product_home_shared }}/crowd.cfg.xml"
xpath: "/application-configuration/properties/property[@name='hibernate.connection.url']" xpath: "/application-configuration/properties/property[@name='hibernate.connection.url']"
value: "{{ atl_jdbc_url }}?reWriteBatchedInserts=true" value: "{{ atl_jdbc_url }}?reWriteBatchedInserts=true"
- name: Assert hibernate.c3p0.max_size to same as atl_db_poolmaxsize - name: Assert hibernate.c3p0.max_size to same as atl_db_poolmaxsize
xml: community.general.xml:
path: "{{ atl_product_home_shared }}/crowd.cfg.xml" path: "{{ atl_product_home_shared }}/crowd.cfg.xml"
xpath: "/application-configuration/properties/property[@name='hibernate.c3p0.max_size']" xpath: "/application-configuration/properties/property[@name='hibernate.c3p0.max_size']"
value: "{{ atl_db_poolmaxsize }}" value: "{{ atl_db_poolmaxsize }}"
when: atl_db_poolmaxsize is defined when: atl_db_poolmaxsize is defined
- name: Assert hibernate.c3p0.min_size to same as atl_db_poolminsize - name: Assert hibernate.c3p0.min_size to same as atl_db_poolminsize
xml: community.general.xml:
path: "{{ atl_product_home_shared }}/crowd.cfg.xml" path: "{{ atl_product_home_shared }}/crowd.cfg.xml"
xpath: "/application-configuration/properties/property[@name='hibernate.c3p0.min_size']" xpath: "/application-configuration/properties/property[@name='hibernate.c3p0.min_size']"
value: "{{ atl_db_poolminsize }}" value: "{{ atl_db_poolminsize }}"
@@ -165,6 +165,6 @@
when: crowd_cfg_stat_result.stat.exists when: crowd_cfg_stat_result.stat.exists
- name: Remove crowd.xml to prevent duplicates from appearing in cluster reporting - name: Remove crowd.xml to prevent duplicates from appearing in cluster reporting
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}/apache-tomcat/conf/Catalina/localhost/crowd.xml" path: "{{ atl_product_installation_versioned }}/apache-tomcat/conf/Catalina/localhost/crowd.xml"
state: absent state: absent

View File

@@ -1,7 +1,7 @@
--- ---
- name: Create application DB user - name: Create application DB user
postgresql_user: community.postgresql.postgresql_user:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}" login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}" login_password: "{{ atl_db_root_password }}"
@@ -11,7 +11,7 @@
expires: 'infinity' expires: 'infinity'
- name: Collect dbcluster db_names - name: Collect dbcluster db_names
postgresql_query: community.postgresql.postgresql_query:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}" login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}" login_password: "{{ atl_db_root_password }}"
@@ -22,7 +22,7 @@
- block: - block:
- name: Update root privs for new user - name: Update root privs for new user
postgresql_privs: community.postgresql.postgresql_privs:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}" login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}" login_password: "{{ atl_db_root_password }}"
@@ -33,7 +33,7 @@
# RDS does not allow changing the collation on an existing DB, it only allows collation change on creation of db. If the db already exists, we need the “create new application database” task to be skipped, idempotence can not be relied upon as we cant be certain the collation of the existing db # RDS does not allow changing the collation on an existing DB, it only allows collation change on creation of db. If the db already exists, we need the “create new application database” task to be skipped, idempotence can not be relied upon as we cant be certain the collation of the existing db
- name: Create new application database - name: Create new application database
postgresql_db: community.postgresql.postgresql_db:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}" login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}" login_password: "{{ atl_db_root_password }}"
@@ -51,7 +51,7 @@
- new_only - new_only
- name: Assert ownership of public schema - name: Assert ownership of public schema
postgresql_query: community.postgresql.postgresql_query:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}" login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}" login_password: "{{ atl_db_root_password }}"
@@ -59,7 +59,7 @@
query: "ALTER SCHEMA public OWNER to {{ atl_db_root_user }};" query: "ALTER SCHEMA public OWNER to {{ atl_db_root_user }};"
- name: Grant privs to root user on public schema - name: Grant privs to root user on public schema
postgresql_query: community.postgresql.postgresql_query:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}" login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}" login_password: "{{ atl_db_root_password }}"
@@ -67,7 +67,7 @@
query: "GRANT ALL ON SCHEMA public TO {{ atl_db_root_user }};" query: "GRANT ALL ON SCHEMA public TO {{ atl_db_root_user }};"
- name: Grant privs to application user on public schema - name: Grant privs to application user on public schema
postgresql_query: community.postgresql.postgresql_query:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_db_root_user }}" login_user: "{{ atl_db_root_user }}"
login_password: "{{ atl_db_root_password }}" login_password: "{{ atl_db_root_password }}"

View File

@@ -20,12 +20,12 @@
pre_tasks: pre_tasks:
- name: Create base dir - name: Create base dir
file: ansible.builtin.file:
path: '/opt/atlassian/bin' path: '/opt/atlassian/bin'
state: directory state: directory
- name: Install git - name: Install git
package: ansible.builtin.package:
name: git name: git
roles: roles:

View File

@@ -2,19 +2,19 @@
- name: Fetch the DIY backups repository - name: Fetch the DIY backups repository
git: ansible.builtin.git:
repo: "{{ atl_diy_backup_repo }}" repo: "{{ atl_diy_backup_repo }}"
dest: "{{ atl_diy_backup_dir }}" dest: "{{ atl_diy_backup_dir }}"
version: "master" version: "master"
- name: Configure DIY backup for BB on AWS - name: Configure DIY backup for BB on AWS
template: ansible.builtin.template:
src: "bitbucket.diy-backup.vars.sh.j2" src: "bitbucket.diy-backup.vars.sh.j2"
dest: "{{ atl_diy_backup_dir }}/bitbucket.diy-backup.vars.sh" dest: "{{ atl_diy_backup_dir }}/bitbucket.diy-backup.vars.sh"
mode: 0640 mode: 0640
- name: Install backup wrapper script - name: Install backup wrapper script
template: ansible.builtin.template:
src: "run-backup.j2" src: "run-backup.j2"
dest: "{{ atl_installation_base }}/bin/run-backup" dest: "{{ atl_installation_base }}/bin/run-backup"
mode: 0750 mode: 0750

View File

@@ -30,11 +30,11 @@
pre_tasks: pre_tasks:
- name: Create shared home - name: Create shared home
file: ansible.builtin.file:
path: '/media/atl/jira/shared/' path: '/media/atl/jira/shared/'
state: directory state: directory
- name: Create jira-config.properties to check copy - name: Create jira-config.properties to check copy
copy: ansible.builtin.copy:
dest: '/media/atl/jira/shared/jira-config.properties' dest: '/media/atl/jira/shared/jira-config.properties'
content: "jira.projectkey.warning = testwarning" content: "jira.projectkey.warning = testwarning"
force: false # For idempotency check force: false # For idempotency check

View File

@@ -2,29 +2,29 @@
- name: Create database config - name: Create database config
template: ansible.builtin.template:
src: dbconfig.xml.j2 src: dbconfig.xml.j2
dest: "{{ atl_product_home }}/dbconfig.xml" dest: "{{ atl_product_home }}/dbconfig.xml"
owner: "{{ atl_product_user }}" owner: "{{ atl_product_user }}"
- name: Create cluster config - name: Create cluster config
template: ansible.builtin.template:
src: cluster.properties.j2 src: cluster.properties.j2
dest: "{{ atl_product_home }}/cluster.properties" dest: "{{ atl_product_home }}/cluster.properties"
owner: "{{ atl_product_user }}" owner: "{{ atl_product_user }}"
- name: Create server config - name: Create server config
template: ansible.builtin.template:
src: server.xml.j2 src: server.xml.j2
dest: "{{ atl_product_installation_versioned }}/conf/server.xml" dest: "{{ atl_product_installation_versioned }}/conf/server.xml"
- name: Check for a jira-config.properties in the shared home - name: Check for a jira-config.properties in the shared home
stat: ansible.builtin.stat:
path: "{{ atl_product_home_shared }}/jira-config.properties" path: "{{ atl_product_home_shared }}/jira-config.properties"
register: jira_config_properties register: jira_config_properties
- name: Copy jira-config.properties if exists - name: Copy jira-config.properties if exists
copy: ansible.builtin.copy:
remote_src: true remote_src: true
src: "{{ atl_product_home_shared }}/jira-config.properties" src: "{{ atl_product_home_shared }}/jira-config.properties"
dest: "{{ atl_product_home }}/jira-config.properties" dest: "{{ atl_product_home }}/jira-config.properties"
@@ -35,7 +35,7 @@
- name: Override JVM memory settings. - name: Override JVM memory settings.
# Ugly but necessary as the product installs this file so we need to make the change here. # Ugly but necessary as the product installs this file so we need to make the change here.
lineinfile: ansible.builtin.lineinfile:
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
backrefs: true backrefs: true
regexp: "^{{ item }}=" regexp: "^{{ item }}="
@@ -45,25 +45,25 @@
- 'JVM_MAXIMUM_MEMORY' - 'JVM_MAXIMUM_MEMORY'
- name: Set Jira home directory - name: Set Jira home directory
lineinfile: ansible.builtin.lineinfile:
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
regexp: "JIRA_HOME=" regexp: "JIRA_HOME="
line: 'JIRA_HOME="{{ atl_product_home }}"' line: 'JIRA_HOME="{{ atl_product_home }}"'
- name: Set the Tomcat environment - name: Set the Tomcat environment
lineinfile: ansible.builtin.lineinfile:
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
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 support recommended JVM args - name: Set support recommended JVM args
lineinfile: ansible.builtin.lineinfile:
path: "{{ atl_product_installation_versioned }}/bin/setenv.sh" path: "{{ atl_product_installation_versioned }}/bin/setenv.sh"
regexp: "JVM_SUPPORT_RECOMMENDED_ARGS=" regexp: "JVM_SUPPORT_RECOMMENDED_ARGS="
line: 'JVM_SUPPORT_RECOMMENDED_ARGS="{{ atl_jvm_opts }}"' line: 'JVM_SUPPORT_RECOMMENDED_ARGS="{{ atl_jvm_opts }}"'
- name: Create application directories - name: Create application directories
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
mode: 0750 mode: 0750
@@ -77,7 +77,7 @@
- name: Limit permissions on the installation directory - name: Limit permissions on the installation directory
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}" path: "{{ atl_product_installation_versioned }}"
owner: "root" owner: "root"
group: "root" group: "root"
@@ -90,7 +90,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Grant access to the product working directories - name: Grant access to the product working directories
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
mode: "u=rwX,g=rX,o-rwx" mode: "u=rwX,g=rX,o-rwx"
@@ -104,7 +104,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Create conf/Catalina directory owned by product so catalina.out logging works - name: Create conf/Catalina directory owned by product so catalina.out logging works
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}/conf/Catalina" path: "{{ atl_product_installation_versioned }}/conf/Catalina"
state: directory state: directory
mode: "u=rwX,g=rX,o-rwx" mode: "u=rwX,g=rX,o-rwx"
@@ -113,7 +113,7 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Assert baseurl to same as atl_proxy_name - name: Assert baseurl to same as atl_proxy_name
postgresql_query: community.postgresql.postgresql_query:
login_host: "{{ atl_db_host }}" login_host: "{{ atl_db_host }}"
login_user: "{{ atl_jdbc_user }}" login_user: "{{ atl_jdbc_user }}"
login_password: "{{ atl_jdbc_password }}" login_password: "{{ atl_jdbc_password }}"

View File

@@ -1,16 +1,18 @@
--- ---
- name: Install Amazon-Linux-specific support packages - name: Install Amazon-Linux-specific support packages
yum: ansible.builtin.yum:
name: name:
- dejavu-sans-fonts - dejavu-sans-fonts
- file - file
- git-{{ git_version }} - git-{{ git_version }}
- libxml2 - libxml2
- shadow-utils - shadow-utils
vars:
ansible_python_interpreter: /usr/bin/python2
- name: Limit the SSH ciphers - name: Limit the SSH ciphers
lineinfile: ansible.builtin.lineinfile:
path: "/etc/ssh/sshd_config" path: "/etc/ssh/sshd_config"
# Drop insecure ciphers, currently 3des-cbc only. You can get the # Drop insecure ciphers, currently 3des-cbc only. You can get the
# full list with `sshd -T | grep -i ciphers` # full list with `sshd -T | grep -i ciphers`

View File

@@ -3,10 +3,10 @@
# Note: Try and limit these to packages that are distro-specific, and # Note: Try and limit these to packages that are distro-specific, and
# place commonly-named ones below. # place commonly-named ones below.
- name: Install distro-specific prerequisites - name: Install distro-specific prerequisites
include_tasks: "{{ ansible_distribution|lower }}.yml" ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}.yml"
- name: Install common support packages - name: Install common support packages
package: ansible.builtin.package:
name: name:
- jq - jq
- tar - tar
@@ -16,19 +16,19 @@
- python-psycopg2 - python-psycopg2
- name: Create product group - name: Create product group
group: ansible.builtin.group:
name: "{{ atl_product_user }}" name: "{{ atl_product_user }}"
gid: "{{ atl_product_user_uid }}" gid: "{{ atl_product_user_uid }}"
- name: Create product user - name: Create product user
user: ansible.builtin.user:
name: "{{ atl_product_user }}" name: "{{ atl_product_user }}"
uid: "{{ atl_product_user_uid }}" uid: "{{ atl_product_user_uid }}"
group: "{{ atl_product_user }}" group: "{{ atl_product_user }}"
comment: "Product runtime user" comment: "Product runtime user"
- name: Stop systemd-cleanup deleting the jvm socket file - name: Stop systemd-cleanup deleting the jvm socket file
copy: ansible.builtin.copy:
src: java.conf src: java.conf
dest: "/usr/lib/tmpfiles.d/java.conf" dest: "/usr/lib/tmpfiles.d/java.conf"
owner: root owner: root
@@ -37,7 +37,7 @@
register: systemd_config_changed register: systemd_config_changed
- name: Force systemd to reload daemon configuration - name: Force systemd to reload daemon configuration
systemd: ansible.builtin.systemd:
daemon_reload: yes daemon_reload: yes
when: when:
- systemd_config_changed is defined - systemd_config_changed is defined

View File

@@ -1,7 +1,7 @@
--- ---
- name: Install common Ubuntu support packages - name: Install common Ubuntu support packages
apt: ansible.builtin.apt:
name: name:
- python3-psycopg2 - python3-psycopg2
- libxml2-utils - libxml2-utils

View File

@@ -1,7 +1,7 @@
--- ---
- name: Create mountpoint - name: Create mountpoint
file: ansible.builtin.file:
state: directory state: directory
path: "{{ atl_shared_mountpoint }}" path: "{{ atl_shared_mountpoint }}"
mode: 0755 mode: 0755
@@ -9,7 +9,7 @@
group: "{{ atl_product_user }}" group: "{{ atl_product_user }}"
- name: Enable mountpoint in fstab - name: Enable mountpoint in fstab
mount: ansible.posix.mount:
src: "{{ atl_fileserver_host }}:{{ atl_nfs_target }}" src: "{{ atl_fileserver_host }}:{{ atl_nfs_target }}"
path: "{{ atl_nfs_mountpoint }}" path: "{{ atl_nfs_mountpoint }}"
fstype: nfs fstype: nfs

View File

@@ -1,6 +1,6 @@
--- ---
- name: Restart NFS - name: Restart NFS
service: ansible.builtin.service:
name: "nfs.service" name: "nfs.service"
state: restarted state: restarted

View File

@@ -1,6 +1,8 @@
--- ---
- name: Install Amazon-Linux-specific NFS packages - name: Install Amazon-Linux-specific NFS packages
yum: ansible.builtin.yum:
name: name:
- nfs-utils - nfs-utils
vars:
ansible_python_interpreter: /usr/bin/python2

View File

@@ -1,16 +1,16 @@
--- ---
- name: Install distro-specific NFS packages - name: Install distro-specific NFS packages
include_tasks: "{{ ansible_distribution|lower }}.yml" ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}.yml"
- name: Create mountpoint - name: Create mountpoint
file: ansible.builtin.file:
path: "{{ atl_shared_mountpoint }}" path: "{{ atl_shared_mountpoint }}"
state: directory state: directory
- name: Setup the disk partition - name: Setup the disk partition
parted: community.general.parted:
device: "{{ atl_nfs_server_device }}" device: "{{ atl_nfs_server_device }}"
label: gpt label: gpt
name: "{{ atl_nfs_fs_label }}" name: "{{ atl_nfs_fs_label }}"
@@ -22,7 +22,7 @@
- name: Create the filesystem - name: Create the filesystem
filesystem: community.general.filesystem:
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 }}"
@@ -30,7 +30,7 @@
- new_only - new_only
- name: Setup fstab and mount the filesystem - name: Setup fstab and mount the filesystem
mount: ansible.posix.mount:
path: "{{ atl_shared_mountpoint }}" path: "{{ atl_shared_mountpoint }}"
src: "LABEL={{ atl_nfs_fs_label }}" src: "LABEL={{ atl_nfs_fs_label }}"
fstype: "{{ atl_nfs_fs_type }}" fstype: "{{ atl_nfs_fs_type }}"
@@ -40,7 +40,7 @@
- name: Create the shared home - name: Create the shared home
file: ansible.builtin.file:
path: "{{ atl_shared_mountpoint }}/{{ atl_product_user }}/shared" path: "{{ atl_shared_mountpoint }}/{{ atl_product_user }}/shared"
state: directory state: directory
owner: "{{ atl_product_user }}" owner: "{{ atl_product_user }}"
@@ -51,14 +51,14 @@
- name: Create the NFS export file - name: Create the NFS export file
template: ansible.builtin.template:
src: "media-atl.exports.j2" src: "media-atl.exports.j2"
dest: "/etc/exports.d/20-media-atl.exports" dest: "/etc/exports.d/20-media-atl.exports"
notify: notify:
- Restart NFS - Restart NFS
- name: Enable NFS - name: Enable NFS
service: ansible.builtin.service:
name: nfs.service name: nfs.service
enabled: true enabled: true
state: started state: started

View File

@@ -1,7 +1,7 @@
--- ---
- name: Install Ubuntu-specific NFS packages - name: Install Ubuntu-specific NFS packages
apt: ansible.builtin.apt:
name: name:
- nfs-kernel-server - nfs-kernel-server
- libnfs-utils - libnfs-utils

View File

@@ -4,7 +4,7 @@
block: block:
- name: Add Adoptium yum repository - name: Add Adoptium yum repository
yum_repository: ansible.builtin.yum_repository:
name: Adoptium name: Adoptium
file: adoptium file: adoptium
description: Adoptium Repo description: Adoptium Repo
@@ -14,12 +14,14 @@
state: present state: present
- name: Install Eclipse Temurin JDK - name: Install Eclipse Temurin JDK
yum: ansible.builtin.yum:
name: "temurin-{{ java_major_version }}-jdk" name: "temurin-{{ java_major_version }}-jdk"
state: present state: present
vars:
ansible_python_interpreter: /usr/bin/python2
- name: Ensure common JDK symlink exists - name: Ensure common JDK symlink exists
alternatives: community.general.alternatives:
link: "/usr/lib/jvm/java" link: "/usr/lib/jvm/java"
name: "java_sdk" name: "java_sdk"
path: "/usr/lib/jvm/temurin-{{ java_major_version }}-jdk" path: "/usr/lib/jvm/temurin-{{ java_major_version }}-jdk"
@@ -30,6 +32,8 @@
- runtime_pkg - runtime_pkg
- name: Install other base packages on Amazon Linux - name: Install other base packages on Amazon Linux
yum: ansible.builtin.yum:
name: name:
- dejavu-fonts-common # Required by the installer - dejavu-fonts-common # Required by the installer
vars:
ansible_python_interpreter: /usr/bin/python2

View File

@@ -1,4 +1,4 @@
--- ---
- name: Perform distro-specific tasks - name: Perform distro-specific tasks
include_tasks: "{{ ansible_distribution|lower }}.yml" ansible.builtin.include_tasks: "{{ ansible_distribution|lower }}.yml"

View File

@@ -4,29 +4,29 @@
block: block:
- name: Install gnupg - name: Install gnupg
apt: ansible.builtin.apt:
name: gnupg name: gnupg
state: present state: present
- name: Add Adoptium debian repo public key - name: Add Adoptium debian repo public key
apt_key: ansible.builtin.apt_key:
url: https://packages.adoptium.net/artifactory/api/gpg/key/public url: https://packages.adoptium.net/artifactory/api/gpg/key/public
state: present state: present
- name: Add Adoptium debian repository - name: Add Adoptium debian repository
apt_repository: ansible.builtin.apt_repository:
repo: "deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main" repo: "deb https://packages.adoptium.net/artifactory/deb {{ ansible_distribution_release }} main"
state: present state: present
filename: adoptium filename: adoptium
- name: Install Eclipse Temurin JDK - name: Install Eclipse Temurin JDK
apt: ansible.builtin.apt:
name: "temurin-{{ java_major_version }}-jdk" name: "temurin-{{ java_major_version }}-jdk"
update_cache: yes update_cache: yes
state: present state: present
- name: Ensure common JDK symlink exists - name: Ensure common JDK symlink exists
alternatives: community.general.alternatives:
link: "/usr/lib/jvm/java" link: "/usr/lib/jvm/java"
name: "java_sdk" name: "java_sdk"
path: "/usr/lib/jvm/temurin-{{ java_major_version }}-jdk-{{ debian_architecture }}" path: "/usr/lib/jvm/temurin-{{ java_major_version }}-jdk-{{ debian_architecture }}"
@@ -37,6 +37,6 @@
- runtime_pkg - runtime_pkg
- name: Install other base packages on Ubuntu - name: Install other base packages on Ubuntu
package: ansible.builtin.package:
name: name:
- fonts-dejavu-core # Required by installer - fonts-dejavu-core # Required by installer

View File

@@ -16,11 +16,11 @@
atl_jdbc_template: 'template0' atl_jdbc_template: 'template0'
pre_tasks: pre_tasks:
- name: Create cache dir - name: Create cache dir
file: ansible.builtin.file:
path: '/media/atl/jira/shared/' path: '/media/atl/jira/shared/'
state: directory state: directory
- name: Seed version - name: Seed version
copy: ansible.builtin.copy:
dest: '/media/atl/jira/shared/jira-core.version' dest: '/media/atl/jira/shared/jira-core.version'
content: "8.14.0" content: "8.14.0"
force: false # For idempotency check force: false # For idempotency check

View File

@@ -10,11 +10,11 @@
pre_tasks: pre_tasks:
- name: Create cache dir - name: Create cache dir
file: ansible.builtin.file:
path: '/media/atl/jira/shared/' path: '/media/atl/jira/shared/'
state: directory state: directory
- name: Seed version - name: Seed version
copy: ansible.builtin.copy:
dest: '/media/atl/jira/shared/jira-core.version' dest: '/media/atl/jira/shared/jira-core.version'
content: "7.10.2" content: "7.10.2"
force: false # For idempotency check force: false # For idempotency check

View File

@@ -10,11 +10,11 @@
pre_tasks: pre_tasks:
- name: Create cache dir - name: Create cache dir
file: ansible.builtin.file:
path: '/media/atl/jira/shared/' path: '/media/atl/jira/shared/'
state: directory state: directory
- name: Seed version - name: Seed version
copy: ansible.builtin.copy:
dest: '/media/atl/jira/shared/jira-core.version' dest: '/media/atl/jira/shared/jira-core.version'
content: "7.9.0" content: "7.9.0"
force: false # For idempotency check force: false # For idempotency check

View File

@@ -10,11 +10,11 @@
pre_tasks: pre_tasks:
- name: Create cache dir - name: Create cache dir
file: ansible.builtin.file:
path: '/media/atl/jira/shared/' path: '/media/atl/jira/shared/'
state: directory state: directory
- name: Seed version - name: Seed version
copy: ansible.builtin.copy:
dest: '/media/atl/jira/shared/jira-core.version' dest: '/media/atl/jira/shared/jira-core.version'
content: "7.9.0" content: "7.9.0"
force: false # For idempotency check force: false # For idempotency check

View File

@@ -1,9 +1,9 @@
--- ---
- name: Fetch the latest version from URL - name: Fetch the latest version from URL
set_fact: ansible.builtin.set_fact:
atl_product_version_json: "{{ lookup('url', 'https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions') }}" atl_product_version_json: "{{ lookup('url', 'https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions') }}"
- name: Set the local var to retrieved version - name: Set the local var to retrieved version
set_fact: ansible.builtin.set_fact:
atl_latest_version: "{{ atl_product_version_json._embedded.versions[0].name }}" atl_latest_version: "{{ atl_product_version_json._embedded.versions[0].name }}"

View File

@@ -1,7 +1,7 @@
--- ---
- name: Check for alternate obr download url - name: Check for alternate obr download url
set_fact: ansible.builtin.set_fact:
atl_source_obr_from_marketplace: false atl_source_obr_from_marketplace: false
when: when:
- atl_obr_download_url is defined - atl_obr_download_url is defined
@@ -10,40 +10,40 @@
block: block:
- name: Marketplace OBR - Get the installer product version info - name: Marketplace OBR - Get the installer product version info
uri: ansible.builtin.uri:
url: "{{ atl_mpac_products }}/key/jira/versions/name/{{ atl_product_version }}" url: "{{ atl_mpac_products }}/key/jira/versions/name/{{ atl_product_version }}"
return_content: yes return_content: yes
register: atl_product_version_info register: atl_product_version_info
- name: Marketplace OBR - Show the returned build number - name: Marketplace OBR - Show the returned build number
debug: ansible.builtin.debug:
msg="buildNumber={{ atl_product_version_info.json.buildNumber }}" msg="buildNumber={{ atl_product_version_info.json.buildNumber }}"
- name: Marketplace OBR - Get the JSD build version info - name: Marketplace OBR - Get the JSD build version info
uri: ansible.builtin.uri:
url: "{{ atl_mpac_products }}/key/jira-servicedesk/versions/latest?application=\ url: "{{ atl_mpac_products }}/key/jira-servicedesk/versions/latest?application=\
jira&applicationBuild={{ atl_product_version_info.json.buildNumber }}" jira&applicationBuild={{ atl_product_version_info.json.buildNumber }}"
return_content: yes return_content: yes
register: atl_jsd_build_info register: atl_jsd_build_info
- name: Marketplace OBR - Show the returned obr binary href - name: Marketplace OBR - Show the returned obr binary href
debug: ansible.builtin.debug:
msg="obr_ref={{ atl_jsd_build_info.json._embedded.artifact._links.binary.href }}" msg="obr_ref={{ atl_jsd_build_info.json._embedded.artifact._links.binary.href }}"
- name: Marketplace OBR - Set atl_obr_download_url - name: Marketplace OBR - Set atl_obr_download_url
set_fact: ansible.builtin.set_fact:
atl_obr_download_url: "{{ atl_jsd_build_info.json._embedded.artifact._links.binary.href }}" atl_obr_download_url: "{{ atl_jsd_build_info.json._embedded.artifact._links.binary.href }}"
- name: Marketplace OBR - Set atl_jsd_build - name: Marketplace OBR - Set atl_jsd_build
set_fact: ansible.builtin.set_fact:
atl_jsd_build: "{{ atl_jsd_build_info.json.name }}" atl_jsd_build: "{{ atl_jsd_build_info.json.name }}"
- name: Marketplace OBR - Show the obr filename - name: Marketplace OBR - Show the obr filename
debug: ansible.builtin.debug:
msg="obr_name=jira-servicedesk-application-{{ atl_jsd_build }}.obr" msg="obr_name=jira-servicedesk-application-{{ atl_jsd_build }}.obr"
- name: Marketplace OBR - Set the obr filename - name: Marketplace OBR - Set the obr filename
set_fact: ansible.builtin.set_fact:
atl_obr_filename: "jira-servicedesk-application-{{ atl_jsd_build }}.obr" atl_obr_filename: "jira-servicedesk-application-{{ atl_jsd_build }}.obr"
when: when:
@@ -56,18 +56,18 @@
block: block:
- name: Alternate URL OBR - Show the obr filename - name: Alternate URL OBR - Show the obr filename
debug: ansible.builtin.debug:
msg="obr_name=jira-servicedesk-application-{{ atl_jsd_build }}.obr" msg="obr_name=jira-servicedesk-application-{{ atl_jsd_build }}.obr"
- name: Alternate OBR - Set the obr filename - name: Alternate OBR - Set the obr filename
set_fact: ansible.builtin.set_fact:
atl_obr_filename: "jira-servicedesk-application-{{ atl_jsd_build }}.obr" atl_obr_filename: "jira-servicedesk-application-{{ atl_jsd_build }}.obr"
when: when:
- not atl_source_obr_from_marketplace | bool - not atl_source_obr_from_marketplace | bool
- name: is shared_home set ? - name: is shared_home set ?
debug: ansible.builtin.debug:
msg="atl_product_home_shared_download_dir={{ atl_product_home_shared_download_dir }}" msg="atl_product_home_shared_download_dir={{ atl_product_home_shared_download_dir }}"
# For the first run a temp obr should be downloaded but moved to # For the first run a temp obr should be downloaded but moved to
@@ -77,7 +77,7 @@
# a directory is used as a lockfile (atomic operation) when moving obr. # a directory is used as a lockfile (atomic operation) when moving obr.
- name: Set assumptions to avoid race condition - name: Set assumptions to avoid race condition
set_fact: ansible.builtin.set_fact:
download_obr: true download_obr: true
move_obr: false move_obr: false
atl_obr_download: "{{ atl_installer_temp }}/{{ atl_obr_filename }}" atl_obr_download: "{{ atl_installer_temp }}/{{ atl_obr_filename }}"
@@ -87,22 +87,22 @@
# Check for pre-downloaded obr on shared_home and completed lock dir. # Check for pre-downloaded obr on shared_home and completed lock dir.
- name: Check for completed lock directory - name: Check for completed lock directory
stat: ansible.builtin.stat:
path: "{{ atl_obr_completed_lock }}" path: "{{ atl_obr_completed_lock }}"
register: completed_lock register: completed_lock
- name: Check for obr in home_shared - name: Check for obr in home_shared
stat: ansible.builtin.stat:
path: "{{ atl_obr_shared_download }}" path: "{{ atl_obr_shared_download }}"
register: home_shared_download register: home_shared_download
- name: debug home_shared_download - name: debug home_shared_download
debug: ansible.builtin.debug:
var: home_shared_download var: home_shared_download
# If obr exists and lockdir exists use this obr instead # If obr exists and lockdir exists use this obr instead
- name: Check lock directory and obr exists on shared_home - name: Check lock directory and obr exists on shared_home
set_fact: ansible.builtin.set_fact:
download_obr: false download_obr: false
atl_obr_download: "{{ atl_obr_shared_download }}" atl_obr_download: "{{ atl_obr_shared_download }}"
when: when:
@@ -114,14 +114,14 @@
# Fetch obr if required - note we validate it by mimetype rather than checksum due to https://ecosystem.atlassian.net/browse/AMKT-25526 # Fetch obr if required - note we validate it by mimetype rather than checksum due to https://ecosystem.atlassian.net/browse/AMKT-25526
- name: download_obr is true so fetch and do all the things - name: download_obr is true so fetch and do all the things
block: block:
- debug: - ansible.builtin.debug:
var: atl_obr_download_url var: atl_obr_download_url
- debug: - ansible.builtin.debug:
var: atl_obr_download var: atl_obr_download
# Fetch obr and copy to temp # Fetch obr and copy to temp
- name: Fetch obr - name: Fetch obr
get_url: ansible.builtin.get_url:
url: "{{ atl_obr_download_url }}" url: "{{ atl_obr_download_url }}"
dest: "{{ atl_obr_download }}" dest: "{{ atl_obr_download }}"
mode: 0755 mode: 0755
@@ -130,12 +130,12 @@
register: atl_obr_completed register: atl_obr_completed
- name: Confirm the output from the download task - name: Confirm the output from the download task
debug: ansible.builtin.debug:
var: atl_obr_completed var: atl_obr_completed
# get details about the obr # get details about the obr
- name: Stat the new obr file - name: Stat the new obr file
stat: ansible.builtin.stat:
path: "{{ atl_obr_completed.dest }}" path: "{{ atl_obr_completed.dest }}"
get_mime: yes get_mime: yes
register: atl_obr_stats register: atl_obr_stats
@@ -143,14 +143,14 @@
- atl_obr_completed.dest is defined - atl_obr_completed.dest is defined
- name: fail if the downloaded OBR is not a zip file - name: fail if the downloaded OBR is not a zip file
fail: ansible.builtin.fail:
msg: "The downloaded OBR was not detected as being a valid ZIP file: {{ atl_obr_stats }}" msg: "The downloaded OBR was not detected as being a valid ZIP file: {{ atl_obr_stats }}"
when: when:
- (atl_obr_stats.stat.mimetype is not defined) or (atl_obr_stats.stat.mimetype is not match("application/zip")) - (atl_obr_stats.stat.mimetype is not defined) or (atl_obr_stats.stat.mimetype is not match("application/zip"))
# If obr was fetched make the lock directory # If obr was fetched make the lock directory
- name: Create moving_lock. - name: Create moving_lock.
file: ansible.builtin.file:
path: "{{ atl_obr_moving_lock }}" path: "{{ atl_obr_moving_lock }}"
state: directory state: directory
when: when:
@@ -160,7 +160,7 @@
# Directory lock was created by this run? # Directory lock was created by this run?
# If so, then set a fact intending to move obr # If so, then set a fact intending to move obr
- name: Move obr Scenario - lock created by this run - name: Move obr Scenario - lock created by this run
set_fact: ansible.builtin.set_fact:
move_obr: true move_obr: true
when: when:
- moving_lock_created is succeeded - moving_lock_created is succeeded
@@ -175,21 +175,21 @@
block: block:
- name: Copy temp installer to home_shared - name: Copy temp installer to home_shared
copy: ansible.builtin.copy:
src: "{{ atl_obr_download }}" src: "{{ atl_obr_download }}"
dest: "{{ atl_obr_shared_download }}" dest: "{{ atl_obr_shared_download }}"
remote_src: true remote_src: true
register: copied register: copied
- name: Create completed_lock once obr downloaded and copied - name: Create completed_lock once obr downloaded and copied
file: ansible.builtin.file:
path: "{{ atl_obr_completed_lock }}" path: "{{ atl_obr_completed_lock }}"
state: directory state: directory
when: copied is succeeded when: copied is succeeded
register: completed_lock_created register: completed_lock_created
- name: Remove moving_lock to show that obr is completed - name: Remove moving_lock to show that obr is completed
file: ansible.builtin.file:
path: "{{ atl_obr_moving_lock }}" path: "{{ atl_obr_moving_lock }}"
state: absent state: absent
when: when:
@@ -198,14 +198,14 @@
register: moving_lock_removed register: moving_lock_removed
- name: Delete old temp installer - name: Delete old temp installer
file: ansible.builtin.file:
path: "{{ atl_obr_download }}" path: "{{ atl_obr_download }}"
state: absent state: absent
when: moving_lock_removed is succeeded when: moving_lock_removed is succeeded
register: temp_deleted register: temp_deleted
- name: Set install to home_shared location - name: Set install to home_shared location
set_fact: ansible.builtin.set_fact:
atl_obr_download: "{{ atl_obr_shared_download }}" atl_obr_download: "{{ atl_obr_shared_download }}"
when: temp_deleted is succeeded when: temp_deleted is succeeded
@@ -215,7 +215,7 @@
# (which is either on home_shared or temp) # (which is either on home_shared or temp)
- name: Ensure instaled-plugins dir exists - name: Ensure instaled-plugins dir exists
file: ansible.builtin.file:
path: "{{ atl_product_home_shared }}/plugins/installed-plugins" path: "{{ atl_product_home_shared }}/plugins/installed-plugins"
state: directory state: directory
mode: 0750 mode: 0750
@@ -224,7 +224,7 @@
# Note as ansible unarchive cant handle "-j junk paths" we need to ignore errors to bypass the path verify # Note as ansible unarchive cant handle "-j junk paths" we need to ignore errors to bypass the path verify
- name: Unpack the obr into the atlassian-bundled-plugins dir - name: Unpack the obr into the atlassian-bundled-plugins dir
unarchive: ansible.builtin.unarchive:
remote_src: yes remote_src: yes
src: "{{ atl_obr_download }}" src: "{{ atl_obr_download }}"
dest: "{{ atl_product_installation_versioned }}/atlassian-jira/WEB-INF/atlassian-bundled-plugins" dest: "{{ atl_product_installation_versioned }}/atlassian-jira/WEB-INF/atlassian-bundled-plugins"
@@ -239,14 +239,14 @@
register: obr_unpack register: obr_unpack
- name: Move JSD dependency jars into the bundled-plugins dir # noqa 503 - ignore lint info about when changed - name: Move JSD dependency jars into the bundled-plugins dir # noqa 503 - ignore lint info about when changed
copy: ansible.builtin.copy:
remote_src: yes remote_src: yes
src: "{{ atl_product_installation_versioned }}/atlassian-jira/WEB-INF/atlassian-bundled-plugins/dependencies/" src: "{{ atl_product_installation_versioned }}/atlassian-jira/WEB-INF/atlassian-bundled-plugins/dependencies/"
dest: "{{ atl_product_installation_versioned }}/atlassian-jira/WEB-INF/atlassian-bundled-plugins/" dest: "{{ atl_product_installation_versioned }}/atlassian-jira/WEB-INF/atlassian-bundled-plugins/"
when: obr_unpack.changed when: obr_unpack.changed
- name: Remove the empty dependencies folder # noqa 503 - ignore lint info about when changed - name: Remove the empty dependencies folder # noqa 503 - ignore lint info about when changed
file: ansible.builtin.file:
path: "{{ atl_product_installation_versioned }}/atlassian-jira/WEB-INF/atlassian-bundled-plugins/dependencies" path: "{{ atl_product_installation_versioned }}/atlassian-jira/WEB-INF/atlassian-bundled-plugins/dependencies"
state: absent state: absent
when: obr_unpack.changed when: obr_unpack.changed

View File

@@ -1,5 +1,5 @@
--- ---
- name: Set the download edition for ServiceDesk - name: Set the download edition for ServiceDesk
set_fact: ansible.builtin.set_fact:
atl_download_edition: "servicedesk" atl_download_edition: "servicedesk"

View File

@@ -1,9 +1,9 @@
--- ---
- name: Fetch the latest version from URL - name: Fetch the latest version from URL
set_fact: ansible.builtin.set_fact:
atl_product_version_json: "{{ lookup('url', 'https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions') }}" atl_product_version_json: "{{ lookup('url', 'https://marketplace.atlassian.com/rest/2/products/key/jira-servicedesk/versions') }}"
- name: Set the local var to retrieved version - name: Set the local var to retrieved version
set_fact: ansible.builtin.set_fact:
atl_latest_version: "{{ atl_product_version_json._embedded.versions[0].name }}" atl_latest_version: "{{ atl_product_version_json._embedded.versions[0].name }}"

View File

@@ -1,9 +1,9 @@
--- ---
- name: Fetch the latest version from URL - name: Fetch the latest version from URL
set_fact: ansible.builtin.set_fact:
atl_product_version_json: "{{ lookup('url', 'https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions') }}" atl_product_version_json: "{{ lookup('url', 'https://marketplace.atlassian.com/rest/2/products/key/jira-software/versions') }}"
- name: Set the local var to retrieved version - name: Set the local var to retrieved version
set_fact: ansible.builtin.set_fact:
atl_latest_version: "{{ atl_product_version_json._embedded.versions[0].name }}" atl_latest_version: "{{ atl_product_version_json._embedded.versions[0].name }}"

View File

@@ -2,7 +2,7 @@
- name: Check for existing version cache file - name: Check for existing version cache file
stat: ansible.builtin.stat:
path: "{{ atl_product_version_cache }}" path: "{{ atl_product_version_cache }}"
register: cached register: cached
@@ -11,19 +11,19 @@
block: block:
- name: Read cached version from file - name: Read cached version from file
command: "cat {{ atl_product_version_cache }}" ansible.builtin.command: "cat {{ atl_product_version_cache }}"
register: atl_product_version_file register: atl_product_version_file
changed_when: false changed_when: false
- name: Set the local var to cached version - name: Set the local var to cached version
set_fact: ansible.builtin.set_fact:
atl_cached_version: "{{ atl_product_version_file.stdout }}" atl_cached_version: "{{ atl_product_version_file.stdout }}"
when: cached.stat.exists when: cached.stat.exists
- name: Determine if requested version is 'latest' - name: Determine if requested version is 'latest'
set_fact: ansible.builtin.set_fact:
version_is_latest: "{{ atl_product_version is undefined or version_is_latest: "{{ atl_product_version is undefined or
not atl_product_version or not atl_product_version or
atl_product_version == 'latest' }}" atl_product_version == 'latest' }}"
@@ -33,7 +33,7 @@
block: block:
- name: Fetch the latest edition version - name: Fetch the latest edition version
include_tasks: "{{ atl_product_edition }}_version_latest.yml" ansible.builtin.include_tasks: "{{ atl_product_edition }}_version_latest.yml"
when: not cached.stat.exists and version_is_latest when: not cached.stat.exists and version_is_latest
@@ -63,12 +63,12 @@
block: block:
- name: "Case: Cached version exists, has precedence over 'latest'" - name: "Case: Cached version exists, has precedence over 'latest'"
set_fact: ansible.builtin.set_fact:
atl_download_version: "{{ atl_cached_version }}" atl_download_version: "{{ atl_cached_version }}"
when: cached.stat.exists when: cached.stat.exists
- name: "Case: No cached version, use latest" - name: "Case: No cached version, use latest"
set_fact: ansible.builtin.set_fact:
atl_download_version: "{{ atl_latest_version }}" atl_download_version: "{{ atl_latest_version }}"
when: not cached.stat.exists when: not cached.stat.exists
@@ -77,24 +77,24 @@
- name: "Case: Version is not latest" - name: "Case: Version is not latest"
block: block:
- name: "create atlassian z versioning for comparison" - name: "create atlassian z versioning for comparison"
set_fact: ansible.builtin.set_fact:
atl_z_product_version: "{{ atl_product_version ~ '-z' }}" atl_z_product_version: "{{ atl_product_version ~ '-z' }}"
atl_z_cached_version: "{{ atl_cached_version ~ '-z' }}" atl_z_cached_version: "{{ atl_cached_version ~ '-z' }}"
- name: "create atlassian ordered versioning for comparison" - name: "create atlassian ordered versioning for comparison"
set_fact: ansible.builtin.set_fact:
atl_product_normalised_version: "{{ atl_z_product_version | replace('-m', '-am') }}" atl_product_normalised_version: "{{ atl_z_product_version | replace('-m', '-am') }}"
atl_cached_normalised_version: "{{ atl_z_cached_version | replace('-m', '-am') }}" atl_cached_normalised_version: "{{ atl_z_cached_version | replace('-m', '-am') }}"
- name: "Case: No cached version, or supplied is higher; use supplied" - name: "Case: No cached version, or supplied is higher; use supplied"
set_fact: ansible.builtin.set_fact:
atl_download_version: "{{ atl_product_version }}" atl_download_version: "{{ atl_product_version }}"
when: force_version_update | bool or when: force_version_update | bool or
not cached.stat.exists or not cached.stat.exists or
atl_product_normalised_version is version(atl_cached_normalised_version, '>') atl_product_normalised_version is version(atl_cached_normalised_version, '>')
- name: "Case: Cached version is higher or forced, ignore supplied" - name: "Case: Cached version is higher or forced, ignore supplied"
set_fact: ansible.builtin.set_fact:
atl_download_version: "{{ atl_cached_version }}" atl_download_version: "{{ atl_cached_version }}"
when: cached.stat.exists and when: cached.stat.exists and
atl_product_normalised_version is version(atl_cached_normalised_version, '<=') and atl_product_normalised_version is version(atl_cached_normalised_version, '<=') and
@@ -104,23 +104,22 @@
- name: "Fallthrough guard: Use cached or supplied version if nothing set" - name: "Fallthrough guard: Use cached or supplied version if nothing set"
set_fact: ansible.builtin.set_fact:
atl_download_version: "{{ atl_cached_version or atl_product_version }}" atl_download_version: "{{ atl_cached_version or atl_product_version }}"
when: atl_download_version is not defined or when: atl_download_version is not defined or
atl_download_version|length == 0 atl_download_version|length == 0
- name: Override the supplied version with the calculated one - name: Override the supplied version with the calculated one
set_fact: ansible.builtin.set_fact:
atl_product_version: "{{ atl_download_version }}" atl_product_version: "{{ atl_download_version }}"
###################################################################### ######################################################################
- name: Perform any additional per-edition version setup - name: Perform any additional per-edition version setup
include_tasks: "{{ atl_product_edition }}_extra_tasks.yml" ansible.builtin.include_tasks: "{{ atl_product_edition }}_extra_tasks.yml"
- name: Create installation directories - name: Create installation directories
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
mode: 0750 mode: 0750
@@ -136,7 +135,7 @@
# At this point atl_product_version should be set, cache if necessary. # At this point atl_product_version should be set, cache if necessary.
- name: Write override cached version when specified - name: Write override cached version when specified
template: ansible.builtin.template:
src: version.j2 src: version.j2
dest: "{{ atl_product_version_cache }}" dest: "{{ atl_product_version_cache }}"
force: true force: true
@@ -148,25 +147,25 @@
# a directory is used as a lockfile (atomic operation) when moving binary. # a directory is used as a lockfile (atomic operation) when moving binary.
- name: Set assumptions to avoid race condition - name: Set assumptions to avoid race condition
set_fact: ansible.builtin.set_fact:
download_binary: true download_binary: true
move_binary: false move_binary: false
atl_product_download: "{{ atl_product_temp_download }}" atl_product_download: "{{ atl_product_temp_download }}"
# Check for pre-downloaded binary on shared_home and completed lock dir. # Check for pre-downloaded binary on shared_home and completed lock dir.
- name: Check for completed lock directory - name: Check for completed lock directory
stat: ansible.builtin.stat:
path: "{{ atl_product_home_shared_completed_lock }}" path: "{{ atl_product_home_shared_completed_lock }}"
register: completed_lock register: completed_lock
- name: Check for product installer in home_shared - name: Check for product installer in home_shared
stat: ansible.builtin.stat:
path: "{{ atl_product_home_shared_download }}" path: "{{ atl_product_home_shared_download }}"
register: home_shared_download register: home_shared_download
# If binary exists and lockdir exists use this binary instead # If binary exists and lockdir exists use this binary instead
- name: Check lock directory and binary exists on shared_home - name: Check lock directory and binary exists on shared_home
set_fact: ansible.builtin.set_fact:
download_binary: false download_binary: false
atl_product_download: "{{ atl_product_home_shared_download }}" atl_product_download: "{{ atl_product_home_shared_download }}"
when: when:
@@ -180,7 +179,7 @@
# Fetch binary and copy to temp # Fetch binary and copy to temp
- name: Fetch binary - name: Fetch binary
get_url: ansible.builtin.get_url:
url: "{{ atl_product_download_url }}" url: "{{ atl_product_download_url }}"
dest: "{{ atl_product_temp_download }}" dest: "{{ atl_product_temp_download }}"
mode: 0755 mode: 0755
@@ -189,7 +188,7 @@
# If product installer was fetched make the lock directory # If product installer was fetched make the lock directory
- name: Create moving_lock. - name: Create moving_lock.
file: ansible.builtin.file:
path: "{{ atl_product_home_shared_moving_lock }}" path: "{{ atl_product_home_shared_moving_lock }}"
state: directory state: directory
when: when:
@@ -199,7 +198,7 @@
# Directory lock was created by this run? # Directory lock was created by this run?
# If so, then set a fact intending to move binary # If so, then set a fact intending to move binary
- name: Move binary Scenario - lock created by this run - name: Move binary Scenario - lock created by this run
set_fact: ansible.builtin.set_fact:
move_binary: true move_binary: true
when: when:
- moving_lock_created is succeeded - moving_lock_created is succeeded
@@ -214,7 +213,7 @@
block: block:
- name: Copy temp installer to home_shared - name: Copy temp installer to home_shared
copy: ansible.builtin.copy:
src: "{{ atl_product_temp_download }}" src: "{{ atl_product_temp_download }}"
dest: "{{ atl_product_home_shared_download }}" dest: "{{ atl_product_home_shared_download }}"
remote_src: true remote_src: true
@@ -224,14 +223,14 @@
register: copied register: copied
- name: Create completed_lock once product installer downloaded and copied - name: Create completed_lock once product installer downloaded and copied
file: ansible.builtin.file:
path: "{{ atl_product_home_shared_completed_lock }}" path: "{{ atl_product_home_shared_completed_lock }}"
state: directory state: directory
when: copied is succeeded when: copied is succeeded
register: completed_lock_created register: completed_lock_created
- name: Remove moving_lock to show that binary is completed - name: Remove moving_lock to show that binary is completed
file: ansible.builtin.file:
path: "{{ atl_product_home_shared_moving_lock }}" path: "{{ atl_product_home_shared_moving_lock }}"
state: absent state: absent
when: when:
@@ -240,14 +239,14 @@
register: moving_lock_removed register: moving_lock_removed
- name: Delete old temp installer - name: Delete old temp installer
file: ansible.builtin.file:
path: "{{ atl_product_temp_download }}" path: "{{ atl_product_temp_download }}"
state: absent state: absent
when: moving_lock_removed is succeeded when: moving_lock_removed is succeeded
register: temp_deleted register: temp_deleted
- name: Set install to home_shared location - name: Set install to home_shared location
set_fact: ansible.builtin.set_fact:
atl_product_download: "{{ atl_product_home_shared_download }}" atl_product_download: "{{ atl_product_home_shared_download }}"
when: temp_deleted is succeeded when: temp_deleted is succeeded
@@ -256,17 +255,17 @@
# At this point the binary is in {{ atl_product_download }} # At this point the binary is in {{ atl_product_download }}
# (which is either on home_shared or temp) # (which is either on home_shared or temp)
- name: Unpack the downloaded application depending on format - name: Unpack the downloaded application depending on format
include_tasks: "unpack_{{ atl_download_format }}.yml" ansible.builtin.include_tasks: "unpack_{{ atl_download_format }}.yml"
- name: Symlink the installed version to current - name: Symlink the installed version to current
file: ansible.builtin.file:
src: "{{ atl_product_installation_versioned }}" src: "{{ atl_product_installation_versioned }}"
dest: "{{ atl_product_installation_current }}" dest: "{{ atl_product_installation_current }}"
state: link state: link
force: true force: true
- name: "Ensure catalina.out log dir exists after product is installed (except bitbucket)" - name: "Ensure catalina.out log dir exists after product is installed (except bitbucket)"
file: ansible.builtin.file:
path: "{{ atl_product_installation_current }}/logs" path: "{{ atl_product_installation_current }}/logs"
state: directory state: directory
mode: 0750 mode: 0750
@@ -276,5 +275,5 @@
changed_when: false # For Molecule idempotence check changed_when: false # For Molecule idempotence check
- name: Include if jsd is requested to be installed from OBR - name: Include if jsd is requested to be installed from OBR
include_tasks: "jira-servicedesk_as_obr.yml" ansible.builtin.include_tasks: "jira-servicedesk_as_obr.yml"
when: atl_install_jsd_as_obr when: atl_install_jsd_as_obr

View File

@@ -5,9 +5,9 @@
# product that supports the standard marketplace API. # product that supports the standard marketplace API.
- name: Fetch the latest version from URL - name: Fetch the latest version from URL
set_fact: ansible.builtin.set_fact:
atl_product_version_json: "{{ lookup('url', '{{ atl_product_latest_version_url }}') }}" atl_product_version_json: "{{ lookup('url', '{{ atl_product_latest_version_url }}') }}"
- name: Set the local var to retrieved version - name: Set the local var to retrieved version
set_fact: ansible.builtin.set_fact:
atl_latest_version: "{{ atl_product_version_json._embedded.versions[0].name }}" atl_latest_version: "{{ atl_product_version_json._embedded.versions[0].name }}"

View File

@@ -1,7 +1,7 @@
--- ---
- name: Create installer varfile - name: Create installer varfile
template: ansible.builtin.template:
src: "{{ atl_product_family }}.varfile.j2" src: "{{ atl_product_family }}.varfile.j2"
dest: "{{ atl_product_varfile }}" dest: "{{ atl_product_varfile }}"
mode: 0755 mode: 0755
@@ -13,7 +13,7 @@
# The variable {{ atl_product_download }} will be on temp for first nodes and shared_home for # The variable {{ atl_product_download }} will be on temp for first nodes and shared_home for
# subsequent nodes. # subsequent nodes.
- name: Run the installer - name: Run the installer
command: /bin/sh "{{ atl_product_download }}" -q -varfile "{{ atl_product_varfile }}" ansible.builtin.command: /bin/sh "{{ atl_product_download }}" -q -varfile "{{ atl_product_varfile }}"
args: args:
creates: "{{ atl_product_installation_versioned }}/.install4j/" creates: "{{ atl_product_installation_versioned }}/.install4j/"
become: true become: true

View File

@@ -1,7 +1,7 @@
--- ---
- name: Unpack the product packages - name: Unpack the product packages
unarchive: ansible.builtin.unarchive:
remote_src: true remote_src: true
src: "{{ atl_product_download }}" src: "{{ atl_product_download }}"
dest: "{{ atl_product_installation_versioned }}" dest: "{{ atl_product_installation_versioned }}"

View File

@@ -1,7 +1,7 @@
--- ---
- name: Restart Product - name: Restart Product
service: ansible.builtin.service:
name: "{{ atl_systemd_service_name }}" name: "{{ atl_systemd_service_name }}"
state: restarted state: restarted
when: when:
@@ -10,7 +10,7 @@
no_log: true no_log: true
- name: Enable Product - name: Enable Product
service: ansible.builtin.service:
name: "{{ atl_systemd_service_name }}" name: "{{ atl_systemd_service_name }}"
enabled: true enabled: true
when: when:

View File

@@ -27,7 +27,7 @@
pre_tasks: pre_tasks:
- name: Create systemd dir if necessary - name: Create systemd dir if necessary
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
with_items: with_items:

View File

@@ -10,7 +10,7 @@
pre_tasks: pre_tasks:
- name: Create systemd dir if necessary - name: Create systemd dir if necessary
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
with_items: with_items:
@@ -21,17 +21,17 @@
- role: product_startup - role: product_startup
post_tasks: post_tasks:
- include_vars: ../../defaults/main.yml - ansible.builtin.include_vars: ../../defaults/main.yml
# workaround Molecule idempotence check # workaround Molecule idempotence check
# normal pattern of setting changed_when allows file to be written twice, which takes extra time # normal pattern of setting changed_when allows file to be written twice, which takes extra time
- name: Check if vars have already been dumped - name: Check if vars have already been dumped
stat: ansible.builtin.stat:
path: "{{ ansible_vars_dump_location }}" path: "{{ ansible_vars_dump_location }}"
register: ansible_vars_stat_result register: ansible_vars_stat_result
- name: Dump vars to file for inspection - name: Dump vars to file for inspection
copy: ansible.builtin.copy:
content: | content: |
{{ vars | to_nice_yaml }} {{ vars | to_nice_yaml }}
dest: "{{ ansible_vars_dump_location }}" dest: "{{ ansible_vars_dump_location }}"

View File

@@ -10,17 +10,17 @@
ansible_vars_dump_location: "/tmp/ansible-vars.yml" ansible_vars_dump_location: "/tmp/ansible-vars.yml"
tasks: tasks:
- include_vars: ../../defaults/main.yml - ansible.builtin.include_vars: ../../defaults/main.yml
# workaround Molecule idempotence check # workaround Molecule idempotence check
# normal pattern of setting changed_when allows file to be written twice, which takes extra time # normal pattern of setting changed_when allows file to be written twice, which takes extra time
- name: Check if vars have already been dumped - name: Check if vars have already been dumped
stat: ansible.builtin.stat:
path: "{{ ansible_vars_dump_location }}" path: "{{ ansible_vars_dump_location }}"
register: ansible_vars_stat_result register: ansible_vars_stat_result
- name: Dump vars to file for inspection - name: Dump vars to file for inspection
copy: ansible.builtin.copy:
content: | content: |
{{ vars | to_nice_yaml }} {{ vars | to_nice_yaml }}
dest: "{{ ansible_vars_dump_location }}" dest: "{{ ansible_vars_dump_location }}"

View File

@@ -19,7 +19,7 @@
pre_tasks: pre_tasks:
- name: Create systemd dir if necessary - name: Create systemd dir if necessary
file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"
state: directory state: directory
with_items: with_items:

View File

@@ -1,7 +1,7 @@
--- ---
- name: "Install systemd service file" - name: "Install systemd service file"
template: ansible.builtin.template:
src: "product.service.j2" src: "product.service.j2"
dest: "{{ atl_systemd_service_dir }}/{{ atl_systemd_service_name }}" dest: "{{ atl_systemd_service_dir }}/{{ atl_systemd_service_name }}"
owner: root owner: root

View File

@@ -1,14 +1,14 @@
--- ---
- name: Install the startup wrapper script - name: Install the startup wrapper script
copy: ansible.builtin.copy:
src: start-synchrony src: start-synchrony
dest: "{{ atl_product_installation_current }}/bin/start-synchrony" dest: "{{ atl_product_installation_current }}/bin/start-synchrony"
group: "{{ atl_product_user }}" group: "{{ atl_product_user }}"
mode: "0750" mode: "0750"
- name: Install the Synchrony environment settings - name: Install the Synchrony environment settings
template: ansible.builtin.template:
src: "atl.synchrony.j2" src: "atl.synchrony.j2"
dest: "/etc/atl.synchrony" dest: "/etc/atl.synchrony"
group: "{{ atl_product_user }}" group: "{{ atl_product_user }}"