Skip to content

Commit da4fed2

Browse files
authored
Merge pull request #89 from stackhpc/ubuntu
Add support for Ubuntu repositories
2 parents 7091862 + 409ba83 commit da4fed2

File tree

13 files changed

+323
-19
lines changed

13 files changed

+323
-19
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ ci-aio
230230
Prerequisites
231231
^^^^^^^^^^^^^
232232

233-
* a CentOS Stream 8 host
233+
* a CentOS Stream 8 or Ubuntu Focal 20.04 host
234234
* access to the local Pulp server
235235

236236
Setup
@@ -329,7 +329,7 @@ service, and pushed there once built.
329329
Prerequisites
330330
^^^^^^^^^^^^^
331331

332-
* a CentOS Stream 8 host
332+
* a CentOS Stream 8 or Ubuntu Focal 20.04 host
333333
* access to the local Pulp server
334334

335335
Setup

etc/kayobe/ansible/pulp-repo-promote-production.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
- import_role:
77
name: stackhpc.pulp.pulp_distribution
88
vars:
9-
pulp_distribution_rpm: "{{ stackhpc_pulp_distribution_rpm_production }}"
9+
pulp_distribution_deb: "{{ stackhpc_pulp_distribution_deb_production | selectattr('required') }}"
10+
pulp_distribution_rpm: "{{ stackhpc_pulp_distribution_rpm_production | selectattr('required') }}"

etc/kayobe/ansible/pulp-repo-publish.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
name: stackhpc.pulp.pulp_publication
88
# NOTE: use intermediate variable to avoid publishing containers.
99
vars:
10-
pulp_publication_rpm: "{{ stackhpc_pulp_publication_rpm_development }}"
10+
pulp_publication_deb: "{{ stackhpc_pulp_publication_deb_development | selectattr('required') }}"
11+
pulp_publication_rpm: "{{ stackhpc_pulp_publication_rpm_development | selectattr('required') }}"
1112

1213
- import_role:
1314
name: stackhpc.pulp.pulp_distribution
1415
vars:
15-
pulp_distribution_rpm: "{{ stackhpc_pulp_distribution_rpm_development }}"
16+
pulp_distribution_deb: "{{ stackhpc_pulp_distribution_deb_development | selectattr('required') }}"
17+
pulp_distribution_rpm: "{{ stackhpc_pulp_distribution_rpm_development | selectattr('required') }}"

etc/kayobe/ansible/pulp-repo-sync.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
name: stackhpc.pulp.pulp_repository
88
# NOTE: use intermediate variable to avoid syncing containers.
99
vars:
10-
pulp_repository_rpm_repos: "{{ stackhpc_pulp_repository_rpm_repos }}"
10+
pulp_repository_deb_repos: "{{ stackhpc_pulp_repository_deb_repos | selectattr('required') }}"
11+
pulp_repository_rpm_repos: "{{ stackhpc_pulp_repository_rpm_repos | selectattr('required') }}"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
# Currently the pulp_deb plugin in Pulp does not support certain types of
3+
# content, including i18n files and command-not-found indices. This breaks APT
4+
# when the command-not-found is installed. This playbook can be used to
5+
# uninstall the package, prior to running any other APT commands. It may be
6+
# installed as a hook to the 'host configure' commands.
7+
# See https://github.com/pulp/pulp_deb/issues/419
8+
# FIXME: If used as a hook, this playbook matches all hosts, so will run
9+
# against the seed, even when running 'overcloud host configure'. Depending on
10+
# the stage of deployment, some hosts may be unreachable. This could be fixed
11+
# by implementing this playbook separately for each group.
12+
- name: Purge command-not-found package
13+
hosts: seed-hypervisor:seed:overcloud:infra-vms
14+
gather_facts: false
15+
vars:
16+
ansible_user: "{{ bootstrap_user }}"
17+
# We can't assume that a virtualenv exists at this point, so use the system
18+
# python interpreter.
19+
ansible_python_interpreter: /usr/bin/python3
20+
# Work around no known_hosts entry on first boot.
21+
ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
22+
tasks:
23+
- name: Purge command-not-found package
24+
package:
25+
name:
26+
- command-not-found
27+
- python3-command-not-found
28+
purge: true
29+
state: absent
30+
become: true
31+
failed_when: false
32+
ignore_unreachable: true
33+
when: ansible_facts.os_family == "Debian"

etc/kayobe/apt.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,58 @@
1111
# Apt proxy URL for HTTPS. Default is {{ apt_proxy_http }}.
1212
#apt_proxy_https:
1313

