- require: pkg: cifs-utils

16 views
Skip to first unread message

Calanon

unread,
Nov 25, 2018, 10:28:24 PM11/25/18
to Salt-users
Hi,

I have this:

  mount.mounted:
   - device: //nas.dh.net/Share /Share
   - fstype: cifs
   - opts: 'vers=2.0,credentials=/cred'
   - mkmnt: True
   - require:
     - pkg: cifs-utils

The target minion is centos 7.  When I run state.apply I get the following message:

Comment: The following requisites were not found:
                                 require:
                                     pkg: cifs-utils

When I type on directly on the console of the target minion:

yum install cifs-utils

It works!

Any ideas where I am going wrong?

Thanks

James Booth

unread,
Nov 26, 2018, 6:28:05 AM11/26/18
to salt-...@googlegroups.com
The 'require' doesn't look for the cifs-utils package directly, it refers to another 'pkg' state called 'cifs-utils', so you need to make sure that is present. For example, 

    cifs-utils:
      pkg.latest:
        - refresh: True

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/93d83365-9144-47e5-9912-8c32076fec93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joel Whitehouse

unread,
Nov 27, 2018, 6:52:43 PM11/27/18
to salt-...@googlegroups.com
Calanon,

The code:
> - require:
> - pkg: cifs-utils

references not a system package called "cifs-utils", but a salt state,
in the "pkg" module, called "cifs-utils". Your code should work if you
add this state:

cifs-utils:
pkg.installed


You could also expand the "cifs-utils" state to support multiple
platforms such as ubuntu, where the package name is different, but you
would still be able to reference the state from a requisite using its
name "pkg: cifs-utils".

Regards,


-Joel
> --
> You received this message because you are subscribed to the Google
> Groups "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to salt-users+...@googlegroups.com
> <mailto:salt-users+...@googlegroups.com>.
> <https://groups.google.com/d/msgid/salt-users/93d83365-9144-47e5-9912-8c32076fec93%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--
Joel Whitehouse
Software Developer
+1.319.521.7762
Reply all
Reply to author
Forward
0 new messages