Skip to content

Commit

Permalink
PMM-7 Remove RHEL 7 build-related leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Dec 6, 2024
1 parent 89a9ffd commit ce40a8f
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 277 deletions.
25 changes: 0 additions & 25 deletions build/ansible/pmm2/post-build-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@
--server-address=127.0.0.1:443
--server-insecure-tls
- name: Reread supervisord configuration EL7
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
command: supervisorctl reread
register: reread_result
changed_when: "'No config updates to processes' not in reread_result.stdout"

- name: Reread supervisord configuration EL9
when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
command: /usr/local/bin/supervisorctl reread
Expand All @@ -87,13 +81,6 @@
- name: See what services are running
debug: var=reread_result.stdout_lines

- name: Stop pmm-managed before deleting the database EL7
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
supervisorctl:
name: pmm-managed
state: stopped
ignore_errors: True

- name: Stop pmm-managed before deleting the database EL9
when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
supervisorctl:
Expand Down Expand Up @@ -129,14 +116,6 @@
ignore_errors: yes
when: not pmm_running_in_docker

- name: Remove pmm-managed database EL7
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
postgresql_db:
login_user: postgres
name: pmm-managed
state: absent
register: db_check_result

- name: Remove pmm-managed database EL9
when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
postgresql_db:
Expand Down Expand Up @@ -168,10 +147,6 @@
when: not pmm_running_in_docker
service: name=supervisord state=stopped enabled=yes

- name: Supervisord stop EL7 | Stop supervisord service for docker
when: pmm_running_in_docker and ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
shell: supervisorctl shutdown

