mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2024-09-24 17:20:39 +02:00
Add packer stuff
This commit is contained in:
parent
57d7edd91d
commit
d5cc2fa74c
@ -24,6 +24,15 @@ it is necessary to run the following once:
|
||||
|
||||
Note that some roles already run this automatically.
|
||||
|
||||
##### Note about packer
|
||||
|
||||
We use packer to build snapshots on hcloud to use as server base images.
|
||||
In order to use this, you need to install packer and then run
|
||||
|
||||
packer build -var $(./packer/get_hetzner_cloud_api_key.sh) packer/archlinux.json
|
||||
|
||||
This will take some time after which a new snapshot will have been created on the primary hcloud archlinux project.
|
||||
|
||||
##### Note about opendkim
|
||||
|
||||
The opendkim DNS data has to be added to DNS manually. The roles verifies that the DNS is correct before starting opendkim.
|
||||
|
10
host_vars/packer-base-image
Normal file
10
host_vars/packer-base-image
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
hostname: "archlinux-packer"
|
||||
|
||||
dhcp: true
|
||||
network_interface: "en*"
|
||||
filesystem: btrfs
|
||||
system_disks:
|
||||
- /dev/sda
|
||||
|
||||
ansible_python_interpreter: /usr/bin/python3
|
@ -1,14 +1,19 @@
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
64636236653035356163386630613263343063346330663661353063346331376130343762666230
|
||||
6335356561653138653131363038626135376430336236650a373538356437623739643933313538
|
||||
66636535616566343039663663653834303035363732353965663139323237663066343737633861
|
||||
6336376431633362660a313165373632356333393338363631303465666161356632383937353862
|
||||
31333938653633643564396331396632373735366139653165393366666363396435383362623039
|
||||
33396666613734373335366562656233376363326430633038613963393461383964616664336330
|
||||
34666363356164343564383762373632396665336338646633376639363165613632313162303736
|
||||
64353165303065333039326564363934643734326261313462613039303962663062663963323563
|
||||
35336237633263306165323939616463626461396166346166663038643932393162656239613035
|
||||
35383739323765373734333438373961383265313962393365326137393937636133633732386339
|
||||
30376536346162623535663932303761393335643032376566616465356639313565303631306261
|
||||
38616362343937626136623137616133623163373166373836616330663063613061393533363936
|
||||
38613130396430623864643262626232323731343538376133303631653138383466
|
||||
35623837346431643363356131323862303663343434333565613164336139303438393139356664
|
||||
3038656230613533313363636161616237306363306264370a353435313162303164323830313139
|
||||
62323236353533363264333930626631323038393864313334316131663732366130323363333364
|
||||
6236306266316631390a386563383931306635623334383833623135383932303436363931373034
|
||||
66366631663138356635666236323632346166363236343333366463373531303230306534326338
|
||||
37653135346231373534366234626439323937353037356130643531653435393839306536626537
|
||||
30343030386432363962633666346639383236646361386564356533373862363336616366626433
|
||||
30653761626436666431663937326533646236383136393035643034333834363532636464356563
|
||||
33613830623430306664356238323032626230616333663233616364326165376435666636616432
|
||||
61353337626666356366353862646564643439373239363036333936656161393736633335386636
|
||||
63323563316639653239616137386233333539353562343466623463303937383939633833376634
|
||||
65353663616635613765343766636463353332636661623337333566323435303330366263616264
|
||||
66633237646366633834346231633330396538356338366530396466656631616339393631323936
|
||||
33623935626161373338313936303565633538613735613361343763343665666464353638666362
|
||||
31323732343061336336653163346537383163386532646635333135356433393364303664323033
|
||||
35356337343632333064383230333532336166633131653537333534303863633664656536396463
|
||||
64613233353664343034646234303165633039666339383933373339353561646530383238303065
|
||||
3930386365326437343333333264353030373064383766653134
|
||||
|
22
packer/archlinux.json
Normal file
22
packer/archlinux.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"variables": {
|
||||
"hetzner_cloud_api_key": null
|
||||
},
|
||||
"sensitive-variables": ["hetzner_cloud_api_key"],
|
||||
"builders": [{
|
||||
"type": "hcloud",
|
||||
"snapshot_name": "archlinux-{{ isotime \"2006-01-02T15:04\" }}",
|
||||
"token": "{{ user `hetzner_cloud_api_key` }}",
|
||||
"image": "ubuntu-18.04",
|
||||
"server_type": "cx11",
|
||||
"ssh_username": "root",
|
||||
"location": "nbg1",
|
||||
"rescue": "linux64"
|
||||
}],
|
||||
"provisioners": [{
|
||||
"type": "ansible",
|
||||
"playbook_file": "playbooks/tasks/install_arch.yml",
|
||||
"host_alias": "packer-base-image",
|
||||
"inventory_directory": "."
|
||||
}]
|
||||
}
|
3
packer/get_hetzner_cloud_api_key.sh
Executable file
3
packer/get_hetzner_cloud_api_key.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "hetzner_cloud_api_key=$(ansible-vault view misc/hetzner-password.vault | grep hetzner_cloud_api_key | cut -f2 -d' ')"
|
Loading…
Reference in New Issue
Block a user