saltutil.sync_modules does not copy anything with salt-ssh

396 views
Skip to first unread message

Marc Liyanage

unread,
Nov 8, 2013, 2:33:54 AM11/8/13
to salt-...@googlegroups.com

I am trying to sync a custom module with saltutil.sync_modules, but nothing happens:



$ salt-ssh  -c config '*' test.ping

[WARNING ] Warning:  sshpass is not present, so password-based authentication is not available.

host4:

    True

host3:

    True


$ salt-ssh  -c config '*' saltutil.sync_modules

[WARNING ] Warning:  sshpass is not present, so password-based authentication is not available.

host3:

host4:



Should something happen? Where would the files get copied to on the minions?

I am running the contents of the develop branch as of this afternoon (because the released version did not work properly, it used md5sum instead of md5).


The config file:

root_dir: /Users/xxx/Desktop/salt

user: xxx

pki_dir: pki

cachedir: cache

file_roots:

  base:

    - /Users/xxx/Desktop/salt/file_root



$ find /Users/xxx/Desktop/salt/file_root

/Users/xxx/Desktop/salt/file_root

/Users/xxx/Desktop/salt/file_root/_modules

/Users/xxx/Desktop/salt/file_root/_modules/some_module.py




Below the command again with some debug output. BTW, should I be worried about these lines at the end:


[CRITICAL] Unable to import msgpack or msgpack_pure python modules

Exception AttributeError: "'MinionEvent' object has no attribute 'cpub'" in <bound method MinionEvent.__del__ of <salt.utils.event.MinionEvent object at 0x102522c10>> ignored


If so, what cold cause these?


Thanks for any tips.




(virtualenv)xxx@xxx1:salt $ salt-ssh -l debug -c config '*' saltutil.sync_modules

[DEBUG   ] Reading configuration from /Users/xxx/Desktop/salt/config/master

[DEBUG   ] loading log_handlers in ['/Users/xxx/Desktop/salt/cache/extmods/log_handlers', '/Users/xxx/Desktop/salt/virtualenv/lib/python2.7/site-packages/salt/log/handlers']

[DEBUG   ] Skipping /Users/xxx/Desktop/salt/cache/extmods/log_handlers, it is not a directory

[DEBUG   ] None of the required configuration sections, 'logstash_udp_handler' and 'logstash_zmq_handler', were found the in the configuration. Not loading the Logstash logging handlers module.

[DEBUG   ] Configuration file path: /Users/xxx/Desktop/salt/config/master

[WARNING ] Warning:  sshpass is not present, so password-based authentication is not available.

[DEBUG   ] MasterEvent PUB socket URI: ipc:///Users/xxx/Desktop/salt/cache/.salt-unix/master_event_pub.ipc

[DEBUG   ] MasterEvent PULL socket URI: ipc:///Users/xxx/Desktop/salt/cache/.salt-unix/master_event_pull.ipc

[DEBUG   ] loading roster in ['/Users/xxx/Desktop/salt/cache/extmods/roster', '/Users/xxx/Desktop/salt/virtualenv/lib/python2.7/site-packages/salt/roster']

[DEBUG   ] Skipping /Users/xxx/Desktop/salt/cache/extmods/roster, it is not a directory

[DEBUG   ] loading render in ['/Users/xxx/Desktop/salt/cache/extmods/renderers', '/Users/xxx/Desktop/salt/virtualenv/lib/python2.7/site-packages/salt/renderers']

[DEBUG   ] Skipping /Users/xxx/Desktop/salt/cache/extmods/renderers, it is not a directory

[DEBUG   ] Rendered data from file: /Users/xxx/Desktop/salt/config/roster:

xxx3:

  host: x.x.x.x # The IP addr or DNS hostname

  user: salt         # Remote executions will be executed as user fred

  sudo: True         # Whether to sudo to root, not enabled by default

xxx4:

  host: y.y.y.y # The IP addr or DNS hostname

  user: salt         # Remote executions will be executed as user fred

  sudo: True         # Whether to sudo to root, not enabled by default


[DEBUG   ] Results of YAML rendering: 

OrderedDict([('xxx3', OrderedDict([('host', 'x.x.x.x'), ('user', 'salt'), ('sudo', True)])), ('xxx4', OrderedDict([('host', 'y.y.y.y'), ('user', 'salt'), ('sudo', True)]))])

[DEBUG   ] loading wrapper in ['/Users/xxx/Desktop/salt/cache/extmods/wrapper', '/Users/xxx/Desktop/salt/virtualenv/lib/python2.7/site-packages/salt/client/ssh/wrapper']

[DEBUG   ] Skipping /Users/xxx/Desktop/salt/cache/extmods/wrapper, it is not a directory

[DEBUG   ] loading wrapper in ['/Users/xxx/Desktop/salt/cache/extmods/wrapper', '/Users/xxx/Desktop/salt/virtualenv/lib/python2.7/site-packages/salt/client/ssh/wrapper']

