Skip to content

Commit faff3d5

Browse files
committed
refresh
1 parent e225e8b commit faff3d5

8 files changed

+58
-85
lines changed

playbook.yml

+29-14
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@
1616
- debug: var=ansible_distribution
1717
- debug: var=ansible_distribution_major_version
1818
- debug: var=ansible_distribution_version
19+
- when: image_os == "dragonflybsd"
20+
block:
21+
- name: "DFly/pkg turn off SSL, see https://www.reddit.com/r/dragonflybsd/comments/q9xowg/certificate_verification_failed_for_odigital/hh0a01s/"
22+
command: sed -i.bak 's,https,http,' /usr/local/etc/pkg/repos/df-latest.conf
23+
become: true
24+
- name: upgrade and install git
25+
shell: |
26+
pkg update
27+
pkg upgrade -y || true
28+
pkg upgrade -y || true
29+
pkg install -y git || true
30+
pkg install -y git
31+
become: true
1932
- when: ansible_distribution == 'OpenBSD' and ansible_distribution_version != image_version|string
2033
block:
2134
- name: Upgrade OpenBSD
@@ -27,24 +40,26 @@
2740
- name: Upgrade packages
2841
command: pkg_add -uvi
2942
become: true
30-
- name: install the dependencies
31-
shell: "/usr/sbin/pkg_add -U {{ item }}"
32-
with_items: '{{ dependencies }}'
33-
become: true
34-
environment:
35-
PKG_PATH: 'http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/{{ ansible_machine }}/{{ ansible_distribution_release }}/All/'
36-
when: ansible_os_family == "NetBSD"
37-
- name: Install the rootcerts
38-
command: /usr/pkg/sbin/mozilla-rootcerts install
39-
become: true
40-
args:
41-
creates: /etc/openssl/certs/ca-certificates.crt
42-
when: ansible_os_family == "NetBSD"
43+
- when: ansible_os_family == "NetBSD"
44+
block:
45+
- name: install the dependencies
46+
shell: "/usr/sbin/pkg_add -U {{ item }}"
47+
with_items: '{{ dependencies }}'
48+
become: true
49+
environment:
50+
PKG_PATH: 'http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/{{ ansible_machine }}/{{ ansible_distribution_release }}/All/'
51+
- name: Install the rootcerts
52+
command: /usr/pkg/sbin/mozilla-rootcerts install
53+
become: true
54+
args:
55+
creates: /etc/openssl/certs/ca-certificates.crt
56+
4357
- name: install the dependencies
4458
package:
4559
name: '{{ dependencies }}'
4660
become: true
4761
when: ansible_os_family != "NetBSD"
62+
4863
- command: git config --global http.sslVerify false
4964
- name: Fetch the builder script
5065
git:
@@ -100,7 +115,7 @@
100115

101116
- assert:
102117
that:
103-
- hostvars.newvm.ansible_dns.nameservers == ['192.168.123.1']
118+
- "'192.168.123.1' in hostvars.newvm.ansible_dns.nameservers"
104119

105120
- assert:
106121
that:

promote.yaml