14+
# List of Apt configuration options. Each item is a dict with the following
15+
# keys:
16+
# * content: free-form configuration file content
17+
# * filename: name of a file in /etc/apt/apt.conf.d/ in which to write the
18+
# configuration
19+
# Default is an empty list.
20+
apt_config:
21+
# NOTE: Currently the Pulp verbatim publisher does not sync translation
22+
# files, which results in apt update failing. Disable translations until this
23+
# is resolved.
24+
- content: |
25+
Acquire::Languages "none";
26+
filename: 99no-languages
27+
28+
# List of apt keys. Each item is a dict containing the following keys:
29+
# * url: URL of key
30+
# * filename: Name of a file in which to store the downloaded key
31+
# Default is an empty list.
32+
apt_keys:
33+
- url: "https://download.docker.com/linux/ubuntu/gpg"
34+
filename: docker.asc
35+
36+
# A list of Apt repositories.
37+
# * types: whitespace-separated list of repository types, e.g. deb or deb-src
38+
# (optional, default is 'deb')
39+
# * url: URL of the repository
40+
# * suites: whitespace-separated list of suites, e.g. focal (optional, default
41+
# is ansible_facts.distribution_release)
42+
# * components: whitespace-separated list of components, e.g. main (optional,
43+
# default is 'main')
44+
# * signed_by: whitespace-separated list of names of GPG keyring files in
45+
# apt_keys_path (optional, default is unset)
46+
# * architecture: whitespace-separated list of architectures that will be used
47+
# (optional, default is unset)
48+
# Default is an empty list.
49+
apt_repositories:
50+
- url: "{{ stackhpc_repo_ubuntu_focal_url }}"
51+
suites: "{{ ansible_facts.distribution_release }} {{ ansible_facts.distribution_release }}-updates {{ ansible_facts.distribution_release }}-backports"
52+
components: main restricted universe multiverse
53+
- url: "{{ stackhpc_repo_ubuntu_focal_security_url }}"
54+
suites: "{{ ansible_facts.distribution_release }}-security"
55+
components: main restricted universe multiverse
56+
- url: "{{ stackhpc_repo_docker_ce_ubuntu_url }}"
57+
suites: "{{ ansible_facts.distribution_release }}"
58+
components: stable
59+
signed_by: docker.asc
60+
61+
# Whether to disable repositories in /etc/apt/sources.list. This may be used
62+
# when replacing the distribution repositories via apt_repositories.
63+
# Default is false.
64+
apt_disable_sources_list: true
65+
1466
###############################################################################
1567
# Dummy variable to allow Ansible to accept this file.
1668
workaround_ansible_issue_8743: yes

etc/kayobe/environments/ci-aio/stackhpc-ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ stackhpc_repo_grafana_version: "{{ stackhpc_pulp_repo_grafana_version }}"
3737
stackhpc_repo_rabbitmq_erlang_version: "{{ stackhpc_pulp_repo_rabbitmq_erlang_version }}"
3838
stackhpc_repo_rabbitmq_server_version: "{{ stackhpc_pulp_repo_rabbitmq_server_version }}"
3939
stackhpc_repo_treasuredata_4_version: "{{ stackhpc_pulp_repo_treasuredata_4_version }}"
40+
stackhpc_repo_ubuntu_cloud_archive_version: "{{ stackhpc_pulp_repo_ubuntu_cloud_archive_version }}"
41+
stackhpc_repo_ubuntu_focal_version: "{{ stackhpc_pulp_repo_ubuntu_focal_version }}"
42+
stackhpc_repo_ubuntu_focal_security_version: "{{ stackhpc_pulp_repo_ubuntu_focal_security_version }}"
43+
stackhpc_repo_docker_ce_ubuntu_version: "{{ stackhpc_pulp_repo_docker_ce_ubuntu_version }}"
44+
4045

4146
# Host and port of container registry.
4247
# Push built images to the development Pulp service registry.

etc/kayobe/environments/ci-builder/stackhpc-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ stackhpc_repo_grafana_version: "{{ stackhpc_pulp_repo_grafana_version }}"
5656
stackhpc_repo_rabbitmq_erlang_version: "{{ stackhpc_pulp_repo_rabbitmq_erlang_version }}"
5757
stackhpc_repo_rabbitmq_server_version: "{{ stackhpc_pulp_repo_rabbitmq_server_version }}"
5858
stackhpc_repo_treasuredata_4_version: "{{ stackhpc_pulp_repo_treasuredata_4_version }}"
59+
stackhpc_repo_ubuntu_cloud_archive_version: "{{ stackhpc_pulp_repo_ubuntu_cloud_archive_version }}"
60+
stackhpc_repo_ubuntu_focal_version: "{{ stackhpc_pulp_repo_ubuntu_focal_version }}"
61+
stackhpc_repo_ubuntu_focal_security_version: "{{ stackhpc_pulp_repo_ubuntu_focal_security_version }}"
62+
stackhpc_repo_docker_ce_ubuntu_version: "{{ stackhpc_pulp_repo_docker_ce_ubuntu_version }}"
5963

6064
# Host and port of container registry.
6165
# Push built images to the Ark registry.

etc/kayobe/kolla.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,26 @@ stackhpc_third_party_repos:
183183
- url: "{{ stackhpc_repo_treasuredata_4_url }}"
184184
file: "td.repo"
185185

