Skip to content

Commit

Permalink
Use Python pip to install VMware ESXi deps instead of git sub modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrager committed May 20, 2021
1 parent 8541e55 commit fea3d85
Show file tree
Hide file tree
Showing 18 changed files with 8 additions and 63 deletions.
24 changes: 0 additions & 24 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,24 +0,0 @@
[submodule "vmware-esxi/pyyaml"]
path = vmware-esxi/pyyaml
url = https://github.com/yaml/pyyaml
[submodule "vmware-esxi/oauthlib"]
path = vmware-esxi/oauthlib
url = https://github.com/oauthlib/oauthlib
[submodule "vmware-esxi/ipaddr"]
path = vmware-esxi/ipaddr
url = https://github.com/google/ipaddr-py
[submodule "vmware-esxi/requests"]
path = vmware-esxi/requests
url = https://github.com/kennethreitz/requests
[submodule "vmware-esxi/urllib3"]
path = vmware-esxi/urllib3
url = https://github.com/urllib3/urllib3
[submodule "vmware-esxi/chardet"]
path = vmware-esxi/chardet
url = https://github.com/chardet/chardet
[submodule "vmware-esxi/python-certifi"]
path = vmware-esxi/python-certifi
url = https://github.com/certifi/python-certifi
[submodule "vmware-esxi/idna"]
path = vmware-esxi/idna
url = https://github.com/kjd/idna
15 changes: 0 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,3 @@ If you wish to use QEMU's UI also remove "headless": true

If you keep "headless": true you can connect using VNC. Packer will output the
IP and port to connect to when run.

## Git Submodules
Packer MAAS uses git submodules to retrieve required resource files during
image building. Packer MAAS and all submodules can be cloned at once with:

```
$ git clone --recurse-submodules [email protected]:canonical/packer-maas.git
```

If Packer MAAS has already been checked out submodules can be retrieved with

```
$ git submodule init
$ git submodule update
```
1 change: 0 additions & 1 deletion vmware-esxi/chardet
Submodule chardet deleted from 9b8c5c
File renamed without changes.
1 change: 0 additions & 1 deletion vmware-esxi/idna
Submodule idna deleted from 1cdf17
1 change: 0 additions & 1 deletion vmware-esxi/ipaddr
Submodule ipaddr deleted from 99e555
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion vmware-esxi/oauthlib
Submodule oauthlib deleted from 31cae7
1 change: 0 additions & 1 deletion vmware-esxi/python-certifi
Submodule python-certifi deleted from 21abb9
1 change: 0 additions & 1 deletion vmware-esxi/pyyaml
Submodule pyyaml deleted from 2f463c
1 change: 0 additions & 1 deletion vmware-esxi/requests
Submodule requests deleted from aeda65
4 changes: 4 additions & 0 deletions vmware-esxi/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ipaddr==2.2.0
oauthlib==3.1.0
PyYAML==5.4.1
requests==2.25.1
1 change: 0 additions & 1 deletion vmware-esxi/urllib3
Submodule urllib3 deleted from f8fc8f
20 changes: 4 additions & 16 deletions vmware-esxi/vmware-esxi.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,14 @@
"TMP_DIR=$(mktemp -d /tmp/packer-maas-XXXX)",
"echo 'Adding curtin-hooks to image...'",
"mount ${nbd}p1 $TMP_DIR",
"mkdir -p $TMP_DIR/curtin",
"cp curtin-hooks $TMP_DIR/curtin",
"cp -r curtin $TMP_DIR",
"sync -f $TMP_DIR/curtin",
"umount $TMP_DIR",
"echo 'Adding post-install scripts to image...'",
"mount ${nbd}p6 $TMP_DIR",
"mkdir -p $TMP_DIR/maas",
"cp -r pyyaml/lib3/yaml $TMP_DIR/maas",
"cp -r oauthlib/oauthlib $TMP_DIR/maas",
"cp -r urllib3/urllib3 $TMP_DIR/maas",
"cp -r chardet/chardet $TMP_DIR/maas",
"cp -r python-certifi/certifi $TMP_DIR/maas",
"cp -r idna/idna $TMP_DIR/maas",
"cp -r requests/requests $TMP_DIR/maas",
"cp maas-md-get $TMP_DIR/maas",
"cp ipaddr/ipaddr.py $TMP_DIR/maas",
"cp netplan-esxi $TMP_DIR/maas",
"cp storage-esxi $TMP_DIR/maas",
"cp vendor-data-esxi $TMP_DIR/maas",
"cp vcenter $TMP_DIR/maas",
"cp -r maas $TMP_DIR",
"python3 -m pip install -r requirements.txt --no-compile --target $TMP_DIR/maas",
"find $TMP_DIR/maas -name __pycache__ -type d -or -name *.so | xargs rm -rf",
"echo 'Unmounting image...'",
"sync -f $TMP_DIR/maas",
"umount $TMP_DIR",
Expand Down

0 comments on commit fea3d85

Please sign in to comment.