Commit c81afc83 authored by eric pellegrini's avatar eric pellegrini

replaced parameters templates by environment in example manifest files

parent 2a5bf109
parameters:
base_image: "base-ntp"
vm_name: base-autofs
build_output_directory: builds
ssh_username: root
packer:
description: "Template for ILL + ntp + autofs"
builders:
- name: qemu
type: qemu
vm_name: "{{ parameters.vm_name }}"
vm_name: "{{ environment.vm_name }}"
boot_command: none
iso_checksum_type: none
iso_checksum_url: none
disk_image: True
iso_url: "./builds/{{ parameters.base_image }}-qemu-base/{{ parameters.base_image }}"
ssh_username: "{{ parameters.ssh_username }}"
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: "{{ parameters.build_output_directory }}/{{ parameters.vm_name }}-qemu-base"
output_directory: "{{ environment.build_output_directory }}/{{ environment.vm_name }}-qemu-base"
provisioners:
- type: shell
......
parameters:
vm_name: base-ill
proxy: http://proxy.ill.fr:8888
no_proxy: localhost,127.0.0.1,apt.ill.fr,*.ill.eu,*.ill.fr
dns_servers: 195.83.126.2 195.83.126.11
gateway: 192.168.180.254
cpus: 2
memory: 4096
disk_size: 40000
ubuntu_mirror: http://archive.ubuntu.com/ubuntu/dists
ubuntu_codename: bionic
ubuntu_docker_image: ubuntu:18.04
preseed_file_name: preseed-base-ill.cfg
ssh_username: root
user: si-admin
user_fullname: si-admin
headless: false
build_output_directory: builds
packer:
description: "Base template for ILL"
......@@ -25,47 +6,46 @@ packer:
builders:
- name: qemu
type: qemu
vm_name: "{{ parameters.vm_name }}"
format: qcow2
iso_checksum_type: sha256
iso_checksum_url: "{{ parameters.ubuntu_mirror }}/{{ parameters.ubuntu_codename }}-updates/main/installer-amd64/current/images/SHA256SUMS"
iso_url: "{{ parameters.ubuntu_mirror }}/{{ parameters.ubuntu_codename }}-updates/main/installer-amd64/current/images/netboot/mini.iso"
ssh_username: "{{ parameters.ssh_username }}"
iso_checksum_url: "{{ environment.ubuntu_mirror }}/{{ environment.ubuntu_codename }}-updates/main/installer-amd64/current/images/SHA256SUMS"
iso_url: "{{ environment.ubuntu_mirror }}/{{ environment.ubuntu_codename }}-updates/main/installer-amd64/current/images/netboot/mini.iso"
ssh_username: "{{ environment.ssh_username }}"
ssh_password: "{{ environment.root_password }}"
ssh_timeout: 60m
accelerator: kvm
headless: "{{ parameters.headless }}"
headless: "{{ environment.headless_run }}"
shutdown_command: "shutdown -P now"
qemuargs:
- - "-m"
- "{{ parameters.memory }}"
- "{{ environment.memory }}"
- - "-smp"
- "{{ parameters.cpus }}"
- "{{ environment.cpus }}"
boot_wait: 5s
boot_command:
- "<tab> "
- "preseed/url=http://{% raw %}{{ .HTTPIP }}:{{ .HTTPPort }}{% endraw %}/{{ parameters.preseed_file_name }} "
- "preseed/url=http://{% raw %}{{ .HTTPIP }}:{{ .HTTPPort }}{% endraw %}/{{ environment.preseed_file_name }} "
- "auto-install/enable=true "
- "net.ifnames=0 "
- "netcfg/get_hostname={{ parameters.vm_name }} "
- "netcfg/get_gateway={{ parameters.gateway}} "
- "netcfg/get_nameservers={{ parameters.dns_servers }} "
- "netcfg/hostname={{ parameters.vm_name }} "
- "mirror/http/proxy={{ parameters.proxy}} "
- "passwd/user-fullname={{ parameters.user }} "
- "passwd/username={{ parameters.user_fullname }} "
- "netcfg/get_hostname={{ environment.vm_name }} "
- "netcfg/get_gateway={{ environment.gateway}} "
- "netcfg/get_nameservers={{ environment.dns_servers }} "
- "netcfg/hostname={{ environment.vm_name }} "
- "mirror/http/proxy={{ environment.proxy}} "
- "passwd/user-fullname={{ environment.user }} "
- "passwd/username={{ environment.user_fullname }} "
- "passwd/user-password= {{ environment.user_password }} "
- "passwd/user-password-again= {{ environment.user_password }} "
- "passwd/root-password={{ environment.root_password }} "
- "passwd/root-password-again={{ environment.root_password }} "
- "no_proxy={% raw %}{{ .HTTPIP }}{% endraw %},{{ parameters.no_proxy }} "
- "no_proxy={% raw %}{{ .HTTPIP }}{% endraw %},{{ environment.no_proxy }} "
- "<enter>"
disk_size: "{{ parameters.disk_size }}"
disk_size: "{{ environment.disk_size }}"
http_directory: "http"
provisioners:
- type: file
source: "system/etc/apt/sources.list_{{ parameters.ubuntu_codename }}"
source: "system/etc/apt/sources.list_{{ environment.ubuntu_codename }}"
destination: "/etc/apt/sources.list"
- type: file
......
parameters:
base_image: base-ill
vm_name: ill-ntp
build_output_directory: builds
ssh_username: root
packer:
description: "Template for ILL + ntp"
......@@ -13,16 +7,16 @@ packer:
builders:
- name: qemu
type: qemu
vm_name: "{{ parameters.vm_name }}"
vm_name: "{{ environment.vm_name }}"
boot_command: none
iso_checksum_type: none
iso_checksum_url: none
disk_image: True
iso_url: "./builds/{{ parameters.base_image }}-qemu-base/{{ parameters.base_image }}"
ssh_username: "{{ parameters.ssh_username }}"
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: "{{ parameters.build_output_directory }}/{{ parameters.vm_name }}-qemu-base"
output_directory: "{{ environment.build_output_directory }}/{{ environment.vm_name }}-qemu-base"
provisioners:
- type: shell
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment