saltstack-formulas / salt-formula

Yes, Salt can Salt itself!
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
197 stars 423 forks source link

[BUG] Onedir not supported, therefore Ubuntu 22.04 and others not supported and future Salt versions will break #545

Open bartlaarhoven opened 1 year ago

bartlaarhoven commented 1 year ago

As Salt is moving towards onedir layouts, the repo URLs change as well. Ubuntu 22.04 for example is only available in the onedir format, and the repo URL needs an extra /salt/ for it to work.

I guess that complete onedir support should be built-in for this formula to work from version 3006 onwards anyway.

hadret commented 1 year ago

Just wanted to add that the key name also differs SALTSTACK-GPG-KEY.pub -> salt-archive-keyring.gpg. Right now I'm circumventing this via the following diff in salt/osmap.yaml file:

diff --git a/salt/osmap.yaml b/salt/osmap.yaml
index c553728..3ca551d 100644
--- a/salt/osmap.yaml
+++ b/salt/osmap.yaml
@@ -25,10 +25,10 @@ Amazon:
   key_url: '{{ salt_repo }}/{{ py_ver_repr or 'yum' }}/amazon/2/$basearch/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'

 Ubuntu:
-  pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=amd64] {{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
-  pkgrepo_keyring: '{{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/salt-archive-keyring.gpg'
+  pkgrepo: 'deb [signed-by=/usr/share/keyrings/salt-archive-keyring.gpg arch=amd64] {{ salt_repo }}/{% if oscodename == "jammy" %}salt/{% endif %}{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }} {{ oscodename }} main'
+  pkgrepo_keyring: '{{ salt_repo }}/{% if oscodename == "jammy" %}salt/{% endif %}{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/salt-archive-keyring.gpg'
   pkgrepo_keyring_hash: sha256=ea38e0cdbd8dc53e1af154a8d711a2a321a69f81188062dc5cde9d54df2b8c47
-  key_url: '{{ salt_repo }}/{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/SALTSTACK-GPG-KEY.pub'
+  key_url: '{{ salt_repo }}/{% if oscodename == "jammy" %}salt/{% endif %}{{ py_ver_repr or 'apt' }}/{{ os_lower }}/{{ osrelease }}/amd64/{{ salt_release }}/{% if oscodename == "jammy" %}salt-archive-keyring.gpg{% else %}SALTSTACK-GPG-KEY.pub{% endif %}'
   pygit2: python-pygit2
   gitfs:
     pygit2:

These are inline changes though and jammy name is hardcoded — neither of this is great. I think long-term better approach would be to check against osmajorrelease and ensure that anything >= 22 in Ubuntu section gets the new onedir treatment.

B1ue-W01f commented 1 year ago

Surely before you release even the post about onedir, youd have this formula updated...and yet here we are, now May.

dafyddj commented 1 year ago

@B1ue-W01f The formula is community maintained, and unfortunately no-one is actively doing so at this time. Nothing to do with the Core team if that's what you're referring to. You're welcome to submit a PR.

B1ue-W01f commented 1 year ago

@dafyddj this is the official repo though right?

Perhaps different if it was the non official repo but just looks bad if Saltstack hosts a Saltstack formula that doesn't work with Saltstack.

dafyddj commented 1 year ago

Saltstack as an organization and product doesn't exist, and I wouldn't call this GitHub organization official