summaryrefslogtreecommitdiff
path: root/scripts/packer.json
blob: 30bd2fb72f38001729dd884159b7bcdc0f17e3c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
  "variables": {
    "iso_url": "{{env `ISO_IMAGE`}}",
    "iso_checksum": "{{env `ISO_MD5_SUM`}}",
    "output_directory": "{{env `PACKER_BUILD_DIR`}}",
    "box_tag": "{{env `VAGRANT_BOX_NAME`}}",
    "cloud_token": "{{env `VAGRANT_CLOUD_ACCESS_TOKEN`}}",
    "version": "{{env `VERSION`}}",
    "box_base_url": "{{env `BOX_BASE_URL`}}"
  },
  "builders":
  [
    {
      "name": "qemu-image",
      "type": "qemu",
      "iso_url": "{{user `iso_url`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "md5",
      "output_directory": "{{user `output_directory`}}/qemu",
      "shutdown_command": "sudo halt -p",
      "disk_size": 4096,
      "format": "qcow2",
      "headless": true,
      "ssh_host_port_min": 2222,
      "ssh_host_port_max": 2229,
      "ssh_username": "vyos",
      "ssh_password": "vyos",
      "ssh_port": 22,
      "ssh_wait_timeout": "300s",
      "vm_name": "vyos_qemu_image.img",
      "net_device": "virtio-net",
      "disk_interface": "virtio",
      "boot_wait": "5s",
      "boot_command":
      [
        "<enter><wait3m>",
        "vyos<enter><wait5>",
        "vyos<wait><enter><wait10>",
        "install image<enter><wait5>",
        "<enter><wait5>",
        "<enter><wait5>",
        "<enter><wait5>",
        "Yes<enter><wait5>",
        "<enter><wait10>",
        "<enter><wait5>",
        "<enter><wait5>",
        "vyos<enter><wait5>",
        "vyos<enter><wait10>",
        "<enter><wait10><wait10>",
        "reboot<enter><wait5>",
        "Yes<enter><wait3m>",
        "vyos<enter><wait5>",
        "vyos<enter><wait10>",
        "configure<enter><wait5>",
        "set interface ethernet eth0 address dhcp<enter><wait5>",
        "set service ssh<enter><wait5>",
        "commit<enter><wait5>",
        "save<enter><wait5>",
        "delete interface ethernet eth0 hw-id<enter><wait5>",
        "commit<enter><wait5>",
        "save<enter><wait5>",
        "exit<enter><wait5>"
      ]
    },
    {
      "name": "vmware-image",
      "type": "qemu",
      "iso_url": "{{user `output_directory`}}/qemu/vyos_qemu_image.img",
      "iso_checksum_type": "none",
      "output_directory": "{{user `output_directory`}}/vmware",
      "shutdown_command": "sudo halt -p",
      "disk_image": true,
      "disk_size": 4096,
      "format": "raw",
      "headless": true,
      "accelerator": "tcg",
      "ssh_host_port_min": 2222,
      "ssh_host_port_max": 2229,
      "ssh_username": "vyos",
      "ssh_password": "vyos",
      "ssh_port": 22,
      "ssh_wait_timeout": "300s",
      "vm_name": "vyos_vmware_image.img",
      "net_device": "virtio-net",
      "disk_interface": "virtio",
      "boot_wait": "5s"
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "only": ["vmware-image"],
      "scripts": [
        "scripts/packer-scripts/vmware.sh"
      ]
    }
  ],
  "post-processors": [
    [
      {
        "type": "vagrant",
        "only": ["qemu-image"],
        "vagrantfile_template": "scripts/Vagrantfile",
        "output": "{{user `output_directory`}}/vagrant-libvirt/vyos_vagrant_libvirt.box",
        "keep_input_artifact": true
      },
      {
        "type": "vagrant-cloud",
        "only": ["qemu-image"],
        "box_tag": "{{user `box_tag`}}",
        "access_token": "{{user `cloud_token`}}",
        "version": "{{user `version`}}",
        "box_download_url": "{{user `box_base_url`}}/vyos-{{user `version`}}-vagrant-libvirt.box"
      }
    ]
  ]
}