Skip to content

Commit

Permalink
Execute only percona role in upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
replaceafill committed Oct 14, 2024
1 parent be3da18 commit c14c01b
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 87 deletions.
61 changes: 0 additions & 61 deletions playbooks/archivematica-jammy/vars-singlenode-1.16.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,11 @@
archivematica_src_am_version: "stable/1.16.x"
archivematica_src_ss_version: "stable/0.22.x"

archivematica_src_ss_db_name: "SS"
archivematica_src_ss_db_user: "ss"
archivematica_src_ss_db_password: "demo"
archivematica_src_ss_db_host: "{{ archivematica_src_am_db_host }}"

archivematica_src_configure_dashboard: "yes"
archivematica_src_configure_ss: "yes"
archivematica_src_configure_ss_user: "admin"
archivematica_src_configure_ss_password: "archivematica"
archivematica_src_configure_ss_api_key: "this_is_the_ss_api_key"
archivematica_src_configure_ss_url: "http://192.168.168.198:8000"
archivematica_src_configure_ss_email: "[email protected]"
archivematica_src_configure_am_user: "admin"
archivematica_src_configure_am_password: "archivematica"
archivematica_src_configure_am_email: "[email protected]"
archivematica_src_configure_am_api_key: "this_is_the_am_api_key"
archivematica_src_configure_am_site_url: "http://192.168.168.198"

nodejs_version: "22.x"

# elasticsearch role

elasticsearch_version: "6.5.4"
elasticsearch_apt_java_package: "openjdk-8-jre-headless"
elasticsearch_java_home: "/usr/lib/jvm/java-1.8.0-openjdk-amd64"
elasticsearch_heap_size: "1g"
elasticsearch_max_open_files: "65535"
elasticsearch_timezone: "UTC"
elasticsearch_node_max_local_storage_nodes: "1"
elasticsearch_index_mapper_dynamic: "true"
elasticsearch_memory_bootstrap_mlockall: "true"
elasticsearch_install_java: "true"
elasticsearch_thread_pools:
- "thread_pool.write.size: 2"
- "thread_pool.write.queue_size: 1000"
elasticsearch_network_http_max_content_lengtht: 1024mb
elasticsearch_discovery_zen_ping_multicast_enabled: "false"
elasticsearch_max_locked_memory: "unlimited"
elasticsearch_network_host: "127.0.0.1"

# percona role

mysql_version_major: "8"
mysql_version_minor: "0"
mysql_character_set_server: "utf8mb4"
mysql_collation_server: "utf8mb4_0900_ai_ci"

mysql_databases:
- name: "{{ archivematica_src_am_db_name }}"
collation: "{{ archivematica_src_am_db_collation }}"
encoding: "{{ archivematica_src_am_db_encoding }}"
- name: "{{ archivematica_src_ss_db_name }}"
collation: "{{ archivematica_src_ss_db_collation }}"
encoding: "{{ archivematica_src_ss_db_encoding }}"

mysql_users:
- name: "{{ archivematica_src_am_db_user }}"
pass: "{{ archivematica_src_am_db_password }}"
priv: "{{ archivematica_src_am_db_name }}.*:ALL,GRANT"
host: "{{ archivematica_src_am_db_host }}"
- name: "{{ archivematica_src_ss_db_user }}"
pass: "{{ archivematica_src_ss_db_password }}"
priv: "{{ archivematica_src_ss_db_name }}.*:ALL,GRANT"
host: "{{ archivematica_src_ss_db_host }}"

mysql_root_password: "MYSQLROOTPASSWORD"

archivematica_src_ss_environment:
SS_DB_URL: "mysql://{{ archivematica_src_ss_db_user }}:{{ archivematica_src_ss_db_password }}@{{ archivematica_src_ss_db_host }}:3306/{{ archivematica_src_ss_db_name }}"
106 changes: 80 additions & 26 deletions tests/archivematica-upgrade/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,95 @@
- "fish"
become: "yes"

roles:

- role: "artefactual.elasticsearch"
tasks:
- name: "Block"
become: "yes"
tags:
- "elasticsearch"
when: "archivematica_src_search_enabled|bool"
block:
- name: "Install gnupg"
apt:
name: gnupg2
update_cache: yes

- role: "artefactual.percona"
become: "yes"
tags:
- "percona"
- name: "Install percona-release package"
apt:
deb: "https://repo.percona.com/apt/percona-release_latest.{{ ansible_distribution_release }}_all.deb"

- role: "artefactual.nginx"
become: "yes"
tags:
- "nginx"
- name: "Update apt cache"
apt:
update_cache: yes

- role: "artefactual.gearman"
become: "yes"
tags:
- "gearman"
# https://www.percona.com/doc/percona-server/LATEST/installation/apt_repo.html
- name: "Enable Percona repository (Percona version >= 8)"
command: "percona-release setup ps{{ mysql_version_major }}{{ mysql_version_minor }}"
when: mysql_version_major|int >= 8
changed_when: False # TODO: check for task idempotency

- role: "artefactual.clamav"
become: "yes"
tags:
- "clamav"
- name: "Install python-is-python3 (Ubuntu >= Focal/20.04)"
apt:
name: "python-is-python3"
when:
- ansible_distribution_version is version_compare('20.04', '>=')

- role: "artefactual.archivematica-src"
become: "yes"
tags:
- "archivematica-src"
- debug:
msg: "ansible_python_interpreter major version: {{ ansible_python.version.major }}"

- name: "Install package dependencies for ansible MySQL modules (python 2)"
apt:
name: "python-mysqldb"
when:
- ansible_python.version.major == 2 # version is a number, do not quote

- name: "Install package dependencies for ansible MySQL modules (python 3)"
apt:
name:
- "python3-pymysql"
- "python3-mysqldb"
when:
- ansible_python.version.major == 3 # version is a number, do not quote

- name: "Install percona packages and dependencies on Ubuntu (Percona version < 8)"
apt:
name:
- "percona-server-server-{{ mysql_version_major }}.{{ mysql_version_minor }}"
- "percona-server-client-{{ mysql_version_major }}.{{ mysql_version_minor }}"
- "percona-toolkit"
state: "present"
when: mysql_version_major|int < 8

- name: "Install | configure debconf for version 8.0 (Use Legacy Authentication Method)"
debconf:
name: 'percona-server-server'
question: 'percona-server-server/default-auth-override'
value: 'Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)'
vtype: select
changed_when: false
when:
- mysql_version_major|int >= 8
- mysql_default_authentication_plugin is defined
- mysql_default_authentication_plugin == "mysql_native_password"

- name: "Install percona packages and dependencies on Ubuntu (Percona version >= 8)"
apt:
name:
- "percona-server-server={{ mysql_version_major }}.{{ mysql_version_minor }}*"
- "percona-server-client={{ mysql_version_major }}.{{ mysql_version_minor }}*"
- "percona-toolkit"
state: "present"
when: mysql_version_major|int >= 8

- name: "Adjust permissions of datadir"
file:
path: "/var/lib/mysql"
owner: "mysql"
group: "mysql"
mode: 0700
state: "directory"

post_tasks:

- name: Flush handlers
meta: flush_handlers

- name: "change home dir perms (to make transfer source visible)"
become: "no"
command: "chmod 755 $HOME"
Expand Down

0 comments on commit c14c01b

Please sign in to comment.