From 7ff970fd440bd79cd2e302c218c5589d5cb6225f Mon Sep 17 00:00:00 2001 From: Talha Bin Rizwan Date: Mon, 25 Nov 2024 16:46:56 +0500 Subject: [PATCH 1/5] PMM-13567 Fix AMI and OVF builds. --- build/packer/ansible/roles/ami-ovf/tasks/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/packer/ansible/roles/ami-ovf/tasks/main.yml b/build/packer/ansible/roles/ami-ovf/tasks/main.yml index 35b0644261..fa8250bb53 100644 --- a/build/packer/ansible/roles/ami-ovf/tasks/main.yml +++ b/build/packer/ansible/roles/ami-ovf/tasks/main.yml @@ -1,4 +1,11 @@ --- +- name: Update podman.conf + lineinfile: + path: /usr/lib/tmpfiles.d/podman.conf + regexp: '^x /tmp/storage-run-\*' + line: 'R! /tmp/storage-run-*' + backrefs: yes + - name: PMM | Delete ec2-user EL9 shell: cd /tmp; nohup sh -c "trap 'userdel -r ec2-user' EXIT; sleep 600" /dev/null 2>&1 & when: From 46949f6660845ecf2b8692b149db3e9902f06f7f Mon Sep 17 00:00:00 2001 From: Talha Bin Rizwan Date: Mon, 25 Nov 2024 17:49:53 +0500 Subject: [PATCH 2/5] PMM-13567 Fix AMI and OVF builds. --- build/packer/ansible/roles/ami-ovf/tasks/main.yml | 7 ------- build/packer/ansible/roles/podman-setup/tasks/main.yml | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build/packer/ansible/roles/ami-ovf/tasks/main.yml b/build/packer/ansible/roles/ami-ovf/tasks/main.yml index fa8250bb53..35b0644261 100644 --- a/build/packer/ansible/roles/ami-ovf/tasks/main.yml +++ b/build/packer/ansible/roles/ami-ovf/tasks/main.yml @@ -1,11 +1,4 @@ --- -- name: Update podman.conf - lineinfile: - path: /usr/lib/tmpfiles.d/podman.conf - regexp: '^x /tmp/storage-run-\*' - line: 'R! /tmp/storage-run-*' - backrefs: yes - - name: PMM | Delete ec2-user EL9 shell: cd /tmp; nohup sh -c "trap 'userdel -r ec2-user' EXIT; sleep 600" /dev/null 2>&1 & when: diff --git a/build/packer/ansible/roles/podman-setup/tasks/main.yml b/build/packer/ansible/roles/podman-setup/tasks/main.yml index b7e9bf21fe..3cedef6460 100644 --- a/build/packer/ansible/roles/podman-setup/tasks/main.yml +++ b/build/packer/ansible/roles/podman-setup/tasks/main.yml @@ -24,6 +24,14 @@ policy: targeted state: permissive +- name: Update podman.conf for ami and ovf + lineinfile: + path: /usr/lib/tmpfiles.d/podman.conf + regexp: '^x /tmp/storage-run-\*' + line: 'R! /tmp/storage-run-*' + backrefs: yes + when: pmm_distribution_method in ['ovf', 'ami'] + - name: Create a volume on the host command: podman volume create pmm-data become: true From 599f329449e932e56b4558b869e3ce04bd6f328b Mon Sep 17 00:00:00 2001 From: Talha Bin Rizwan Date: Tue, 26 Nov 2024 13:59:18 +0500 Subject: [PATCH 3/5] PMM-13567 This role can only run for ovf/ami, so the when statement is not necessary. --- build/packer/ansible/roles/podman-setup/tasks/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/packer/ansible/roles/podman-setup/tasks/main.yml b/build/packer/ansible/roles/podman-setup/tasks/main.yml index 3cedef6460..b5cab0bc41 100644 --- a/build/packer/ansible/roles/podman-setup/tasks/main.yml +++ b/build/packer/ansible/roles/podman-setup/tasks/main.yml @@ -24,13 +24,12 @@ policy: targeted state: permissive -- name: Update podman.conf for ami and ovf +- name: Update podman.conf lineinfile: path: /usr/lib/tmpfiles.d/podman.conf regexp: '^x /tmp/storage-run-\*' line: 'R! /tmp/storage-run-*' backrefs: yes - when: pmm_distribution_method in ['ovf', 'ami'] - name: Create a volume on the host command: podman volume create pmm-data From 4d000648e5e581f1383efa69ec93cce0f05dee09 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Tue, 26 Nov 2024 12:20:46 +0300 Subject: [PATCH 4/5] PMM-12566 Better handling of errors. --- .../roles/initialization/tasks/main.yml | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/build/ansible/roles/initialization/tasks/main.yml b/build/ansible/roles/initialization/tasks/main.yml index f66efd862a..35772bd0fb 100644 --- a/build/ansible/roles/initialization/tasks/main.yml +++ b/build/ansible/roles/initialization/tasks/main.yml @@ -101,20 +101,22 @@ method: GET retries: 20 delay: 5 + register: pmm_ready + until: pmm_ready.status == 200 ignore_errors: true - name: Initialize admin password for AMI if needed include_role: name: init-admin-password-ami when: need_initialization and is_ami + when: need_initialization or need_upgrade - - name: Disable maintenance mode - file: - state: absent - path: /usr/share/pmm-server/maintenance/maintenance.html +- name: Disable maintenance mode + file: + state: absent + path: /usr/share/pmm-server/maintenance/maintenance.html - - name: Remove the file provisioned by 'getStatus' - file: - state: absent - path: /srv/pmm-update.json - when: need_initialization or need_upgrade +- name: Remove the file provisioned by 'getStatus' + file: + state: absent + path: /srv/pmm-update.json From 4d51643b80cfb40dd99c9cedc733053f8f6bdc0d Mon Sep 17 00:00:00 2001 From: Talha Bin Rizwan Date: Wed, 27 Nov 2024 14:15:48 +0500 Subject: [PATCH 5/5] PMM-13567 Remove PMM_DEV_UPDATE_DOCKER_IMAGE env from pmm-server.env file. --- build/packer/ansible/roles/podman-setup/templates/pmm-server.env | 1 - 1 file changed, 1 deletion(-) diff --git a/build/packer/ansible/roles/podman-setup/templates/pmm-server.env b/build/packer/ansible/roles/podman-setup/templates/pmm-server.env index 1ffca72c01..4290850d2a 100644 --- a/build/packer/ansible/roles/podman-setup/templates/pmm-server.env +++ b/build/packer/ansible/roles/podman-setup/templates/pmm-server.env @@ -1,5 +1,4 @@ PMM_WATCHTOWER_HOST=http://watchtower:8080 PMM_WATCHTOWER_TOKEN=123 -PMM_DEV_UPDATE_DOCKER_IMAGE=docker.io/perconalab/pmm-server:3-dev-container PMM_IMAGE={{ pmm_server_image_name }} PMM_DISTRIBUTION_METHOD={{ pmm_distribution_method }}