diff --git a/aws_slingshot_backup.yml b/aws_slingshot_backup.yml deleted file mode 100644 index f638680..0000000 --- a/aws_slingshot_backup.yml +++ /dev/null @@ -1,13 +0,0 @@ -# Runs atlassian-slingshot to backup your product instance. Should be run when there is only 1 app node (i.e server or single node cluster) -# Params -# Required -# atl_product_family - should be "jira", "confluence", or "stash" -# atl_slingshot_backup_dir - working directory for the backup, should be large enough to fit database and shared home dumps -# atl_s3_backup_bucket - s3 bucket to upload your backup to -# atl_s3_backup_region - AWS region where the s3 bucket is deployed -# -# There are other variables which can be overriden. See the tasks for details. The will be defaulted by the role defaults or the inventory group_vars - -- hosts: aws_node_local - roles: - - role: create_backups \ No newline at end of file diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 98270df..06a83de 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -18,7 +18,7 @@ pipelines: - step: name: Pre Parallelization stage script: - - echo "Running tests in 38 batches" + - echo "Running tests in 37 batches" - step: name: Check if the template is up-to-date @@ -33,30 +33,6 @@ pipelines: fi - parallel: - - step: - name: aws_common/cw-disabled - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/aws_common - - pipenv run molecule test -s cw-disabled - - step: - name: aws_common/default - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/aws_common - - pipenv run molecule test -s default - - step: - name: aws_common/logs-disabled - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/aws_common - - pipenv run molecule test -s logs-disabled - step: name: bitbucket_config/default services: @@ -65,254 +41,6 @@ pipelines: - ./bin/install-ansible --dev - cd roles/bitbucket_config - pipenv run molecule test -s default - - step: - name: confluence_config/aurora - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/confluence_config - - pipenv run molecule test -s aurora - - step: - name: confluence_config/default - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/confluence_config - - pipenv run molecule test -s default - - step: - name: confluence_config/password_char_escaping - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/confluence_config - - pipenv run molecule test -s password_char_escaping - - step: - name: confluence_config/system_jdk - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/confluence_config - - pipenv run molecule test -s system_jdk - - step: - name: create_backups/default - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/create_backups - - pipenv run molecule test -s default - - step: - name: diy_backup/default - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/diy_backup - - pipenv run molecule test -s default - - step: - name: jira_config/aurora - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/jira_config - - pipenv run molecule test -s aurora - - step: - name: jira_config/default - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/jira_config - - pipenv run molecule test -s default - - step: - name: jira_config/jira_config_props - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/jira_config - - pipenv run molecule test -s jira_config_props - - step: - name: jira_config/password_char_escaping - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/jira_config - - pipenv run molecule test -s password_char_escaping - - step: - name: linux_common/default - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/linux_common - - pipenv run molecule test -s default - - step: - name: product_common/default - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_common - - pipenv run molecule test -s default - - step: - name: product_common/system_jdk - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_common - - pipenv run molecule test -s system_jdk - - step: - name: product_install/bitbucket_latest - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s bitbucket_latest - - step: - name: product_install/confluence_latest - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s confluence_latest - - step: - name: product_install/crowd_latest - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s crowd_latest - - step: - name: product_install/default - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s default - - step: - name: product_install/jira_all - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s jira_all - - step: - name: product_install/jira_cached_with_downgrade - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s jira_cached_with_downgrade - - step: - name: product_install/jira_cached_with_upgrade - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s jira_cached_with_upgrade - - step: - name: product_install/jira_software_latest - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s jira_software_latest - - step: - name: product_install/jira_tarball - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s jira_tarball - - step: - name: product_install/jira_version_from_file - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s jira_version_from_file - - step: - name: product_install/jira_version_latest - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s jira_version_latest - - step: - name: product_install/jira_version_override - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s jira_version_override - - step: - name: product_install/servicedesk3 - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s servicedesk3 - - step: - name: product_install/servicedesk4 - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s servicedesk4 - - step: - name: product_install/servicedesk_latest - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_install - - pipenv run molecule test -s servicedesk_latest - - step: - name: product_startup/bitbucket - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_startup - - pipenv run molecule test -s bitbucket - - step: - name: product_startup/default - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_startup - - pipenv run molecule test -s default - - step: - name: product_startup/synchrony - services: - - docker - script: - - ./bin/install-ansible --dev - - cd roles/product_startup - - pipenv run molecule test -s synchrony - step: name: restore_backups/default services: @@ -337,4 +65,268 @@ pipelines: - ./bin/install-ansible --dev - cd roles/restore_backups - pipenv run molecule test -s restore_jira_clustered + - step: + name: diy_backup/default + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/diy_backup + - pipenv run molecule test -s default + - step: + name: product_startup/synchrony + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_startup + - pipenv run molecule test -s synchrony + - step: + name: product_startup/default + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_startup + - pipenv run molecule test -s default + - step: + name: product_startup/bitbucket + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_startup + - pipenv run molecule test -s bitbucket + - step: + name: product_common/default + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_common + - pipenv run molecule test -s default + - step: + name: product_common/system_jdk + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_common + - pipenv run molecule test -s system_jdk + - step: + name: confluence_config/default + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/confluence_config + - pipenv run molecule test -s default + - step: + name: confluence_config/aurora + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/confluence_config + - pipenv run molecule test -s aurora + - step: + name: confluence_config/system_jdk + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/confluence_config + - pipenv run molecule test -s system_jdk + - step: + name: confluence_config/password_char_escaping + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/confluence_config + - pipenv run molecule test -s password_char_escaping + - step: + name: jira_config/default + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/jira_config + - pipenv run molecule test -s default + - step: + name: jira_config/aurora + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/jira_config + - pipenv run molecule test -s aurora + - step: + name: jira_config/jira_config_props + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/jira_config + - pipenv run molecule test -s jira_config_props + - step: + name: jira_config/password_char_escaping + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/jira_config + - pipenv run molecule test -s password_char_escaping + - step: + name: product_install/jira_version_from_file + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s jira_version_from_file + - step: + name: product_install/jira_cached_with_upgrade + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s jira_cached_with_upgrade + - step: + name: product_install/servicedesk4 + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s servicedesk4 + - step: + name: product_install/servicedesk3 + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s servicedesk3 + - step: + name: product_install/jira_software_latest + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s jira_software_latest + - step: + name: product_install/default + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s default + - step: + name: product_install/bitbucket_latest + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s bitbucket_latest + - step: + name: product_install/jira_version_override + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s jira_version_override + - step: + name: product_install/crowd_latest + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s crowd_latest + - step: + name: product_install/servicedesk_latest + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s servicedesk_latest + - step: + name: product_install/jira_version_latest + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s jira_version_latest + - step: + name: product_install/confluence_latest + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s confluence_latest + - step: + name: product_install/jira_cached_with_downgrade + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s jira_cached_with_downgrade + - step: + name: product_install/jira_tarball + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s jira_tarball + - step: + name: product_install/jira_all + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/product_install + - pipenv run molecule test -s jira_all + - step: + name: aws_common/logs-disabled + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/aws_common + - pipenv run molecule test -s logs-disabled + - step: + name: aws_common/cw-disabled + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/aws_common + - pipenv run molecule test -s cw-disabled + - step: + name: aws_common/default + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/aws_common + - pipenv run molecule test -s default + - step: + name: linux_common/default + services: + - docker + script: + - ./bin/install-ansible --dev + - cd roles/linux_common + - pipenv run molecule test -s default diff --git a/roles/create_backups/.yamllint b/roles/create_backups/.yamllint deleted file mode 100644 index 8827676..0000000 --- a/roles/create_backups/.yamllint +++ /dev/null @@ -1,33 +0,0 @@ ---- -# Based on ansible-lint config -extends: default - -rules: - braces: - max-spaces-inside: 1 - level: error - brackets: - max-spaces-inside: 1 - level: error - colons: - max-spaces-after: -1 - level: error - commas: - max-spaces-after: -1 - level: error - comments: disable - comments-indentation: disable - document-start: disable - empty-lines: - max: 3 - level: error - hyphens: - level: error - indentation: disable - key-duplicates: enable - line-length: disable - new-line-at-end-of-file: disable - new-lines: - type: unix - trailing-spaces: disable - truthy: disable diff --git a/roles/create_backups/defaults/main.yml b/roles/create_backups/defaults/main.yml deleted file mode 100644 index f500922..0000000 --- a/roles/create_backups/defaults/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -atl_db_port: 5432 -atl_systemd_service_name: "{{ atl_product_family }}.service" - -atl_slingshot_yum_repo_url: 'https://packages.atlassian.com/atlassian-slingshot-rpm' -atl_amazon_extras_postgresql_version: '9.6' - -atl_slingshot_deb_pubkey_url: 'https://packages.atlassian.com/api/gpg/key/public' -atl_slingshot_deb_repo_url: 'https://packages.atlassian.com/atlassian-slingshot-deb' -atl_slingshot_deb_repo_components: 'stable main' diff --git a/roles/create_backups/molecule/default/Dockerfile.j2 b/roles/create_backups/molecule/default/Dockerfile.j2 deleted file mode 100644 index 0de39e6..0000000 --- a/roles/create_backups/molecule/default/Dockerfile.j2 +++ /dev/null @@ -1,22 +0,0 @@ -# Molecule managed - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -{% if item.env is defined %} -{% for var, value in item.env.items() %} -{% if value %} -ENV {{ var }} {{ value }} -{% endif %} -{% endfor %} -{% endif %} - -RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \ - elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \ - elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ - elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \ - elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ - elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi diff --git a/roles/create_backups/molecule/default/INSTALL.rst b/roles/create_backups/molecule/default/INSTALL.rst deleted file mode 100644 index 6a44bde..0000000 --- a/roles/create_backups/molecule/default/INSTALL.rst +++ /dev/null @@ -1,22 +0,0 @@ -******* -Docker driver installation guide -******* - -Requirements -============ - -* Docker Engine - -Install -======= - -Please refer to the `Virtual environment`_ documentation for installation best -practices. If not using a virtual environment, please consider passing the -widely recommended `'--user' flag`_ when invoking ``pip``. - -.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ -.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site - -.. code-block:: bash - - $ pip install 'molecule[docker]' diff --git a/roles/create_backups/molecule/default/converge.yml b/roles/create_backups/molecule/default/converge.yml deleted file mode 100644 index 34a4c1b..0000000 --- a/roles/create_backups/molecule/default/converge.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Converge - hosts: all - tasks: - # Role default vars must be included because we aren't running the whole role, just a subset of tasks - - name: Include role vars - include_vars: - file: ../../defaults/main.yml - - - name: Install distro-specific backup support packages - include_tasks: "../../tasks/{{ ansible_distribution|lower }}.yml" diff --git a/roles/create_backups/molecule/default/molecule.yml b/roles/create_backups/molecule/default/molecule.yml deleted file mode 100644 index 359433c..0000000 --- a/roles/create_backups/molecule/default/molecule.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -dependency: - name: galaxy -driver: - name: docker -platforms: - - name: amazon_linux2 - image: amazonlinux:2 -# -# Temporarily (1st April 2020) removing ubuntu as a test platform. -# The atlassian-slingshot debian (Ubuntu) repository is at present -# malformed and is currently missing its 'Release' file. As a result -# when this test executes and tries to pull the `ubuntu_lts` archive -# (see ubuntu.yml task) it fails with the following error: -# -# "The repository 'https://packages.atlassian.com/atlassian-slingshot-deb -# stable Release' does not have a Release file." -# -# See: https://bulldog.internal.atlassian.com/browse/DCD-964 which has -# been raised to resolve this issue and fix the Ubuntu Slingshot -# distribution -# -# TODO: Activate the config below (un-comment) once the issue described above -# has been resolved. -# -# - name: ubuntu_lts -# image: ubuntu:bionic -provisioner: - name: ansible -verifier: - name: testinfra diff --git a/roles/create_backups/molecule/default/tests/test_default.py b/roles/create_backups/molecule/default/tests/test_default.py deleted file mode 100644 index 69b0d76..0000000 --- a/roles/create_backups/molecule/default/tests/test_default.py +++ /dev/null @@ -1,11 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_slingshot_installed(host): - assert host.file('/usr/bin/atlassian-slingshot').exists - assert host.file('/usr/bin/psql').exists diff --git a/roles/create_backups/tasks/amazon.yml b/roles/create_backups/tasks/amazon.yml deleted file mode 100644 index 7292a8a..0000000 --- a/roles/create_backups/tasks/amazon.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- - -- name: Add atlassian-slingshot yum repository - yum_repository: - name: AtlassianSlingshot - file: atlassian-slingshot - state: present - description: Atlassian Slingshot - baseurl: "{{ atl_slingshot_yum_repo_url }}" - gpgcheck: no - -- name: Install atlassian-slingshot - yum: - name: atlassian-slingshot - -- name: Enable Postgresql from 'extras' - command: amazon-linux-extras install -y "postgresql{{ atl_amazon_extras_postgresql_version }}" - args: - creates: /usr/bin/psql - environment: - PYTHON: /bin/python diff --git a/roles/create_backups/tasks/main.yml b/roles/create_backups/tasks/main.yml deleted file mode 100644 index b72e274..0000000 --- a/roles/create_backups/tasks/main.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- - -- name: Install distro-specific backup support packages - include_tasks: "{{ ansible_distribution|lower }}.yml" - -- name: Stop the {{ atl_product_family }} service - service: - name: "{{ atl_systemd_service_name }}" - state: stopped - -- name: Run the slingshot backup - command: - argv: - - "atlassian-slingshot" - - "backup" - - "--backupDir" - - "{{ atl_slingshot_backup_dir }}" - - "--dbHost" - - "{{ atl_db_host }}" - - "--dbPort" - - "{{ atl_db_port }}" - - "--dbUser" - - "{{ atl_jdbc_user }}" - - "--dbName" - - "{{ atl_jdbc_db_name }}" - - "--s3BucketName" - - "{{ atl_s3_backup_bucket }}" - - "--awsRegion" - - "{{ atl_s3_backup_region }}" - - "--sharedHomeLocation" - - "{{ atl_product_home_shared }}" - - "--isAutomation" - environment: - ATL_DB_PASSWORD: "{{ atl_jdbc_password }}" - -- name: Restart the {{ atl_product_family }} service - service: - name: "{{ atl_systemd_service_name }}" - state: restarted diff --git a/roles/create_backups/tasks/ubuntu.yml b/roles/create_backups/tasks/ubuntu.yml deleted file mode 100644 index 94476a6..0000000 --- a/roles/create_backups/tasks/ubuntu.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: Install gnupg - apt: - name: gnupg - state: present - -- name: Add atlassian-slingshot debian repo public key - apt_key: - url: "{{ atl_slingshot_deb_pubkey_url }}" - state: present - -- name: Add atlassian-slingshot debian repository - apt_repository: - repo: "deb {{ atl_slingshot_deb_repo_url }} {{ atl_slingshot_deb_repo_components }}" - state: present - filename: atlassian-slingshot - -- name: Install atlassian-slingshot - apt: - name: atlassian-slingshot - update_cache: yes - state: present - -- name: Install postgresql - apt: - name: postgresql - state: present \ No newline at end of file