Bug 50275 - puppet-агент каждый прогон пытается обновить пакет
Summary: puppet-агент каждый прогон пытается обновить пакет
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: puppet (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: majioa@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-03 18:09 MSK by Вадим М.
Modified: 2024-06-01 06:38 MSK (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Вадим М. 2024-05-03 18:09:18 MSK
У нас есть простенький ресурс в puppet, для установки/обновления пакета ca-certificates:

  package{'ca-certificates':
    ensure => latest
  }

Но при каждом запуске puppet-агента он выводит уведомление, что пытается обновить этот пакет, хотя указанная версия уже установлена:

Debug: Executing '/bin/rpm -qa --nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n' | sort'
Debug: Executing: '/usr/bin/apt-cache showpkg ca-certificates'
Debug: /Stage[main]/Post_base__v1_2::Root_certs::Update_ca/Package[ca-certificates]/ensure: ca-certificates "2022.09.15-alt1" is installed, latest is "2022.09.15-alt1:p10+308004.100.2.1@1665748370"
Debug: Executing: '/usr/bin/apt-get -q -y install ca-certificates'
Debug: /Stage[main]/Post_base__v1_2::Root_certs::Update_ca/Package[ca-certificates]/ensure: ca-certificates "2022.09.15-alt1" is installed, latest is "2022.09.15-alt1:p10+308004.100.2.1@1665748370"
Notice: /Stage[main]/Post_base__v1_2::Root_certs::Update_ca/Package[ca-certificates]/ensure: ensure changed '2022.09.15-alt1' to '2022.09.15-alt1:p10+308004.100.2.1@1665748370' (corrective)

[root@d01toolsalt01t ~]# rpm -qa --nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION}:%{DISTTAG} %{RELEASE} %{ARCH}\n' | grep ca-certificates
ca-certificates 0 2022.09.15:p10+308004.100.2.1 alt1 noarch
[root@d01toolsalt01t ~]# rpm -q puppet
puppet-7.20.0-alt1.noarch
[root@d01toolsalt01t ~]# lsb_release -a
LSB Version:	n/a
Distributor ID:	ALT
Description:	ALT Server 10.1 (Mendelevium)
Release:	10.1
Codename:	Mendelevium


Судя по всему проблема в том, что установленная версия пакета проверяется командой rpm, которая не учитывает %{DISTTAG}.
Comment 1 Nikolai Zurabishvili 2024-05-14 15:21:24 MSK
puppet-8.4.0-alt1.1

Стенды (обновлены до сизифа):

KWorkstation 10.3 x86-64
Workstation 10.2 x86-64
Education 10.2 KDE x86-64
Education 10.2 x86-64
Server 10.2 office x86-64

Шаги:
1. # puppet apply --verbose --debug --execute "package {'neofetch': ensure => latest }"


Фактический результат: puppet сравнивает версию без %{DISTTAG} и поэтому считает что новая версия доступна для установки

Debug: Prefetching aptrpm resources for package
Debug: Executing: '/usr/bin/rpm --version'
Debug: Executing '/usr/bin/rpm -qa --nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n' | sort'
Debug: Executing: '/usr/bin/apt-cache showpkg neofetch'
Debug: /Stage[main]/Main/Package[neofetch]/ensure: neofetch "7.1.0-alt5" is installed, latest is "7.1.0-alt5:sisyphus+342895.100.1.1@1710578036"
Debug: Executing: '/usr/bin/apt-get -q -y install neofetch'
Notice: /Stage[main]/Main/Package[neofetch]/ensure: ensure changed '7.1.0-alt5' to '7.1.0-alt5:sisyphus+342895.100.1.1@1710578036'


Ожидаемый результат: puppet сравнит версию с использованием %{DISTTAG} и не будет пытаться установить новую версию которой еще нет
Comment 2 Repository Robot 2024-06-01 06:38:55 MSK
gem-puppet-7.20.0-alt2.p10.0 -> p10:

 Wed May 22 2024 Pavel Skrylev <majioa@altlinux> 7.20.0-alt2.p10.0
 - ! proper ALT package version detection without long suffix (closes #50275)