186+
# List of repositories for Ubuntu focal.
187+
stackhpc_ubuntu_focal_repos:
188+
- "deb {{ stackhpc_repo_ubuntu_focal_url }} focal main universe"
189+
- "deb {{ stackhpc_repo_ubuntu_focal_url }} focal-updates main universe"
190+
- "deb {{ stackhpc_repo_ubuntu_focal_url }} focal-backports main universe"
191+
- "deb {{ stackhpc_repo_ubuntu_focal_security_url }} focal-security main universe"
192+
- "deb {{ stackhpc_repo_ubuntu_cloud_archive_url }} focal-updates/wallaby main"
193+
186194
# Dict mapping Jinja2 block names in kolla's Docker images to their contents.
187195
kolla_build_blocks:
188196
base_header: |
197+
{% if kolla_base_distro == 'centos' %}
189198
RUN \
190199
{% for repo in stackhpc_centos_stream_repos %}
191200
sed -i -e 's/^\(mirrorlist *=.*\)/#\1/g' \
192201
-e 's/^[# ]*\(baseurl *=.*\)/#\1/g' \
193202
-e '/#baseurl.*/a baseurl={{ repo.url }}' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} && \
194203
{% endif %}
195204
{% endfor %}
196-
205+
{% endif %}
197206
base_centos_repo_overrides_post_yum: |
198207
{# fixme #}
199208
&& \
@@ -202,7 +211,13 @@ kolla_build_blocks:
202211
-e 's/^[# ]*\(baseurl *=.*\)/#\1/g' \
203212
-e '/#baseurl.*/a baseurl={{ repo.url }}' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} &&{% endif %} \
204213
{% endfor %}
205-
214+
base_ubuntu_package_sources_list: |
215+
RUN \
216+
rm -f /etc/apt/sources.list && \
217+
{% for repo in stackhpc_ubuntu_focal_repos %}
218+
echo '{{ repo }}' >> /etc/apt/sources.list {% if not loop.last %} && \
219+
{% endif %}
220+
{% endfor %}
206221
grafana_plugins_install: |
207222
RUN grafana-cli plugins install vonage-status-panel
208223
ironic_inspector_header: |
@@ -225,15 +240,11 @@ kolla_build_blocks:
225240
prometheus_blackbox_exporter_repository_version: |
226241
ARG blackbox_exporter_version='0.19.0'
227242
228-
# Dict mapping image customization variable names to their values.
229-
# Each variable takes the form:
230-
# <image name>_<customization>_<operation>
231-
# Hyphens in the image name must be replaced with underscores. The
232-
# customization is most commonly packages. The operation should be one of
233-
# override, append or remove. The value should be a list.
234-
kolla_build_customizations:
243+
kolla_build_customizations_common:
235244
ironic_inspector_pip_packages_append:
236245
- /additions/*
246+
247+
kolla_build_customizations_centos:
237248
ovn_base_packages_override:
238249
- ovn-2021-21.12.0
239250
ovn_controller_packages_override:
@@ -252,6 +263,16 @@ kolla_build_customizations:
252263
- python3-openvswitch2.16
253264
- tcpdump
254265

266+
kolla_build_customizations_ubuntu: {}
267+
268+
# Dict mapping image customization variable names to their values.
269+
# Each variable takes the form:
270+
# <image name>_<customization>_<operation>
271+
# Hyphens in the image name must be replaced with underscores. The
272+
# customization is most commonly packages. The operation should be one of
273+
# override, append or remove. The value should be a list.
274+
kolla_build_customizations: "{{ kolla_build_customizations_common | combine(kolla_build_customizations_centos if kolla_base_distro == 'centos' else kolla_build_customizations_ubuntu) }}"
275+
255276
###############################################################################
256277
# Kolla-ansible inventory configuration.
257278

etc/kayobe/kolla/globals.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
# yamllint disable-file
12
---
3+
enable_docker_repo: "{% raw %}{{ ansible_facts.os_family == 'RedHat' }}{% endraw %}"
4+
25
docker_yum_baseurl: "{{ stackhpc_repo_docker_url }}"
36
docker_yum_gpgkey: "https://download.docker.com/linux/{% raw %}{{ ansible_facts.distribution | lower }}{% endraw %}/gpg"
47

8+
{# We are not currently providing container images for Ubuntu in Wallaby. #}
9+
{% if kolla_base_distro == 'centos' %}
510
barbican_tag: wallaby-20220311T133847
611
cinder_tag: wallaby-20220309T083940
712
cloudkitty_tag: wallaby-20220119T122428
@@ -22,3 +27,4 @@ prometheus_jiralert_tag: wallaby-20220119T122428
2227
prometheus_libvirt_exporter_tag: wallaby-20220325T122042
2328
prometheus_msteams_tag: wallaby-20220119T122428
2429
prometheus_openstack_exporter_tag: wallaby-20220705T132206
30+
{% endif %}

0 commit comments

Comments
 (0)