Ask Your Question
0

Get Google Drive permissions for Insync

asked 2015-09-25 09:25:15 -0500

T4ng10r gravatar image

Hi, My manifest prepares and installs Insync (commercial Google Drive client). Next step is authorizing client by using Authorization Code during command line account creation. It looks

  ...
  } ->
  package{"insync" : 
          ensure => installed, 
          require => Exec['apt_update'],
  } ->
  exec {'insync_start' :
    command => '/usr/bin/insync-headless start',
  } ->
  exec {'insync_pause' :
    command => '/usr/bin/insync-headless pause_syncing'
  } ->
  exec {'insync_new_account' :
    command => "/usr/bin/insync-headless add_account ${insync_auth_code} ${$insync_dest_dir}"
  }

Insync sends me to page http://goo.gl/kTvy0y where I can give access permissions and receive Authentication Code. This code is valid only for some time.

My question is - HOW to acquire Google Drive Authentication Code? So each time puppet is applied - account is connected?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-09-25 10:46:11 -0500

could you run via exec curl or wget to download the info you need?

exec {'getdat':,
    command => '/usr/bin/curl -k -s -1 http://goo.gl/blah|command to run data'

}

cheers Stuart

edit flag offensive delete link more

Comments

It wont help. goo.gl... link is redirect and to make things more complex - next page requires user to click ALLOW button, then it provide another page with Auth Code. So curl wont help. Unless I use some handmade script to aquire this code and return it to puppet.

T4ng10r gravatar imageT4ng10r ( 2015-09-25 13:08:45 -0500 )edit
0

answered 2015-09-25 10:54:59 -0500

GregLarkin gravatar image

Unless the insync client or Google provide a way to retrieve the code non-interactively, it will be difficult to do so. As you know, Puppet will not execute anything that requires interactive input.

However, it looks like other folks have had this same issue in a variety of forums, so maybe this will help: http://stackoverflow.com/questions/25943631/how-can-i-create-google-apps-user-account-programatically

edit flag offensive delete link more

Comments

Unfortunately - this is interactive connection. I need to click allow button and next page will provide AuthCode. I though that there's some ready to use procedure or module. I will look at provided link.

T4ng10r gravatar imageT4ng10r ( 2015-09-25 13:10:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-09-25 09:25:15 -0500

Seen: 5,709 times

Last updated: Sep 25 '15