- name: Supervisord stop EL9 | Stop supervisord service for docker
when: pmm_running_in_docker and (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
shell: /usr/local/bin/supervisorctl shutdown
Expand Down
35 changes: 0 additions & 35 deletions build/ansible/roles/ami-ovf/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
- name: Packages | Clean up yum metadata
command: yum clean metadata

- name: Packages | Add PMM2 Server release repository for EL7
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'
yum_repository:
name: pmm2-server
description: PMM Server YUM repository - x86_64
baseurl: https://repo.percona.com/pmm2-components/yum/release/7/RPMS/x86_64/
gpgcheck: yes
enabled: yes
gpgkey: file:///etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY

- name: Packages | Add PMM2 Server release repository for EL9
when:
- ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux'
Expand All @@ -31,14 +19,6 @@
enabled: yes
gpgkey: file:///etc/pki/rpm-gpg/PERCONA-PACKAGING-KEY

- name: Disable SELinux | EL7
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'
selinux:
policy: targeted
state: permissive

- name: Disable SELinux | EL9
when:
- ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux'
Expand All @@ -49,15 +29,6 @@
policy: targeted
state: permissive

- name: Add firewalld rule | EL7
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'
firewalld: port={{ item }} permanent=true state=enabled immediate=yes
with_items:
- 80/tcp
- 443/tcp

- name: Add firewalld rule | EL9
when:
- ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux'
Expand Down Expand Up @@ -86,12 +57,6 @@
- ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux'
- ansible_distribution_major_version == '9'

- name: PMM | Delete centos EL7
shell: cd /tmp; nohup sh -c "trap 'userdel -r centos' EXIT; sleep 600" </dev/null >/dev/null 2>&1 &
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'

- name: PMM | Delete ec2-user EL9
shell: cd /tmp; nohup sh -c "trap 'userdel -r ec2-user' EXIT; sleep 600" </dev/null >/dev/null 2>&1 &
when:
Expand Down
38 changes: 0 additions & 38 deletions build/ansible/roles/cloud-node/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
---
# Common things for all cloud images
- name: Packages | Add EPEL repository for EL7
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'
yum:
name: https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm
state: installed

- name: Packages | Add EPEL repository for EL9
when:
- ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux'
Expand All @@ -16,19 +8,6 @@
name: epel-release
state: installed

- name: Packages | Install OS tools for EL7
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'
yum:
name:
- screen
- yum-utils
- cloud-init
- firewalld
- python2-pip
- ansible

- name: Packages | Install OS tools for EL9
when:
- (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
Expand All @@ -41,16 +20,6 @@
- python3-libselinux
- python3-firewall

- name: Firewalld | Start EL7
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'
- ansible_os_family == 'RedHat'
service:
name: firewalld
state: started
enabled: yes

- name: Firewalld | Start EL9
when:
- ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux'
Expand Down Expand Up @@ -137,13 +106,6 @@
dest: /etc/sudoers.d/90-admin-user
mode: 0440

- name: change cloud user EL7 | Change cloud user
when: create_admin == "true" and ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
replace:
dest: /etc/cloud/cloud.cfg
regexp: "name: centos"
replace: "name: admin"

- name: change cloud user for OVF EL9 | Change cloud user
when:
- create_admin == "true"
Expand Down
8 changes: 0 additions & 8 deletions build/ansible/roles/supervisord-init/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
---
- name: Install supervisor | EL7
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
command: /usr/bin/pip2 install --trusted-host pypi.python.org --trusted-host=files.pythonhosted.org supervisor==3.4.0

- name: Install supervisor | EL9
when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
pip:
Expand All @@ -12,10 +8,6 @@
when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
shell: if [ ! -e /usr/bin/supervisord ]; then ln -s /usr/local/bin/supervisord /usr/bin/supervisord; fi

- name: Configure supervisor EL7 | Create a default configuration file for supervisord
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
shell: echo_supervisord_conf > /etc/supervisord.conf

- name: Configure supervisor EL9 | Create a default configuration file for supervisord
when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
shell: /usr/local/bin/echo_supervisord_conf > /etc/supervisord.conf
Expand Down
8 changes: 0 additions & 8 deletions build/scripts/build-client-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ main() {
set -o errexit
set -o xtrace
if grep -q 'CentOS Linux 7' /etc/os-release; then
# disable fastestmirror plugin, which mostly fails due to CentOS 7 being EOL
sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
sed -i -e 's/^\(mirrorlist\)/#\1/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i -e 's|^#baseurl.*|baseurl=http://vault.centos.org/centos/\$releasever/os/\$basearch/|g' /etc/yum.repos.d/CentOS-Base.repo
fi
export pmm_version=$pmm_version
export pmm_release=$pmm_release
export sudo_path=\$(ls /usr/bin/sudo)
Expand Down
10 changes: 1 addition & 9 deletions build/scripts/build-client-srpm
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,12 @@ main() {
set -o errexit
set -o xtrace
if grep -q 'CentOS Linux 7' /etc/os-release; then
# disable fastestmirror plugin, which mostly fails due to CentOS 7 being EOL
sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
sed -i -e 's/^\(mirrorlist\)/#\1/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i -e 's|^#baseurl.*|baseurl=http://vault.centos.org/centos/\$releasever/os/\$basearch/|g' /etc/yum.repos.d/CentOS-Base.repo
fi
export pmm_release=$pmm_release
export sudo_path=
if [ -e /usr/bin/sudo ]; then
export sudo_path=\$(ls /usr/bin/sudo)
fi
[[ ${IMAGE} = ${rpmbuild_docker_image} ]] || \$sudo_path yum -y install git rpm-build
mkdir -p /tmp/pmm
pushd /home/builder/results
/home/builder/bin/build-client-packages \
Expand Down
8 changes: 0 additions & 8 deletions build/scripts/build-server-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@ build() {
echo \"repo_name: ${repo_name}\"
echo \"rpm_verison: ${rpm_version}\"
if grep -q 'CentOS Linux 7' /etc/os-release; then
# disable fastestmirror plugin, which mostly fails due to CentOS 7 being EOL
sudo sed -i 's/enabled=1/enabled=0/g' /etc/yum/pluginconf.d/fastestmirror.conf
sudo sed -i -e 's/^\(mirrorlist\)/#\1/g' /etc/yum.repos.d/CentOS-Base.repo
sudo sed -i -e 's|^#baseurl.*|baseurl=http://vault.centos.org/centos/\$releasever/os/\$basearch/|g' /etc/yum.repos.d/CentOS-Base.repo
fi
sudo chown -R builder:builder /home/builder/rpm/RPMS /home/builder/rpm/SOURCES
# Add 'Epoch' to spec file to prevent update of rpms which are built in PR build
Expand Down
15 changes: 0 additions & 15 deletions update/ansible/playbook/tasks/roles/clickhouse/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
---
- name: Stop and remove clickhouse before update | EL7
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'
command: supervisorctl {{ item }} clickhouse
changed_when: True
loop:
- stop
- remove

- name: Find supervisord's socket
stat:
path: /var/run/supervisor/supervisor.sock
Expand Down Expand Up @@ -107,8 +97,3 @@
loop:
- present
- started

- name: Start clickhouse EL7
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
command: supervisorctl add clickhouse
changed_when: True
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@

- name: Remove old dashboards from SQLite
block:
- name: Restart grafana before deleting data EL7
supervisorctl:
name: grafana
state: stopped
become: true
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
ignore_errors: true

- name: Restart grafana before deleting data EL9
supervisorctl:
name: grafana
Expand Down Expand Up @@ -108,16 +100,6 @@
shell: grafana cli --pluginsDir /srv/grafana/plugins plugins remove vertamedia-clickhouse-datasource || true
when: not ansible_check_mode

- name: Restart grafana with new plugins EL7
supervisorctl:
name: grafana
state: restarted
become: true
ignore_errors: true
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
# TODO: fix the race condition.
# We generate grafana supervisor config in pmm-managed and it may not exist at this stage

- name: Restart grafana with new plugins EL9
supervisorctl:
name: grafana
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@
owner: root
group: pmm

- name: Restart clickhouse EL7
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
command: supervisorctl restart clickhouse
become: true
changed_when: true

- name: Restart clickhouse EL9
when: (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
command: /usr/local/bin/supervisorctl restart clickhouse
Expand Down
11 changes: 0 additions & 11 deletions update/ansible/playbook/tasks/roles/nginx/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
---
# We already have nginx package in epel repo
- name: Add Nginx repository for RHEL7
when:
- ansible_distribution == 'CentOS'
- ansible_distribution_major_version == '7'
yum_repository:
name: nginx
description: nginx repo
baseurl: http://nginx.org/packages/centos/7/$basearch/
gpgcheck: no
enabled: no

- name: Add Nginx repository for RHEL9
when:
- ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux'
Expand Down
35 changes: 0 additions & 35 deletions update/ansible/playbook/tasks/roles/postgres/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,6 @@
path: /var/run/supervisor/supervisor.sock
register: is_upgrade

- name: Stop pmm-managed and postgres before backup database | EL7
supervisorctl:
name: "{{ item }}"
state: stopped
loop:
- pmm-managed
- postgresql
become: true
when:
- is_upgrade.stat.exists
- ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'

- name: Stop pmm-managed and postgres before backup database | EL9
supervisorctl:
name: "{{ item }}"
Expand Down Expand Up @@ -217,25 +205,11 @@
state: absent
when: is_upgrade.stat.exists

- name: Reread supervisord configuration EL7
when: is_upgrade.stat.exists and ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'
command: supervisorctl reread

- name: Reread supervisord configuration EL9
when: is_upgrade.stat.exists and (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'
command: /usr/local/bin/supervisorctl reread
become: true

- name: Restart Postgres | EL7
command: supervisorctl {{ item }} postgresql
changed_when: True
become: true
loop:
- stop
- remove
- add
when: is_upgrade.stat.exists and ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'

- name: Restart Postgres | EL9
command: /usr/local/bin/supervisorctl {{ item }} postgresql
changed_when: True
Expand All @@ -246,15 +220,6 @@
- add
when: is_upgrade.stat.exists and (ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux') and ansible_distribution_major_version == '9'

- name: Run pmm-managed again | EL7
supervisorctl:
name: pmm-managed
state: started
become: true
when:
- is_upgrade.stat.exists
- ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7'

- name: Run pmm-managed again | EL9
supervisorctl:
name: pmm-managed
Expand Down
Loading

0 comments on commit ce40a8f

Please sign in to comment.