Recette de construction de l'image "Hydra" basée sur Debian #7
|
@ -0,0 +1,44 @@
|
|||
#Flavour base
|
||||
build {
|
||||
name = "hydra"
|
||||
description = <<EOF
|
||||
This builder build a Debian 12 image for Ory Hydra
|
||||
EOF
|
||||
source "hydra.vmware-vmx.debian" {
|
||||
output_directory = "${var.output_dir}/${var.version}/hydra"
|
||||
vm_name = "hydra-${local.output_name}-${var.version}"
|
||||
source_path = "${var.output_dir}/${var.version}/base/${local.output_name}-${var.version}.vmx"
|
||||
boot_command = [ "<enter><enter><wait>" ]
|
||||
ssh_clear_authorized_keys = true
|
||||
wpetit marked this conversation as resolved
Outdated
|
||||
vmx_data_post = {
|
||||
"memsize" = "2048",
|
||||
"numvcpus" = "2",
|
||||
}
|
||||
}
|
||||
|
||||
// Clone ansible-role-sso repository
|
||||
provisioner "ansible" {
|
||||
playbook_file = "${local.locations.provisionning}/hydra/clone-role-sso.yml"
|
||||
// Manjaro/Arch OpenSSH version compatibility mode
|
||||
// See https://github.com/hashicorp/packer/issues/11783
|
||||
extra_arguments = [ "--scp-extra-args", "'-O'", "-v" ]
|
||||
}
|
||||
|
||||
// Run ansible-role-sso playbook from cloned repository
|
||||
provisioner "ansible" {
|
||||
playbook_file = "${local.locations.provisionning}/hydra/run-role-sso.yml"
|
||||
// Manjaro/Arch OpenSSH version compatibility mode
|
||||
// See https://github.com/hashicorp/packer/issues/11783
|
||||
extra_arguments = [ "--scp-extra-args", "'-O'", "-v", "--extra-vars=@${local.locations.provisionning}/hydra/ansible-vars.yml" ]
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
inline = [
|
||||
"/bin/sh ${path.cwd}/post-processors/sparsify.sh ${var.output_dir}/${var.version}/hydra ${var.image_version}",
|
||||
]
|
||||
}
|
||||
|
||||
post-processor "manifest" {
|
||||
keep_input_artifact = true
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
/role-sso
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
hydra_use_external_database: true
|
||||
|
||||
enable_hydra_dispatcher: true
|
||||
enable_hydra_passwordless: false
|
||||
enable_hydra_saml: true
|
||||
enable_hydra_oidc: true
|
||||
enable_hydra_ldap: false
|
||||
enable_oidc_test_app: false
|
||||
|
||||
install_only: true
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: Ciblage de la machine locale
|
||||
hosts: localhost
|
||||
connection: local
|
||||
tasks:
|
||||
- name: Clonage du projet "Cadoles/ansible-role-sso"
|
||||
ansible.builtin.git:
|
||||
repo: "ssh://git@forge.cadoles.com:2222/Cadoles/ansible-role-sso.git"
|
||||
dest: "role-sso"
|
||||
version: "master"
|
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
- hosts: all
|
||||
roles: [ role-sso ]
|
|
@ -0,0 +1,23 @@
|
|||
# Flavor "Hydra"
|
||||
|
||||
## Construction de l'image
|
||||
|
||||
1. Lancer la construction de l'image de la machine virtuelle
|
||||
|
||||
```
|
||||
PACKER_OPTS="-var headless=false" ./build start debian 12
|
||||
```
|
||||
|
||||
ou si l'image Debian de base est déjà construite:
|
||||
|
||||
```
|
||||
BUILDER="vmware-vmx" PACKER_OPTS="-var headless=false" ./build run debian 12 hydra
|
||||
```
|
||||
|
||||
> **Tip** Le paramètre `PACKER_OPTS="-var headless=false"` n'est nécessaire que dans le cas où vous souhaitez l'exécuteur VMWare avec son interface graphique.
|
||||
|
||||
## Générer le fichier OVF à partir de l'OVA
|
||||
|
||||
```
|
||||
ovftool output/debian/12.2.0/hydra/hydra-debian-12.2.0.ova output/debian/12.2.0/hydra/hydra-debian-12.2.0.ovf
|
||||
```
|
Loading…
Reference in New Issue
Je penses qu'il faut ajouter :
Pour être raccord avec les "besoins" du service.
Enfin ceci-dit c'est optionnel vu qu'on peut toujours ajouter à la pocédure d'import une modification des ressources au moment du déploiement (il faut juste ne pas oublier).