Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3312

cf-remote can't install on locally hosted vagrant provisioned vms running in Virtualbox

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: contrib: cf-remote
    • Labels:
      None

      Description

      I brought up the vagrant quickstart environment using --no-provision. I can't seem to get cf-remote to install packages on the hosts.

      vagrant up --no-provision
      ...
          hub: /vagrant => /home/nickanderson/vagrant/CFEngine/3.15.1-1
          hub: /CFEngine => /home/nickanderson/Northern.Tech/CFEngine
      ==> hub: Machine not provisioned because `--no-provision` is specified.
      ...
          host001: /vagrant => /home/nickanderson/vagrant/CFEngine/3.15.1-1
      ==> host001: Machine not provisioned because `--no-provision` is specified.      
           
      > $ vagrant ssh hub --command ifconfig                                                                                                                                                                                                                                       
      eth0      Link encap:Ethernet  HWaddr 08:00:27:9A:98:53  
                inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
                inet6 addr: fe80::a00:27ff:fe9a:9853/64 Scope:Link
                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                RX packets:1722 errors:0 dropped:0 overruns:0 frame:0
                TX packets:1349 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:1000 
                RX bytes:218429 (213.3 KiB)  TX bytes:229338 (223.9 KiB)
      
      eth1      Link encap:Ethernet  HWaddr 08:00:27:F1:E0:CA  
                inet addr:192.168.33.2  Bcast:192.168.33.255  Mask:255.255.255.0
                inet6 addr: fe80::a00:27ff:fef1:e0ca/64 Scope:Link
                UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
                RX packets:521 errors:0 dropped:0 overruns:0 frame:0
                TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:1000 
                RX bytes:141652 (138.3 KiB)  TX bytes:35316 (34.4 KiB)
      
      lo        Link encap:Local Loopback  
                inet addr:127.0.0.1  Mask:255.0.0.0
                inet6 addr: ::1/128 Scope:Host
                UP LOOPBACK RUNNING  MTU:16436  Metric:1
                RX packets:0 errors:0 dropped:0 overruns:0 frame:0
                TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
                collisions:0 txqueuelen:0 
                RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
      
      Connection to 127.0.0.1 closed.                                               
      

      It's not prompting me for a password, just fails to ssh into the host.

      > $ cf-remote info -H vagrant@192.168.33.2                                                                                                                                                                                                                                   
      Could not ssh into '192.168.33.2'
      
      > $ cf-remote info -H vagrant@localhost:2222                                                                                                                                                                                                                                 
      Could not ssh into 'localhost:2222'
      

      So, I tried setting CF_REMOTE_SSH_KEY

      > $ vagrant ssh-config                                                                                                                                                                                                                                                       
      Host hub
        HostName 127.0.0.1
        User vagrant
        Port 2222
        UserKnownHostsFile /dev/null
        StrictHostKeyChecking no
        PasswordAuthentication no
        IdentityFile /home/nickanderson/vagrant/CFEngine/3.15.1-1/.vagrant/machines/hub/virtualbox/private_key
        IdentitiesOnly yes
        LogLevel FATAL
      
      Host host001
        HostName 127.0.0.1
        User vagrant
        Port 2200
        UserKnownHostsFile /dev/null
        StrictHostKeyChecking no
        PasswordAuthentication no
        IdentityFile /home/nickanderson/vagrant/CFEngine/3.15.1-1/.vagrant/machines/host001/virtualbox/private_key
        IdentitiesOnly yes
        LogLevel FATAL
      
      > $ export CF_REMOTE_SSH_KEY="/home/nickanderson/vagrant/CFEngine/3.15.1-1/.vagrant/machines/hub/virtualbox/private_key"
      

      But, I just get tracebacks when that is set.

      > $ cf-remote info -H 192.168.33.2                                                                                                                                                                                                                                           
      Traceback (most recent call last):
        File "/home/nickanderson/bin/cf-remote", line 11, in <module>
          main()
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/main.py", line 310, in main
          run_command_with_args(args.command, args)
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/main.py", line 92, in run_command_with_args
          commands.info(args.hosts, None)
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/commands.py", line 19, in info
          data = get_info(host, users=users)
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/ssh.py", line 51, in connect_wrapper
          with connect(host, users=kwargs.get("users")) as connection:
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/ssh.py", line 34, in connect
          host=host, user=user, connect_kwargs=connect_kwargs)
        File "/usr/local/lib/python3.7/dist-packages/fabric/connection.py", line 431, in __init__
          self.connect_kwargs = self.resolve_connect_kwargs(connect_kwargs)
        File "/usr/local/lib/python3.7/dist-packages/fabric/connection.py", line 471, in resolve_connect_kwargs
          connect_kwargs["key_filename"].extend(
      AttributeError: 'str' object has no attribute 'extend'
      
      > $ cf-remote info -H localhost:2222                                                                                                                                                                                                                                         
      Traceback (most recent call last):
        File "/home/nickanderson/bin/cf-remote", line 11, in <module>
          main()
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/main.py", line 310, in main
          run_command_with_args(args.command, args)
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/main.py", line 92, in run_command_with_args
          commands.info(args.hosts, None)
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/commands.py", line 19, in info
          data = get_info(host, users=users)
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/ssh.py", line 51, in connect_wrapper
          with connect(host, users=kwargs.get("users")) as connection:
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/ssh.py", line 34, in connect
          host=host, user=user, connect_kwargs=connect_kwargs)
        File "/usr/local/lib/python3.7/dist-packages/fabric/connection.py", line 431, in __init__
          self.connect_kwargs = self.resolve_connect_kwargs(connect_kwargs)
        File "/usr/local/lib/python3.7/dist-packages/fabric/connection.py", line 471, in resolve_connect_kwargs
          connect_kwargs["key_filename"].extend(
      AttributeError: 'str' object has no attribute 'extend'
      
      > $ cf-remote info -H vagrant@192.168.33.2                                                                                                                                                                                                                                   
      Traceback (most recent call last):
        File "/home/nickanderson/bin/cf-remote", line 11, in <module>
          main()
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/main.py", line 310, in main
          run_command_with_args(args.command, args)
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/main.py", line 92, in run_command_with_args
          commands.info(args.hosts, None)
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/commands.py", line 19, in info
          data = get_info(host, users=users)
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/ssh.py", line 51, in connect_wrapper
          with connect(host, users=kwargs.get("users")) as connection:
        File "/home/nickanderson/src/cfengine-core/contrib/cf-remote/cf_remote/ssh.py", line 34, in connect
          host=host, user=user, connect_kwargs=connect_kwargs)
        File "/usr/local/lib/python3.7/dist-packages/fabric/connection.py", line 431, in __init__
          self.connect_kwargs = self.resolve_connect_kwargs(connect_kwargs)
        File "/usr/local/lib/python3.7/dist-packages/fabric/connection.py", line 471, in resolve_connect_kwargs
          connect_kwargs["key_filename"].extend(
      AttributeError: 'str' object has no attribute 'extend'
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              a10042 Nick Anderson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel