-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcreate_template_box.yml
78 lines (76 loc) · 2.09 KB
/
create_template_box.yml
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
---
- hosts: localhost
name: prepare vagrant box
become_user: root
vars_prompt:
- name: fedora_version
prompt: fedora
private: false
default: 39
- name: git_branch
prompt: "git branch"
private: false
default: "master"
- name: flow
prompt: "template flow"
private: false
default: "ci"
vars_files:
- vars/flows/{{ flow }}.yml
- vars/fedora/{{ fedora_version }}.yml
- vars/ipa_branches/{{ git_branch }}.yml
gather_facts: false
pre_tasks:
- name: install Python 3 deps for ansible modules
raw: dnf install -y python3-dnf python3-libselinux
become: yes
- name: gather facts
setup:
- set_fact:
template_box_name: "{{ flow }}-{{ git_branch }}-f{{ fedora_version }}"
roles:
- box/prepare
- hosts: image_box
name: modify vagrant box template
vars_files:
- vars/flows/{{ flow }}.yml
- vars/fedora/{{ fedora_version }}.yml
- vars/ipa_branches/{{ git_branch }}.yml
pre_tasks:
- name: Install cloud-utils-growpart for f40
when: fedora_version == '40'
command: dnf install -y cloud-utils-growpart
- name: grow partition size /dev/vda4 for f40
when: fedora_version == '40'
command: growpart /dev/vda 4
- name: resize the / filesystem for f40
when: fedora_version == '40'
command: btrfs filesystem resize max /
# GPG keys might be outdated for packages in Rawhide
- name: Update fedora-repos package
when: nightly_compose is defined and nightly_compose
dnf:
state: latest
name: fedora-repos
disable_gpg_check: yes
- name: set dnf fastest mirror
ini_file:
path: /etc/dnf/dnf.conf
section: main
option: fastestmirror
value: "true"
no_extra_spaces: yes
- name: update distro packages
dnf:
name: '*'
state: latest
- command: dnf clean all
roles:
- role: builder
git_version: "{{ git_branch }}"
- role: machine
- hosts: localhost
name: package template box
become_user: root
roles:
- box/package