fabrica/packer/recipes/infra/cadoles.com/production/sso.json

118 lines
3.9 KiB
JSON
Raw Normal View History

{
"variables": {
"HTTP_PROXY": "{{ env `HTTP_PROXY` }}",
"HTTPS_PROXY": "{{ env `HTTPS_PROXY` }}",
"http_proxy": "{{ env `http_proxy` }}",
"https_proxy": "{{ env `https_proxy` }}",
"domain": "{{ env `DOMAIN` }}",
"provisionning_dir": "{{ template_dir }}/../../../../provisioning",
"playbooks_dir": "{{ user `provisionning_dir` }}/playbooks",
"infra_provisionning": "{{ user `provisionning_dir`}}/infra/{{ user `domain` }}",
"infra_playbooks": "{{ user `provisionning_dir` }}/playbooks/infra/{{ user `domain` }}",
"vm_name": "{{ env `VM_NAME` }}",
"image_output_directory": "{{ template_dir }}/../../../images/infra/cadoles.com/production/{{ user `vm_name`}}/system",
"syst_image_file": "{{ user `image_output_directory` }}/{{ user `vm_name` }}.img",
"eole_module" : "eolebase",
"image_version": "0.0.1",
"eole_version" : "2.7.2"
},
"builders": [
{
"name": "{{ user `vm_name` }}",
"type": "qemu",
"iso_urls": "{{ template_dir }}/../../../../images/eole/{{user `eole_version`}}/{{user `eole_module`}}/{{user `eole_module`}}-{{ user `eole_version` }}.img",
"iso_checksum": "none",
"disk_image": true,
"format": "qcow2",
"cpus": "2",
"memory": "2048",
"disk_size": "20480",
"ssh_username": "root",
"ssh_password": "cadoles",
"accelerator": "kvm",
"http_directory": "{{ template_dir }}",
"ssh_wait_timeout": "20m",
"boot_wait": "15s",
"skip_compaction": true,
"headless": true,
"shutdown_command": "shutdown -P now",
"output_directory": "{{ user `image_output_directory` }}",
"vm_name": "{{ build_name }}.img"
}
],
"provisioners": [
{
"type": "file",
"source": "{{user `provisionning_dir`}}/ssh",
"destination": "/root/.ssh/"
},
{
"type":"file",
"source":"{{ user `provisionning_dir` }}/../provisioning/ssl/ca/",
"destination":"/usr/local/share/ca-certificates/rapidssl"
},
{
"type":"file",
"source":"{{ user `provisionning_dir` }}/../provisioning/ssl/certs/",
"destination":"/etc/ssl/certs/"
},
{
"type":"file",
"source":"{{ user `provisionning_dir` }}/../provisioning/ssl/private/",
"destination":"/etc/ssl/private/"
},
{
"type": "ansible",
"pause_before": "30s",
"playbook_file": "{{ user `playbooks_dir` }}/get_conf_from_zephir.yml",
"ansible_env_vars": [
"zephir_server=zephir.cadoles.com",
"zephir_login=pacer",
"zephir_password=9+N7c2#vqV",
"create_server=non",
"code_rne=00004242",
"zephir_id=26",
"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` }}"
]
},
{
"type": "ansible",
"playbook_file": "{{ user `infra_playbooks` }}/sso.yml",
"ansible_env_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`}}"
]
},
{
"type": "ansible",
"pause_before": "10s",
"playbook_file": "{{ user `playbooks_dir` }}/instance.yml",
"ansible_env_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` }}"
]
}
],
"post-processors": [
{
"type": "shell-local",
"script": "{{ template_dir }}/../../../../post-processors/compress-qcow2.sh",
"execute_command": [
"/bin/bash",
"-c",
"{{.Vars}} {{.Script}} {{ user `image_output_directory` }}/../ {{ user `vm_name` }} {{ user `image_version` }}"
]
}
]
}