[DEBUG   ] Skipping /Users/xxx/Desktop/salt/cache/extmods/wrapper, it is not a directory

[DEBUG   ] Performing shimmed command as follows:

/bin/sh << 'EOF'

      for py_candidate in \

            python27      \

            python2.7     \

            python26      \

            python2.6     \

            python2       \

            python        ;

      do

         if [ $(which $py_candidate 2>/dev/null) ]

         then

               PYTHON=$(which $py_candidate)

               break

         fi

      done

      SALT=/tmp/.salt/salt-call

      if [ md5 = 'md5' ]

      then

         for md5_candidate in \

            md5sum            \

            md5               ;

         do

            if [ $(which $md5_candidate 2>/dev/null) ]

            then

                SUMCHECK=$(which $md5_candidate)

                break

            fi

         done

      else

         SUMCHECK=md5

      fi


      if [ $SUMCHECK = '/sbin/md5' ]

      then

         CUT_MARK=4

      else

         CUT_MARK=1

      fi


      if [ -f $SALT ]

      then

         if [ $(cat /tmp/.salt/version) != 0.17.0 ]

         then

            sudo rm -rf /tmp/.salt && install -m 0700 -d /tmp/.salt

            if [ $? -ne 0 ]; then

                exit 1

            fi

            echo "_edbc7885e4f9aac9b38b35999b68d015148caf467b78fa39c05f669cf0f89878"

            echo "deploy"

            exit 1

         fi

      else

         PY_TOO_OLD=$($PYTHON -c 'import sys; print sys.hexversion < 0x02060000')

         if [ $PY_TOO_OLD = 'True' ];

         then

            echo "Python too old" >&2

            exit 1

         fi

         if [ -f /tmp/.salt/salt-thin.tgz ]

         then

             [ $($SUMCHECK /tmp/.salt/salt-thin.tgz | cut -f$CUT_MARK -d' ') = b2f173e3ed87496c7635bfe53989f121 ] && sudo tar opxzvf /tmp/.salt/salt-thin.tgz -C /tmp/.salt

         else

             install -m 0700 -d /tmp/.salt

             echo "_edbc7885e4f9aac9b83b359996b8d015148caf46b778fa39c05f669c0ff89878"

             echo "deploy"

             exit 1

         fi

      fi

      echo {root_dir: /tmp/.salt/running_data}

 > /tmp/.salt/minion

      echo "_edbc7885e4f9aac9b83b35999b68d015148cfa467b78fa39c05f6690cff89878"

      sudo $PYTHON $SALT --local --out json -l quiet saltutil.sync_modules -c /tmp/.salt

EOF

[DEBUG   ] Performing shimmed command as follows:

/bin/sh << 'EOF'

      for py_candidate in \

            python27      \

            python2.7     \

            python26      \

            python2.6     \

            python2       \

            python        ;

      do

         if [ $(which $py_candidate 2>/dev/null) ]

         then

               PYTHON=$(which $py_candidate)

               break

         fi

      done

      SALT=/tmp/.salt/salt-call

      if [ md5 = 'md5' ]

      then

         for md5_candidate in \

            md5sum            \

            md5               ;

         do

            if [ $(which $md5_candidate 2>/dev/null) ]

            then

                SUMCHECK=$(which $md5_candidate)

                break

            fi

         done

      else

         SUMCHECK=md5

      fi


      if [ $SUMCHECK = '/sbin/md5' ]

      then

         CUT_MARK=4

      else

         CUT_MARK=1

      fi


      if [ -f $SALT ]

      then

         if [ $(cat /tmp/.salt/version) != 0.17.0 ]

         then

            sudo rm -rf /tmp/.salt && install -m 0700 -d /tmp/.salt

            if [ $? -ne 0 ]; then

                exit 1

            fi

            echo "_edbc7885e4f9aac9b8b335999b68d015418caf467b87fa39c05f669c0ff89878"

            echo "deploy"

            exit 1

         fi

      else

         PY_TOO_OLD=$($PYTHON -c 'import sys; print sys.hexversion < 0x02060000')

         if [ $PY_TOO_OLD = 'True' ];

         then

            echo "Python too old" >&2

            exit 1

         fi

         if [ -f /tmp/.salt/salt-thin.tgz ]

         then

             [ $($SUMCHECK /tmp/.salt/salt-thin.tgz | cut -f$CUT_MARK -d' ') = b2f7133eed8749c67365bfe53989f121 ] && sudo tar opxzvf /tmp/.salt/salt-thin.tgz -C /tmp/.salt

         else

             install -m 0700 -d /tmp/.salt

             echo "_edbc7885e4f9aac9b83b35999b68d015148caf467b78fa39c05f669c0ff89878"

             echo "deploy"

             exit 1

         fi

      fi

      echo {root_dir: /tmp/.salt/running_data}

 > /tmp/.salt/minion

      echo "_edbc7885e4f9aac9b83b35999b68d105148caf4677b8fa39c05f669c0ff89878"

      sudo $PYTHON $SALT --local --out json -l quiet saltutil.sync_modules -c /tmp/.salt

