libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugh Esco (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LIBCLOUD-394) ScriptDeployment needs to pass command line arguments to its uploaded script
Date Tue, 10 Sep 2013 12:54:51 GMT

    [ https://issues.apache.org/jira/browse/LIBCLOUD-394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13763012#comment-13763012
] 

Hugh Esco commented on LIBCLOUD-394:
------------------------------------

Thank you for the prompt reply.  

To be clear about my use case:  

I have a puppet master to handle the work of configuration management.  My deployment script
is intended merely to boot strap the new instance to be ready to interact with the puppet
master, configuring networking, locking it down with its initial iptable rules, installing
a certificate, updating /etc/apt/sources.list, installing and configuring puppet and sending
a csr to the puppet master.  

But I also have multiple clients for whom I want this same script to work.  I have been able
to parameterize the deploy.py and the deploy.sh scripts, but the bash script (which gets put
out to the server by ScriptDeployment) needs an account passed on the command line to sort
out how to configure /etc/hosts and the puppet.conf.  That argument is required to calculate
a FQDN on which much else depends.  account is a five or eight character arbitrary string
in this case.  

The script I want to run starts on my local work station, and gets copied out by deploy.py,
from where I want to run it with an argument.  

Specifically, my code looks like this:

{code}
   # Run the puppet install script
   deployment_script = "deploy-puppet-on-wheezy.sh"
   # % account # attempts to pass this argument here blow up when the 'file' can not be found
   print 'Our deployment script is ', deployment_script
   install_puppet = ScriptDeployment(open(os.path.expanduser( deployment_script )).read(),
server, account)
   # attempts to pass account here are simply ignored

   # Multiple-step deployment that installs our SSH key and Puppet
   multideploy = MultiStepDeployment([install_key, install_puppet])

   # Creates our new server, runs deployment steps.
   node = driver.deploy_node(name=server, image=image, size=size, deploy=multideploy)

{code}

                
> ScriptDeployment needs to pass command line arguments to its uploaded script
> ----------------------------------------------------------------------------
>
>                 Key: LIBCLOUD-394
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-394
>             Project: Libcloud
>          Issue Type: Improvement
>          Components: Compute
>    Affects Versions: 0.13.1
>            Reporter: Hugh Esco
>
> All attempts to pass a command line argument to my deployment script 
> have failed and a review of the pydoc for this module reveal no clues 
> about how to accomplish this task.  
> I would urge a syntax like the following:
> class FileDeployment(Deployment)
> __init__(self, source, target, args)
> where args would be a scalar representation of the 
> command line arguments to be passed to the deployment script.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message