Adding self installation command for fabrica

This commit is contained in:
Philippe Caseiro 2021-03-23 10:47:39 +01:00
parent 740a8de4a2
commit b360760855
120 changed files with 301 additions and 164 deletions

View File

@ -0,0 +1,5 @@
location /fabrica/ {
alias %%ROOT%%/images/;
autoindex on;
allow all;
}

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
images/ images/
packer_cache/ packer_cache/
*inventory *inventory
*~

View File

@ -43,17 +43,17 @@
- name: Adding EOLE main repository - name: Adding EOLE main repository
apt_repository: apt_repository:
repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-2.7.2 main cloud repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-{{ EOLE_VERSION }} main cloud
state: present state: present
- name: Adding EOLE security repository - name: Adding EOLE security repository
apt_repository: apt_repository:
repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-2.7.2-security main cloud repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-{{ EOLE_VERSION }}-security main cloud
state: present state: present
- name: Adding EOLE updates repository - name: Adding EOLE updates repository
apt_repository: apt_repository:
repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-2.7.2-updates main cloud repo: deb [arch=amd64] http://eole.ac-dijon.fr/eole eole-{{ EOLE_VERSION }}-updates main cloud
state: present state: present
- name: Update cache - name: Update cache
@ -65,6 +65,16 @@
http_proxy: "{{ http_proxy }}" http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}" https_proxy: "{{ https_proxy }}"
- name: Install chromium browser on 2.7.2
apt:
name: chromium-browser
environment:
HTTP_PROXY: "{{ http_proxy }}"
HTTPS_PROXY: "{{ https_proxy }}"
http_proxy: "{{ http_proxy }}"
https_proxy: "{{ https_proxy }}"
when: EOLE_VERSION == "2.7.2"
- name: Install eole-server and eole-exim-pkg - name: Install eole-server and eole-exim-pkg
apt: apt:
name: eole-server,eole-exim-pkg name: eole-server,eole-exim-pkg

View File

@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIID+DC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Iz/Sy7x4VxNwmrVqGfw9neNZ/Jhl4M2XbeD0MBjYMUqeDzCJLUCgYEA1h4R
9q9llY88fsIlA5N+s9B+0L2ur74DDsaYhKp42BPH+j531nA4ziLQ8vhbAK1iqxik
QJfoJ5iKinGfiqGQtwv+t3FPYfblQmdXNV9qjMIwWg390MJcieAXoqC84gSWK0WS
maF3Gj2d4QuUB7ddS7FhLFh+duesinhzQ1zMSrsCgYEAgTeLCXKu+d0RjBeZe90z
gP+bzBMJfi6Sl6tMoFeDhUE8fGHmaK8Tpir8LqqltIlfj29qCFenAq1ZX/4cdWGL
BZXhAi8C4/MK/3Vyma0vWQhairOuabsQZzOX6DBHfdJqCoHv47rRkj1+ONlzL7wH
MlouzUl1KZO/oSUwvxBKTzkCgYAq8JbbqOsvZi1Uomy33eGAACUeiZu5xNpqISu/
F0zq0HS/W72+tHy/4j2TLHlblmn+NA/koFI/dpj6ELVVIPebrf0kHsYzuEbb3Uug
+YStu9fkh3/KWOAkClvTEncuwIq5HNe8laQEEC1UT3UdYwmDv4vkT87025s/nc5H
yRlzNwKBgGdjN06Tr2quQJr6TKh8AisbuCOPQMeYfwVjwnEThDonQNc6+bMlDx6E
8OL1zmYsIWuNRqnIkZD1dA7VROCWYtOYZlpN1lbhGmluXEM2KmG8GZYo6G6Y4pXv
U9j9sqUW/K21BTVO2ksoQhiOW3HFdjsT7InO496L/GdKTeMqUwT0
-----END RSA PRIVATE KEY-----

View File

