mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
Merge pull request #448 from CMeza99/ec2_driver_aws
select version for amzn-driver
This commit is contained in:
commit
08193cf002
3 changed files with 40 additions and 3 deletions
|
@ -124,6 +124,28 @@ Example:
|
|||
virtualization: hvm
|
||||
enhanced_networking: simple
|
||||
|
||||
Amazon Drivers
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
Define the version for the Amazon Elastic Network
|
||||
Adapter (ENA) driver.
|
||||
Read more about this on the `Amazon Drivers git repo`__.
|
||||
|
||||
__ https://github.com/amzn/amzn-drivers
|
||||
|
||||
- ``amzn-driver-version``: Default: master
|
||||
Valid values: ``master``, ``#.#.#``
|
||||
``optional``
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
---
|
||||
provider:
|
||||
name: ec2
|
||||
amzn-driver-version: 1.5.0
|
||||
|
||||
Image
|
||||
~~~~~
|
||||
|
||||
|
|
|
@ -24,6 +24,9 @@ properties:
|
|||
enum:
|
||||
- none
|
||||
- simple
|
||||
amzn-driver-version:
|
||||
type: string
|
||||
pattern: "^([0-9]+\\.?){3}$"
|
||||
required: [description, virtualization]
|
||||
system:
|
||||
type: object
|
||||
|
|
|
@ -135,13 +135,25 @@ class InstallENANetworking(Task):
|
|||
|
||||
@classmethod
|
||||
def run(cls, info):
|
||||
version = '1.0.0'
|
||||
drivers_url = 'https://github.com/amzn/amzn-drivers'
|
||||
version = info.manifest.provider.get('amzn-driver-version', 'master')
|
||||
|
||||
if version != 'master':
|
||||
version = 'ena_linux_' + version
|
||||
|
||||
drivers_url = 'https://codeload.github.com/amzn/amzn-drivers/tar.gz/' + version
|
||||
module_path = os.path.join(info.root, 'usr', 'src',
|
||||
'amzn-drivers-%s' % (version))
|
||||
archive = os.path.join(info.root, 'tmp', 'amzn-drivers-%s.tar.gz' % (version))
|
||||
|
||||
import urllib
|
||||
urllib.urlretrieve(drivers_url, archive)
|
||||
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
log_check_call(['git', 'clone', drivers_url, module_path])
|
||||
log_check_call(['tar', '--ungzip',
|
||||
'--extract',
|
||||
'--file', archive,
|
||||
'--directory', os.path.join(info.root, 'usr',
|
||||
'src')])
|
||||
|
||||
with open(os.path.join(module_path, 'dkms.conf'), 'w') as dkms_conf:
|
||||
dkms_conf.write("""PACKAGE_NAME="ena"
|
||||
|
|
Loading…
Add table
Reference in a new issue