-
Notifications
You must be signed in to change notification settings - Fork 194
Update solaris to add pkg publisher #658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update solaris to add pkg publisher #658
Conversation
The Solaris class only set up the repo, it didn't configure the pkg tool to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rstuart-indue! What was the error you were seeing prior to this PR? I'm also wondering if this ever worked in certain circumstances?
@@ -107,6 +107,12 @@ | |||
logoutput => 'on_failure', | |||
refreshonly => true, | |||
} | |||
~> exec { 'puppet_agent add publisher to pkg': | |||
command => "pkg set-publisher -e -g ${pkgrepo_dir} ${publisher}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the publisher
already exists (as described in https://tickets.puppetlabs.com/browse/PA-5215) will this command still work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @rstuart-indue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @joshcooper it looks like I missed the previous notifications.
I don't seem to be able to find the linked ticket above. The pkg man page says it will update or add. here is a system and executing this command when the publisher already exists:
[16:32:27] root@host
/root# pkg publisher
PUBLISHER TYPE STATUS P LOCATION
solaris origin online F http://172.20.98.16:8003/IPS/
puppetlabs.com origin online F file:///etc/puppetlabs/installer/solaris.repo/
[16:32:33] root@host
/root# pkg publisher puppetlabs.com
Publisher: puppetlabs.com
Alias:
Origin URI: file:///etc/puppetlabs/installer/solaris.repo/
Origin Status: Online
SSL Key: None
SSL Cert: None
Client UUID: 6cfd453a-2141-11ee-9502-43f3b6da7299
Catalog Updated: Thu Nov 9 03:44:37 2023
Publisher enabled: Yes
[16:32:36] root@host
/root# pkg set-publisher -e -g /etc/puppetlabs/installer/solaris.repo/ puppetlabs.com
[16:32:44] root@host
/root# pkg publisher puppetlabs.com
Publisher: puppetlabs.com
Alias:
Origin URI: file:///etc/puppetlabs/installer/solaris.repo/
Origin Status: Online
SSL Key: None
SSL Cert: None
Client UUID: 6cfd453a-2141-11ee-9502-43f3b6da7299
Catalog Updated: Thu Nov 9 03:44:37 2023
Publisher enabled: Yes
[16:32:51] root@host
/root# pkg publisher
PUBLISHER TYPE STATUS P LOCATION
solaris origin online F http://172.20.98.16:8003/IPS/
puppetlabs.com origin online F file:///etc/puppetlabs/installer/solaris.repo/
This additional code is to have Solaris 11 behave the same was as redhat and configure the repo as appropriate. ref https://github.com/puppetlabs/puppetlabs-puppet_agent/blob/main/manifests/osfamily/redhat.pp#L162 and this block mimics the yumrepo declaration of line 167.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re your question of whether this ever worked: no, it didn't. This didn't set up the "client side" of the repo and enable it for use which seems to be the expectation of setting the "manage_repo" parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For posterity, about PA-5215, the issue was
When using puppet_agent to upgrade from PE 2016.4.6 to 2017.3.1 we were seeing issues when trying to retrieve the last version of puppet-agent package:
Error: Execution of '/usr/bin/pkg list -Hvfa [email protected]' returned 1: pkg list: no packages matching '[email protected]' known
Error: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]/ensure: change from 1.7.1,5.11-1:20161012T034616Z to 5.3.2 failed: Execution of '/usr/bin/pkg list -Hvfa [email protected]' returned 1: pkg list: no packages matching '[email protected]' known
The curl installer was working as expected.
After some troubleshooting we discovered that customer had a custom publisher called puppetlabs.com that did not contained the puppet-agent version 5.3.2, making the pkg list command fail, and the puppet_agent module fail.
Notice that this used to happen in the frictionless installer, but it was fixed.
@rstuart-indue this change makes sense to me, could you add a test?
The Solaris class only set up the repo, it didn't configure the pkg tool to use it. This adds the extra command to configure the "client" side of this to allow the pkg tool to see packages in the repo previously configured.