@ -23,6 +23,7 @@
"iso_checksum": "none", "iso_checksum": "none",
"disk_image": true, "disk_image": true,
"format": "qcow2", "format": "qcow2",
"vnc_bind_address": "0.0.0.0",
"disk_size": "{{ user `image_size` }}", "disk_size": "{{ user `image_size` }}",
"ssh_username": "root", "ssh_username": "root",
"ssh_password": "cadoles", "ssh_password": "cadoles",
@ -30,17 +31,13 @@
"accelerator": "kvm", "accelerator": "kvm",
"net_device": "virtio-net", "net_device": "virtio-net",
"disk_interface": "virtio", "disk_interface": "virtio",
"ssh_wait_timeout": "5m", "ssh_wait_timeout": "45m",
"boot_wait": "5s", "boot_wait": "5s",
"output_directory": "{{ user `output_dir` }}", "output_directory": "{{ user `output_dir` }}",
"vm_name": "{{ user `image_name` }}.img", "vm_name": "{{ user `image_name` }}.img",
"headless": true, "headless": true,
"qemuargs": [ "cpus": "2",
[ "memory" : "4096"
"-m",
"2048"
]
]
} }
], ],
"provisioners": [ "provisioners": [
@ -67,12 +64,22 @@
{ {
"type": "ansible", "type": "ansible",
"playbook_file": "{{user `eole_playbooks`}}/eole.yml", "playbook_file": "{{user `eole_playbooks`}}/eole.yml",
"extra_arguments": [ "-vvvv", "--extra-vars", "VM_NAME={{ user `vm_name` }} HTTP_PROXY={{ user `HTTP_PROXY` }} HTTPS_PROXY={{ user `HTTPS_PROXY` }} http_proxy={{ user `http_proxy` }} https_proxy={{ user `https_proxy` }}"] "extra_arguments": [
"--extra-vars",
"VM_NAME={{ user `vm_name` }} EOLE_VERSION={{ user `eole_version` }}",
"--extra-vars",
"HTTP_PROXY={{ user `HTTP_PROXY` }} HTTPS_PROXY={{ user `HTTPS_PROXY` }} http_proxy={{ user `http_proxy` }} https_proxy={{ user `https_proxy` }}"
]
}, },
{ {
"type":"ansible", "type":"ansible",
"playbook_file":"{{ user `eole_playbooks` }}/provision.yml", "playbook_file":"{{ user `eole_playbooks` }}/provision.yml",
"extra_arguments": [ "--extra-vars", "VM_NAME={{ user `vm_name` }} HTTP_PROXY={{ user `HTTP_PROXY` }} HTTPS_PROXY={{ user `HTTPS_PROXY` }} http_proxy={{ user `http_proxy` }} https_proxy={{ user `https_proxy` }}"] "extra_arguments": [
"--extra-vars",
"VM_NAME={{ user `vm_name` }} EOLE_VERSION={{ user `eole_version` }}",
"--extra-vars",
"HTTP_PROXY={{ user `HTTP_PROXY` }} HTTPS_PROXY={{ user `HTTPS_PROXY` }} http_proxy={{ user `http_proxy` }} https_proxy={{ user `https_proxy` }}"
]
} }
], ],
"post-processors": [ "post-processors": [

View File

@ -27,6 +27,7 @@
"iso_urls": [ "{{ user `ubuntu_mirror` }}{{ user `ubuntu_codename` }}-updates/main/installer-amd64/current/images/netboot/mini.iso" ], "iso_urls": [ "{{ user `ubuntu_mirror` }}{{ user `ubuntu_codename` }}-updates/main/installer-amd64/current/images/netboot/mini.iso" ],
"ssh_username": "{{ user `ssh_username` }}", "ssh_username": "{{ user `ssh_username` }}",
"ssh_password": "{{ user `ssh_password` }}", "ssh_password": "{{ user `ssh_password` }}",
"vnc_bind_address": "0.0.0.0",
"ssh_wait_timeout": "60m", "ssh_wait_timeout": "60m",
"headless": "{{ user `headless` }}", "headless": "{{ user `headless` }}",
"output_directory": "{{ template_dir }}/../../../images/ubuntu/18.04", "output_directory": "{{ template_dir }}/../../../images/ubuntu/18.04",

View File

@ -49,6 +49,8 @@ systemctl disable apt-daily
systemctl disable apt-daily.timer systemctl disable apt-daily.timer
systemctl disable apt-daily-upgrade systemctl disable apt-daily-upgrade
apt-get install -y qemu-guest-agent
# Cleanup # Cleanup
rm -f "${ONE_CONTEXT_PACKAGE_DEST}" rm -f "${ONE_CONTEXT_PACKAGE_DEST}"
apt-get -y clean apt-get -y clean

View File

@ -22,7 +22,7 @@ provider "dns" {
/* /*
* Virtual networks * Virtual networks
*/ */
resource "opennebula_virtual_network" "vnet"{ resource "opennebula_virtual_network" "vnets"{
for_each = var.virtual_networks for_each = var.virtual_networks
name = each.key name = each.key
vlan_id = each.value.vlan_id vlan_id = each.value.vlan_id
@ -60,7 +60,7 @@ module "vms" {
vcpu = each.value.vcpu vcpu = each.value.vcpu
ram = each.value.memory ram = each.value.memory
vnets = opennebula_virtual_network.vnet vnets = opennebula_virtual_network.vnets
network_interfaces = each.value.network_interfaces network_interfaces = each.value.network_interfaces
tag_labels = each.value.labels tag_labels = each.value.labels
@ -72,7 +72,8 @@ module "vms" {
data_image_source = "" data_image_source = ""
depends = [ depends = [
opennebula_virtual_network.vnet[each.value.depends[0]].id for dp in each.value.network_interfaces:
opennebula_virtual_network.vnets[dp.network_name].id
] ]
} }

Some files were not shown because too many files have changed in this diff Show More