Skip to content

Commit 29d213f

Browse files
Merge pull request openstack-k8s-operators#812 from bshephar/disconnected-molecule
Disconnected molecule
2 parents e197c75 + f8d17bb commit 29d213f

File tree

4 files changed

+117
-2
lines changed

4 files changed

+117
-2
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
# Copyright 2019 Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
17+
18+
- name: Converge
19+
hosts: all
20+
tasks:
21+
- name: Run install
22+
include_role:
23+
name: osp.edpm.edpm_podman
24+
tasks_from: install.yml
25+
vars_from: "redhat.yml"
26+
vars:
27+
edpm_podman_disconnected_ocp: true
28+
edpm_podman_registries_conf: |
29+
unqualified-search-registries = ["registry.access.redhat.com", "docker.io"]
30+
short-name-mode = ""
31+
32+
[[registry]]
33+
prefix = ""
34+
location = "quay.io/okd/scos-content"
35+
36+
[[registry.mirror]]
37+
location = "quay.io/molecule/okd"
38+
pull-from-mirror = "digest-only"
39+
40+
[[registry]]
41+
prefix = ""
42+
location = "quay.io/okd/scos-release"
43+
44+
# https://bugs.launchpad.net/bugs/1889510
45+
- name: Test podman network ls
46+
become: true
47+
command: podman network ls
48+
49+
- name: Assert registries.conf matches
50+
ansible.builtin.lineinfile:
51+
name: /etc/containers/registries.conf
52+
search_string: 'location = "quay.io/okd/scos-content"'
53+
line: 'changed'
54+
state: present
55+
check_mode: true
56+
register: registries
57+
failed_when: registries is not changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
provisioner:
3+
name: ansible
4+
config_options:
5+
defaults:
6+
fact_caching: jsonfile
7+
fact_caching_connection: /tmp/molecule/facts
8+
inventory:
9+
hosts:
10+
all:
11+
hosts:
12+
instance:
13+
ansible_host: localhost
14+
log: true
15+
env:
16+
ANSIBLE_STDOUT_CALLBACK: yaml
17+
ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${HOME}/zuul-jobs/roles"
18+
ANSIBLE_LIBRARY: "${ANSIBLE_LIBRARY:-/usr/share/ansible/plugins/modules}"
19+
ANSIBLE_FILTER_PLUGINS: "${ANSIBLE_FILTER_PLUGINS:-/usr/share/ansible/plugins/filter}"
20+
21+
scenario:
22+
test_sequence:
23+
- prepare
24+
- converge
25+
- check
26+
27+
verifier:
28+
name: testinfra
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# Copyright 2019 Red Hat, Inc.
3+
# All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
# not use this file except in compliance with the License. You may obtain
7+
# a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
# License for the specific language governing permissions and limitations
15+
# under the License.
16+
- name: Prepare test_deps
17+
hosts: all
18+
gather_facts: false
19+
roles:
20+
- role: ../../../../molecule/common/test_deps
21+
test_deps_extra_packages:
22+
- runc
23+
- containernetworking-plugins
24+
25+
- name: Prepare
26+
hosts: all
27+
become: true
28+
gather_facts: false
29+
roles:
30+
- role: osp.edpm.env_data

roles/edpm_podman/tasks/install.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@
107107
when: not edpm_podman_disconnected_ocp
108108

109109
- name: Write containers registries.conf
110-
ansible.builtin.template:
111-
src: "{{ edpm_podman_registries_conf }}"
110+
ansible.builtin.copy:
111+
content: "{{ edpm_podman_registries_conf }}"
112112
dest: /etc/containers/registries.conf
113113
owner: root
114114
group: root

0 commit comments

Comments
 (0)