If you are using GitLab outside of the ILL, then you will need to use HTTPS and not SSH for clone/push/pull operations. If you are using the VPN, then SSH will work normally.

...
 
Commits (4)
version 0.4.0
-------------
* CHANGED the vm_name is now part of the Jinja2 environment
* CHANGED cleaned up manifest and environment files
* ADDED added new Exception class
version 0.3.0
-------------
* CHANGED merged parameters templates into environment
......
......@@ -22,7 +22,7 @@ class PackerTemplate:
"""Constructor
"""
self._name = name
self._name = name
self._packages_base_dir = packages_base_dir
self._templates_base_dir = templates_base_dir
......@@ -70,6 +70,8 @@ class PackerTemplate:
return
self._environment = {}
# The vm_name is set as part of the jinja environment
self._environment["vm_name"] = self._name
with open(environment_file, "r") as fin:
env = yaml.safe_load(fin)
......
......@@ -8,6 +8,9 @@ from typing import Any, Dict, List, Optional
from .PackerTemplate import PackerTemplate
class TemplatesSelectionError(Exception):
pass
class Packman:
"""This class implements the Packman engine for generating packer template json files and run packer optionally .
"""
......@@ -59,6 +62,9 @@ class Packman:
else:
# Filter out the image names not present in the yaml file
templates = [template for template in selected_templates if template in self._templates]
if not selected_templates:
raise TemplatesSelectionError("Empty templates selection")
return templates
......
......@@ -20,7 +20,7 @@ __status__ : str = "Prototype"
__url__ : str = "https://code.ill.fr/panosc/data-analysis-services/packme"
__version__ : str = "0.3.0"
__version__ : str = "0.4.0"
__long_description_content_type__ : str ="text/markdown"
......
environment:
base_image: "base-ntp"
vm_name: base-autofs
build_output_directory: builds
ssh_username: root
......@@ -4,16 +4,13 @@ packer:
builders:
- name: qemu
type: qemu
vm_name: "{{ environment.vm_name }}"
boot_command: none
iso_checksum_type: none
iso_checksum_url: none
disk_image: True
iso_url: "./builds/{{ environment.base_image }}-qemu-base/{{ environment.base_image }}"
ssh_username: "{{ environment.ssh_username }}"
ssh_password: "{{ environment.root_password }}"
shutdown_command: "shutdown -P now"
output_directory: "{{ environment.build_output_directory }}/{{ environment.vm_name }}-qemu-base"
provisioners:
- type: shell
......
......@@ -13,4 +13,3 @@ environment:
ssh_username: root
user: si-admin
user_fullname: si-admin
build_output_directory: builds
environment:
base_image: base-ill
vm_name: ill-ntp
build_output_directory: builds
ssh_username: root
......@@ -7,16 +7,13 @@ packer:
builders:
- name: qemu
type: qemu
vm_name: "{{ environment.vm_name }}"
boot_command: none
iso_checksum_type: none
iso_checksum_url: none
disk_image: True
iso_url: "./builds/{{ environment.base_image }}-qemu-base/{{ environment.base_image }}"
ssh_username: "{{ environment.ssh_username }}"
ssh_password: "{{ environment.root_password }}"
shutdown_command: "shutdown -P now"
output_directory: "{{ environment.build_output_directory }}/{{ environment.vm_name }}-qemu-base"
provisioners:
- type: shell
......