saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
13.98k stars 5.47k forks source link

[BUG] file_roots to relative path seems broken #66588

Open dtzampanakis opened 1 month ago

dtzampanakis commented 1 month ago

Description Upgrading from salt-ssh version 3007.0 (Chlorine) to 3007.1 (Chlorine), seems to broke the file_roots that i use in my master file.

root_dir: "."
conf_file: ./master
cachedir: /tmp/salt
gpg_keydir: /etc/salt/gpgkeys
file_roots:
  base:
    - ./states
pillar_roots:
  base:
    - ./pillar

Pillars are working, but when i try to state.apply i am unable to apply any state with

serverx:
    - No matching sls found for 'ntp' in env 'base'

Working only if i change the file_roots with an absolute path.

I installed 3006.8(Sulfur) to make it work again with relative path since i am unable to go back to 3007.0.

petrows commented 1 month ago

I have the same issue, all my scripts are broken now after update. I also have downgraded to previous version.

bendikro commented 1 month ago

b0e7c62 by @hurzhurz is what caused this regression. @s0undt3ch

hartwork commented 1 week ago

This is crazy, it makes 3007.1 unusable. Could this be fixed please?

hurzhurz commented 1 week ago

@dtzampanakis Can you tell a bit more about how you run the master with this example config?

I wanted to try it, but I can't get it working, even with 3006.8.

I made a file structure like this in a test VM:

/root/master-test/
/root/master-test/master (your mentioned config)
/root/master-test/states/
/root/master-test/states/abc (dummy file)
/root/master-test/pillar/

And I started the master like this: cd /root/master-test/ && salt-master -c .

The master actually uses the file structure in /root/master-test/ for minion keys, cache, etc. But a cp.list_master against a connected minion doesn't list anything.

It looks like the master worker threads have / as CWD. So with "./states" they actually look in "/states". And if I create "/states/" and a file "/states/abc", cp.list_master actually shows the file "abc".

Am I missing a step? Or do you use anything special to run the master, like docker or so?

hartwork commented 1 week ago

@hurzhurz this is about salt-ssh. Have you tried salt-ssh?

hurzhurz commented 1 week ago

@hartwork Thanks for the hint! I somehow overlooked and also didn't expect that...

dwoz commented 1 week ago

@hurzhurz Assigned this to you assuming you are up for the task. :)