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

[Feature] Create hard link salt state to go with the file.link module. #39475

Closed
weirdbricks opened this issue Feb 17, 2017 · 6 comments
Closed
Labels
Feature new functionality including changes to functionality and code refactors, etc. Platform Relates to OS, containers, platform-based utilities like FS, system based apps
Milestone

Comments

@weirdbricks
Copy link

Description of Issue/Question

Hello,

I'm very new to Salt so hopefully I'm not doing something dumb.

The issue I'm having is that I can create a symlink by using file.symlink but I cannot create a hard link by using file.link.

Setup

The symlink works:

create stunnel link:
  file.symlink:
    - name: /opt/init/stunnel-alpine.init
    - target: /root/tools-monit-configs/stunnel-alpine.init

The hard link does not:

create stunnel link:
  file.link:
    - name: /opt/init/stunnel-alpine.init
    - target: /root/tools-monit-configs/stunnel-alpine.init

Interestingly enough, this does work:

salt '*' file.link /root/tools-monit-configs/stunnel-alpine.init /opt/init/stunnel-alpine.init

Steps to Reproduce Issue

The error I get is:

          ID: create stunnel link
    Function: file.link
        Name: /opt/init/stunnel-alpine.init
      Result: False
     Comment: State 'file.link' was not found in SLS 'telegraf.docker'
              Reason: 'file.link' is not available.
     Changes: 

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Master:

salt --versions-report
Salt Version:
           Salt: 2016.11.0
 
Dependency Versions:
           cffi: 1.8.3
       cherrypy: Not Installed
       dateutil: 2.5.3
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: 0.24.3
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
         pygit2: 0.24.2
         Python: 2.7.13 (default, Dec 22 2016, 09:22:15)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.4.2
            ZMQ: 4.1.5
 
System Versions:
           dist:   
        machine: x86_64
        release: 3.10.0-327.36.3.el7.x86_64
         system: Linux
        version: Not Installed

Minion:

salt-minion --versions-report
Salt Version:
           Salt: 2016.11.2
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.5 (default, Nov  6 2016, 00:28:07)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4
 
System Versions:
           dist: centos 7.3.1611 Core
        machine: x86_64
        release: 3.10.0-514.6.1.el7.x86_64
         system: Linux
        version: CentOS Linux 7.3.1611 Core
@gtmanfred gtmanfred added the expected-behavior intended functionality label Feb 17, 2017
@gtmanfred gtmanfred added this to the Blocked milestone Feb 17, 2017
@gtmanfred
Copy link
Contributor

This is working as expected because link is not a state.

https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html

The state and execution modules, while they may share the same name, are different modules, and might not all exist for both.

If you would like to make this into a feature request, please update the title, but this is not a bug.

Otherwise, can this be closed?

Thanks,
Daniel

@weirdbricks
Copy link
Author

@gtmanfred thanks for the quick reply!

Yes, please, I think this would be useful to have as a state module.

Is there any guideline on what the title should be for a feature request?

@gtmanfred gtmanfred changed the title Cannot use file.link inside a Salt State [Feature] Create hard link salt state to go with the file.link module. Feb 17, 2017
@gtmanfred gtmanfred added Feature new functionality including changes to functionality and code refactors, etc. Platform Relates to OS, containers, platform-based utilities like FS, system based apps TEAM Platform and removed expected-behavior intended functionality labels Feb 17, 2017
@gtmanfred gtmanfred modified the milestones: Approved, Blocked Feb 17, 2017
@gtmanfred
Copy link
Contributor

Done :D

@weirdbricks
Copy link
Author

@gtmanfred thank you sir :)

@stale
Copy link

stale bot commented Sep 8, 2018

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.

@arizvisa
Copy link
Contributor

Btw, created PR #55000 to add this capability.

@waynew waynew removed the stale label Jan 15, 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. Platform Relates to OS, containers, platform-based utilities like FS, system based apps
Projects
None yet
Development

No branches or pull requests

4 participants