EOF

[DEBUG   ] STDOUT y.y.y.y

{root_dir: /tmp/.salt/running_data}

_edbc7885e4f9aac9b83b39599b68d051148caf467b87fa39c05f669c0ff89878

{

    "local": []

}


[DEBUG   ] STDERR y.y.y.y


[DEBUG   ] loading output in ['/Users/xxx/Desktop/salt/cache/extmods/output', '/Users/xxx/Desktop/salt/virtualenv/lib/python2.7/site-packages/salt/output']

[DEBUG   ] Skipping /Users/xxx/Desktop/salt/cache/extmods/output, it is not a directory

[DEBUG   ] Loaded no_out as virtual quiet

[DEBUG   ] Loaded json_out as virtual json

[DEBUG   ] Loaded yaml_out as virtual yaml

[DEBUG   ] Loaded pprint_out as virtual pprint

xxx4:

[DEBUG   ] STDOUT x.x.x.x

{root_dir: /tmp/.salt/running_data}

_edbc7885e4f9aac9b833b5999b68d015148acf467b78fa39c056f69c0ff89878

{

    "local": []

}


[DEBUG   ] STDERR x.x.x.x

[CRITICAL] Unable to import msgpack or msgpack_pure python modules

Exception AttributeError: "'MinionEvent' object has no attribute 'cpub'" in <bound method MinionEvent.__del__ of <salt.utils.event.MinionEvent object at 0x102522c10>> ignored


[DEBUG   ] loading output in ['/Users/xxx/Desktop/salt/cache/extmods/output', '/Users/xxx/Desktop/salt/virtualenv/lib/python2.7/site-packages/salt/output']

[DEBUG   ] Skipping /Users/xxx/Desktop/salt/cache/extmods/output, it is not a directory

[DEBUG   ] Loaded no_out as virtual quiet

[DEBUG   ] Loaded json_out as virtual json

[DEBUG   ] Loaded yaml_out as virtual yaml

[DEBUG   ] Loaded pprint_out as virtual pprint

xxx3:

(virtualenv)xxx@xxx1:salt $ 


David Anderson

unread,
Nov 8, 2013, 11:34:38 AM11/8/13
to salt-...@googlegroups.com
The custom modules don't get included in a salt-ssh call at the moment.
I am sure this will be supported in the near future.
--
Dave

On 11/8/13 12:33 AM, Marc Liyanage wrote:
>
> I am trying to sync a custom module with saltutil.sync_modules, but
> nothing happens:
>
>
>
> $ salt-ssh -c config '*' test.ping
>
> [WARNING ] Warning: sshpass is not present, so password-based
> authentication is not available.
>
> host4:
>
> *True*
>
> host3:
>
> *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.
> For more options, visit https://groups.google.com/groups/opt_out.

Marc Liyanage

unread,
Nov 8, 2013, 12:05:48 PM11/8/13
to salt-...@googlegroups.com

Thanks Dave, that saved me time hunting down the issue. I'll switch to the regular minion setup.

Out of curiosity, how are file transfers implemented with the SSH transport? Using scp or something? Or is there a temporary ZeroMQ server being fired up for the duration of the salt-ssh invocation on the master?
> You received this message because you are subscribed to a topic in the Google Groups "Salt-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/salt-users/9tlo9wNcBdw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to salt-users+...@googlegroups.com.

Colton Myers

unread,
Nov 8, 2013, 6:05:36 PM11/8/13
to salt-...@googlegroups.com
Yes, this is on the list.  salt-ssh is rapidly improving but still doesn't support all the bells and whistles.  =)

--
Colton Myers

Juvenn Woo

unread,
Nov 8, 2013, 8:14:35 PM11/8/13
to salt-...@googlegroups.com

Hi Marc,

It's just scp, no ZeroMQ at the time being.

Emil Vaughan

unread,
Nov 26, 2013, 9:24:07 AM11/26/13
to salt-...@googlegroups.com

On Friday, November 8, 2013 11:05:36 PM UTC, basepi wrote:
Yes, this is on the list.  salt-ssh is rapidly improving but still doesn't support all the bells and whistles.  =)


Just wondering is this has been done yet? I couldn't find a GitHub issue. 

Colton Myers

unread,
Nov 26, 2013, 7:38:15 PM11/26/13
to salt-...@googlegroups.com
No, it has not.  If there's no issue open for this particular problem, could you please open one?

--
Colton Myers


--

colin.sch...@clever.com

unread,
Feb 21, 2014, 5:44:37 PM2/21/14
to salt-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages