Skip to content

Commit 5383f36

Browse files
adding changes for pxb 9x
updating versions
1 parent 6803cbb commit 5383f36

16 files changed

Lines changed: 1249 additions & 7 deletions

File tree

VERSIONS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ REPO_VER="1.0-25"
6868
PS_INN_LTS_VER="9.2.0-1"
6969
PS_INN_LTS_REV="f02c4125"
7070
PS_INN_LTS_REPO="ps-9x-innovation"
71-
PXB_INN_LTS_VER="8.3.0-1"
71+
PXB_INN_LTS_VER="9.1.0"
7272
PXB_INN_LTS_REV="fcee26ff"
7373
PXB_INN_LTS_REPO="pxb-8x-innovation"
74-
PXB_INN_LTS_MAJ_VER="8.3.0"
74+
PXB_INN_LTS_MAJ_VER="9.1.0"
7575
PXB_INN_LTS_PKG_VER="1"
7676
PXC_INN_LTS_VER="9.2.0-1"
7777
PXC_INN_LTS_INNODB="1"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
driver:
5+
name: ec2
6+
platforms:
7+
- name: ujammy-${BUILD_NUMBER}-${JOB_NAME}-${PLAYBOOK_VAR}
8+
region: us-west-2
9+
image: ami-0ee8244746ec5d6d4
10+
vpc_subnet_id: subnet-03136d8c244f56036
11+
instance_type: t2.medium
12+
ssh_user: ubuntu
13+
root_device_name: /dev/sda1
14+
instance_tags:
15+
iit-billing-tag: pxb-9x-testing
16+
job-name: ${JOB_NAME}
17+
provisioner:
18+
name: ansible
19+
log: True
20+
playbooks:
21+
create: ../../playbooks/create_noble.yml
22+
# destroy: ../../playbooks/destroy_noble.yml
23+
prepare: ../../playbooks/prepare.yml
24+
cleanup: ../../playbooks/cleanup.yml
25+
converge: ../../../../playbooks/pxb_9x.yml
26+
scenario:
27+
name: ubuntu-jammy
28+
# destroy_sequence:
29+
# - destroy
30+
cleanup_sequence:
31+
- cleanup
32+
test_sequence:
33+
# - destroy
34+
- create
35+
- prepare
36+
- converge
37+
- cleanup
38+
# - destroy
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
- name: Cleanup
3+
hosts: all
4+
become: true
5+
become_method: sudo
6+
vars:
7+
WORKSPACE_VAR: "{{ lookup('env', 'WORKSPACE_VAR') }}"
8+
tasks:
9+
- name: PRINT WORKSPACE_VAR
10+
debug:
11+
msg: "WORKSPACE_VAR: {{ WORKSPACE_VAR }}"
12+
13+
- name: Check if mysqld.log exists
14+
stat:
15+
path: /var/log/mysqld.log
16+
register: mysqld_log
17+
18+
- name: Check if mysql error log exists
19+
stat:
20+
path: /var/log/mysql/error.log
21+
register: mysql_error_log
22+
23+
- name: Create a temporary directory for zipping logs
24+
file:
25+
path: /var/tmp/mysql_logs
26+
state: directory
27+
mode: '0755'
28+
when:
29+
- mysqld_log.stat.exists or mysql_error_log.stat.exists
30+
31+
- name: Copy mysqld.log to temporary directory if it exists
32+
shell: cp /var/log/mysqld.log /var/tmp/mysql_logs/mysqld.log
33+
when: mysqld_log.stat.exists
34+
35+
- name: Copy mysql error log to temporary directory if it exists
36+
shell: cp /var/log/mysql/error.log /var/tmp/mysql_logs/error.log
37+
when: mysql_error_log.stat.exists
38+
39+
- name: Zip the log files if any exist
40+
archive:
41+
path: /var/tmp/mysql_logs
42+
dest: /var/tmp/mysql_logs.zip
43+
format: zip
44+
when:
45+
- mysqld_log.stat.exists or mysql_error_log.stat.exists
46+
##
47+
48+
- name: Get the arch value from /etc/os-release
49+
shell: uname -m
50+
register: arch_output
51+
52+
- name: Replace spaces with dashes in arch_output
53+
set_fact:
54+
arch_output: "{{ arch_output.stdout | trim }}"
55+
56+
##
57+
- name: Get the PRETTY_NAME value from /etc/os-release
58+
shell: |
59+
grep '^PRETTY_NAME=' /etc/os-release | cut -d'=' -f2 | tr -d '"'
60+
register: pretty_name_output
61+
62+
- name: Replace spaces with dashes in PRETTY_NAME
63+
set_fact:
64+
os_id: "{{ pretty_name_output.stdout | replace(' ', '-') | trim }}"
65+
66+
- name: Debug the arch_output
67+
debug:
68+
msg: "The arch_output is {{ arch_output }}"
69+
70+
- name: Debug the OS ID
71+
debug:
72+
msg: "The OS ID is {{ os_id }}"
73+
74+
- name: Fetch the logs archive on localhost
75+
fetch:
76+
src: /var/tmp/mysql_logs.zip
77+
dest: "/{{ WORKSPACE_VAR }}/{{ ansible_hostname }}_{{ os_id }}_{{ arch_output }}_mysql_logs.zip"
78+
flat: yes
79+
become: true
80+
81+
- name: Debug the fetch task status on localhost
82+
command: ls -l "/{{ WORKSPACE_VAR }}"
83+
register: fetch_list
84+
delegate_to: localhost
85+
86+
- name: Debug the list of files in /{{ WORKSPACE_VAR }} on localhost
87+
debug:
88+
msg: "Files in /{{ WORKSPACE_VAR }}: {{ fetch_list.stdout_lines }}"
89+
delegate_to: localhost
90+
91+
- name: remove Tarball directories
92+
file:
93+
path: "{{ paths }}"
94+
state: absent
95+
vars:
96+
paths:
97+
- /tmp/percona-server-{{ lookup('env', 'PS_VERSION') }}.tar.gz
98+
- /tmp/percona-server-{{ lookup('env', 'PS_VERSION') }}-minimal.tar.gz
99+
- /tmp/percona-server-{{ lookup('env', 'PS_VERSION') }}-debug.tar.gz
100+
- /usr/percona-server
101+
- /tmp/percona-server-minimal
102+
- /tmp/percona-server-debug

0 commit comments

Comments
 (0)