Skip to content
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

Permit to recursively do salt.modules.file.chown, salt.modules.file.chgrp and salt.modules.file.set_mode #55142

Open
baby-gnu opened this issue Oct 28, 2019 · 6 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc.
Milestone

Comments

@baby-gnu
Copy link

Hello.

Description of Issue

I'm using salt-ssh to do parallel tasks and I would like to be able to pass recurse=True to some modules.

Setup

  • You only need to have SSH access to several hosts (possibly a single one)

Steps to Reproduce Issue

  • SSH access to several hosts
  • copy some tree salt-ssh '*' file.copy /etc/skel/ /tmp/foo
  • modify user group salt-ssh '*' file.chown /tmp/foo mail mail

We should be able to provide recurse=True to the last command.

Versions Report

Salt Version:
           Salt: 2019.2.2
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.7.3
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: Not Installed
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.7.3 (default, Apr  3 2019, 05:39:12)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: Not Installed
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: Not Installed
 
System Versions:
           dist: debian 10.1 
         locale: UTF-8
        machine: x86_64
        release: 4.19.0-5-amd64
         system: Linux
        version: debian 10.1 
@OrangeDog
Copy link
Contributor

Why don't you use file.recurse to do it all in one step?
Recursively chowning/chmoding existing trees is usually a bad idea, commonly given as bad advice for e.g. "my website doesn't work".

@baby-gnu
Copy link
Author

Hello @OrangeDog

My use case is not using states but modules by using salt-ssh as a replacement of pssh and there is no file.recurse in https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.file.html

For now, I'm doing salt-ssh '*' cmd.run 'chown -R mail:mail /tmp/foo.

Regards.

@frogunder
Copy link
Contributor

@baby-gnu Thank you for this report.

@frogunder frogunder added this to the Approved milestone Oct 28, 2019
@frogunder frogunder added the Feature new functionality including changes to functionality and code refactors, etc. label Oct 28, 2019
@stale
Copy link

stale bot commented Jan 7, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Jan 7, 2020
@baby-gnu
Copy link
Author

baby-gnu commented Jan 7, 2020

Hello.

I'm still interested by this feature.

Regards.

@stale
Copy link

stale bot commented Jan 7, 2020

Thank you for updating this issue. It is no longer marked as stale.

@stale stale bot removed the stale label Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc.
3 participants