+25-6
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,49 @@
33
vars:
44
www_dir: /var/www/bsd-cloud-image.org/images
55
dest_dir: '{{ www_dir }}/{{ image_os }}/{{ image_version }}'
6+
qcow2_swift_path: "images/{{ image_os }}/{{ image_version}}/{{ ansible_date_time.date }}/{{ final_name }}.qcow2"
7+
yaml_swift_path: "images/{{ image_os }}/{{ image_version}}/{{ ansible_date_time.date }}/{{ final_name }}.yaml"
68
tasks:
79
- file:
810
path: '{{ dest_dir }}'
911
state: directory
1012
recurse: true
1113
become: true
12-
- name: Promote the new image (1/4)
14+
- name: Promote the new image Virt-Lightning (1/4)
1315
command: 'mv /var/lib/virt-lightning/pool/upstream/{{ final_name }}_exp.qcow2 {{ dest_dir }}/{{ final_name }}.qcow2'
1416
become: true
15-
- name: Promote the new image (yaml) (2/4)
17+
- name: Promote the new image Virt-Lightning (yaml) (2/4)
1618
command: 'mv /var/lib/virt-lightning/pool/upstream/{{ final_name }}_exp.yaml {{ dest_dir }}/{{ final_name }}.yaml'
1719
become: true
18-
- name: Promote the new image (3/4)
20+
- name: Promote the new image Virt-Lightning (3/4)
1921
command: 'cp {{ dest_dir }}/{{ final_name }}.qcow2 /var/lib/virt-lightning/pool/upstream/{{ final_name }}.qcow2'
2022
become: true
21-
- name: Promote the new image (yaml) (4/4)
23+
- name: Promote the new image Virt-Lightning (yaml) (4/4)
2224
command: 'cp {{ dest_dir }}/{{ final_name }}.yaml /var/lib/virt-lightning/pool/upstream/{{ final_name }}.yaml'
2325
become: true
24-
25-
- name: Fix the ownership of the target dir
26+
27+
- name: Fix the ownership of the target dir Virt-Lightning
2628
file:
2729
path: '{{ dest_dir }}'
2830
state: directory
2931
recurse: yes
3032
owner: goneri
3133
group: goneri
3234
become: true
35+
36+
- name: upload the qcow2 file
37+
openstack.cloud.object:
38+
container: bsd-cloud-image.org
39+
name: "{{ qcow2_swift_path }}"
40+
filename: '/var/lib/virt-lightning/pool/upstream/{{ final_name }}.qcow2'
41+
container_access: public
42+
43+
- name: upload the YAML file
44+
openstack.cloud.object:
45+
container: bsd-cloud-image.org
46+
name: "{{ yaml_swift_path }}"
47+
filename: '/var/lib/virt-lightning/pool/upstream/{{ final_name }}.yaml'
48+
container_access: public
49+
50+
- debug:
51+
msg: "Image availabe at: https://object-storage.public.mtl1.vexxhost.net/swift/v1/1dbafeefbd4f4c80864414a441e72dd2/bsd-cloud-image.org/{{ qcow2_swift_path }}"

refresh_images.sh

-8
This file was deleted.

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
ansible-core
22
virt-lightning
3+
openstacksdk

run.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,10 @@ function run_test() {
2323

2424
}
2525

26-
for target in openbsd-7.0 openbsd-6.9 netbsd-9.2 netbsd-8.2 freebsd-13.0-zfs freebsd-13.0-ufs; do
26+
#for target in dragonflybsd-6.0.1-hammer2 dragonflybsd-6.0.1-ufs openbsd-7.0 openbsd-6.9 freebsd-13.0-zfs freebsd-13.0-ufs; do
27+
for target in dragonflybsd-6.0.1-ufs; do
2728
run_test ${target} 2>&1 | tee ${log_dir}/${target}-build.log
2829
done
2930

30-
#os=dragonflybsd
31-
#for version in 5.8.3; do
32-
# run_test ${os} ${version} ${repo} > ${log_dir}/${os}-${version}-build.log 2>&1
33-
#done
34-
35-
3631
sudo find /var/www/bsd-cloud-image.org -type f -exec chmod 644 {} \;
3732
sudo find /var/www/bsd-cloud-image.org -type d -exec chmod 755 {} \;

targets/netbsd-8.2.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ dependencies:
1010
- bash
1111
- mozilla-rootcerts
1212
builder_repo: https://github.com/virt-lightning/netbsd-cloud-images
13-
python_interpreter: /usr/pkg/bin/python3.7
13+
python_interpreter: /usr/pkg/bin/python3.8

test-openstack

-43
This file was deleted.

test.sh

-6
This file was deleted.

0 commit comments

Comments
 (0)