FAQ
I am attempting to configure a state using the nginx.signal function to
restart nginx service as follows :
:
:
restart-nginx:
  nginx.signal:
   - signal: reload
:
:
The following error response is received when running "salt-call
state.highstate local"

----------
           ID: restart-nginx
     Function: nginx.signal
       Result: False
      Comment: State nginx.signal found in sls nginx is unavailable
      Changes:
----------

Has anyone had luck using it ?

...Rohit

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Stephen Spencer at Sep 24, 2014 at 12:39 am
    Where is the nginx binary located on your system? I just reviewed the code
    for the nginx module. It leverages salt.util.which to locate the binary,
    but if you have it sequestered off in a location that which doesn't know
    of, the nginx module won't activate.

    -S
    On Sep 23, 2014 10:32 AM, "Rohit Sood" wrote:

    I am attempting to configure a state using the nginx.signal function to
    restart nginx service as follows :
    :
    :
    restart-nginx:
    nginx.signal:
    - signal: reload
    :
    :
    The following error response is received when running "salt-call
    state.highstate local"

    ----------
    ID: restart-nginx
    Function: nginx.signal
    Result: False
    Comment: State nginx.signal found in sls nginx is unavailable
    Changes:
    ----------

    Has anyone had luck using it ?

    ...Rohit

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Stephen Spencer at Sep 24, 2014 at 12:46 am
    Just to be clear, the nginx module you're invoking is not the same as the
    nginx formula, though they are obviously complementary.

    Basically, if

    salt.utils.which('nginx')

    returns False, you'll need to figure out why and rectify it.

    This might be of some assistance:
    https://groups.google.com/forum/m/#!topic/salt-users/d4ZPuLYRTro
      On Sep 23, 2014 7:39 PM, "Stephen Spencer" wrote:

    Where is the nginx binary located on your system? I just reviewed the
    code for the nginx module. It leverages salt.util.which to locate the
    binary, but if you have it sequestered off in a location that which doesn't
    know of, the nginx module won't activate.

    -S
    On Sep 23, 2014 10:32 AM, "Rohit Sood" wrote:

    I am attempting to configure a state using the nginx.signal function to
    restart nginx service as follows :
    :
    :
    restart-nginx:
    nginx.signal:
    - signal: reload
    :
    :
    The following error response is received when running "salt-call
    state.highstate local"

    ----------
    ID: restart-nginx
    Function: nginx.signal
    Result: False
    Comment: State nginx.signal found in sls nginx is unavailable
    Changes:
    ----------

    Has anyone had luck using it ?

    ...Rohit

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rohit Sood at Sep 24, 2014 at 4:15 pm
    Stephen,

                 thanks for the response.

                 few things to note :

        1. Server is running on Centos 6.5
           1. Salt: 2014.7.0rc1
                     Python: 2.7.6 (default, Sep 5 2014, 19:17:44)
                     Jinja2: 2.7.3
                     M2Crypto: 0.22
                     msgpack-python: 0.4.2
                     msgpack-pure: Not Installed
                     pycrypto: 2.6.1
                     libnacl: Not Installed
                     PyYAML: 3.11
                     ioflo: Not Installed
                     PyZMQ: 14.3.1
                     RAET: Not Installed
                      ZMQ: 4.0.4
                      Mako: Not Installed



        1. Minion is also on Centos 6.5

                                           Salt: 2014.1.10
                                           Python: 2.6.6 (r266:84292, Jan 22
    2014, 09:42:36)
                                           Jinja2: 2.2.1
                                           M2Crypto: 0.20.2
                                           msgpack-python: 0.1.13
                                           msgpack-pure: Not Installed
                                           pycrypto: 2.0.1
                                           PyYAML: 3.10
                                           PyZMQ: 2.2.0.1
                                           ZMQ: 3.2.4
    PATH variable is correctly returned :

      salt <minion-name> cmd.run "echo $PATH "
    <minion-name>:
         /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

    salt.utils.which returns empty :

    salt <minion-name> cmd.run "python -c 'import salt.utils; print
    salt.utils.which()' "
    r<minion-name>:
         None

    On the minion :

    [root@<minion-name> ~]# salt-call cmd.run "python -c 'import salt.utils;
    print salt.utils.which()' "
    [INFO ] Executing command "python -c 'import salt.utils; print
    salt.utils.which()'" in directory '/root'
    [INFO ] output: None
    local:
         None


    [root@minion-name ~]# echo $PATH
    /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
    [root@minion-name ~]# which nginx
    /usr/sbin/nginx


    I am leveraging the nginx formula in my state file :





    *nginx: pkg: - installed*generate-upstream:
      file.managed:
       - source: salt://gitRepos/<repo-name>/nginx/generate-upstream.py
       - name : /tmp/generate-upstream.py
       - user : root
       - group : root
       - mode : 644
      cmd.run:
       - name : /usr/bin/python /tmp/generate-upstream.py
       - cwd: /
       - stateful: True

    copy-recurse-edge-all:
      file.recurse:
       - source: salt://gitRepos/<repo-name>/systems/tscl/tscl-env-edge-all
       - name : /etc/nginx/<destination-folder>

    copy-upstream-conf:
      file.copy:
       - source : /tmp/upstream.conf
       - destination : /etc/nginx/conf.d/extra




    *restart-nginx: nginx.signal: - signal: reload*

    On Tuesday, September 23, 2014 8:46:38 PM UTC-4, Stephen Spencer wrote:

    Just to be clear, the nginx module you're invoking is not the same as the
    nginx formula, though they are obviously complementary.

    Basically, if

    salt.utils.which('nginx')

    returns False, you'll need to figure out why and rectify it.

    This might be of some assistance:
    https://groups.google.com/forum/m/#!topic/salt-users/d4ZPuLYRTro
    On Sep 23, 2014 7:39 PM, "Stephen Spencer" <gladi...@gmail.com
    <javascript:>> wrote:
    Where is the nginx binary located on your system? I just reviewed the
    code for the nginx module. It leverages salt.util.which to locate the
    binary, but if you have it sequestered off in a location that which doesn't
    know of, the nginx module won't activate.

    -S
    On Sep 23, 2014 10:32 AM, "Rohit Sood" <rs...@tibco.com <javascript:>>
    wrote:
    I am attempting to configure a state using the nginx.signal function to
    restart nginx service as follows :
    :
    :
    restart-nginx:
    nginx.signal:
    - signal: reload
    :
    :
    The following error response is received when running "salt-call
    state.highstate local"

    ----------
    ID: restart-nginx
    Function: nginx.signal
    Result: False
    Comment: State nginx.signal found in sls nginx is unavailable
    Changes:
    ----------

    Has anyone had luck using it ?

    ...Rohit

    --
    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 <javascript:>.
    For more options, visit https://groups.google.com/d/optout.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Stephen Spencer at Sep 24, 2014 at 7:10 pm
    Definitely a path issue. It looks like you can solve this by adding a PATH
    extension expression in /etc/default/salt to include /usr/sbin.

    -S

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rohit Sood at Sep 29, 2014 at 3:18 pm
    Not certain of that.

        [root@<minion-name>]# salt-call nginx.signal start
    [INFO ] Executing command '/usr/sbin/nginx' in directory '/root'
    local:
         Command: "/usr/sbin/nginx" completed successfully!

    On Wednesday, September 24, 2014 3:10:29 PM UTC-4, Stephen Spencer wrote:

    Definitely a path issue. It looks like you can solve this by adding a PATH
    extension expression in /etc/default/salt to include /usr/sbin.

    -S
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Stephen Spencer at Sep 29, 2014 at 5:25 pm
    Yes.

    I would be willing to wager that if you symlink /usr/sbin/ngninx to
    /usr/bin that your state would magically work.

    If no other PATH definition is available, the PATH that salt.utils.which()
    builds does not include */sbin directories.

    So you can either explicitly declare the minion's PATH or you can make your
    binaries available within the PATH that is generated when no other is
    available.

    -S
    Not certain of that.

        [root@<minion-name>]# salt-call nginx.signal start
    [INFO ] Executing command '/usr/sbin/nginx' in directory '/root'
    local:
         Command: "/usr/sbin/nginx" completed successfully!

    On Wednesday, September 24, 2014 3:10:29 PM UTC-4, Stephen Spencer wrote:

    Definitely a path issue. It looks like you can solve this by adding a PATH
    extension expression in /etc/default/salt to include /usr/sbin.

    -S
      --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupsalt-users @
postedSep 23, '14 at 3:32p
activeSep 29, '14 at 5:25p
posts7
users2

2 users in discussion

Stephen Spencer: 4 posts Rohit Sood: 3 posts

People

Translate

site design / logo © 2022 Grokbase