forked from cjeanner/tripleo-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
container-build.yml
96 lines (84 loc) · 2.14 KB
/
container-build.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
# always ensure fresh operator content
- hosts: localhost
connection: local
vars_files:
- vars/main.yaml
roles:
- operators
- hosts: builder
remote_user: root
vars_files:
- vars/main.yaml
vars:
nat_vm_memory: 16384
nat_vm_size: 100G
roles:
- validations
- deprecations
- builder
- nat_vm
- hosts: nat-vm
remote_user: root
collections:
- tripleo.operator
vars_files:
- vars/main.yaml
tasks:
- name: Common tag
tags:
- lab
- nat-vm
- container-builder
block:
- name: Turn off container-tools rhel8 module
command: dnf module disable container-tools:rhel8 -y
- name: Turn on container-tools 2.0
command: dnf module enable container-tools:2.0 -y
- name: Install some packages
package:
state: present
name:
- sudo
- name: Gather only needed facts
setup:
gather_subset:
- '!all'
- '!any'
- '!min'
- distribution_major_version
- distribution
- name: Setup repositories
include_role:
name: tripleo_repos
- name: Install python3-tripleoclient
package:
name: python3-tripleoclient
state: latest
- name: Copy dnf directory
copy:
dest: /srv/container-dnf
remote_src: true
src: /etc/dnf/
- name: Generate container files
include_role:
name: tripleo_container_image_build
vars:
tripleo_container_image_build_push: true
tripleo_container_image_build_registry: 192.168.122.1:5000
tripleo_container_image_build_volumes:
- /srv/container-dnf:/etc/dnf/:z
# Connect as root first in order to push basic config and accesses
- hosts: undercloud
remote_user: root
vars_files:
- vars/main.yaml
roles:
- undercloud_prepare
# Reconnect to the undercloud as stack user
- hosts: undercloud
remote_user: stack
vars_files:
- vars/main.yaml
roles:
- undercloud