Skip to content

Commit 8666a98

Browse files
committed
Add edpm_bootc role
The edpm_bootc role sets a boolean fact "bootc" for storing whether or not a host is a bootc node. Jira: OSPRH-11505 Signed-off-by: James Slagle <[email protected]>
1 parent 29d213f commit 8666a98

File tree

8 files changed

+150
-0
lines changed

8 files changed

+150
-0
lines changed

roles/edpm_bootc/files/.gitkeep

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
argument_specs:
3+
# ./roles/edpm_bootc/tasks/main.yml entry point
4+
main:
5+
short_description: The main entry point for the edpm_bootc role.
6+
description: Multiple lines description
7+
options: {}

roles/edpm_bootc/meta/main.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
# Copyright 2024 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+
galaxy_info:
19+
author: OpenStack
20+
description: EDPM OpenStack Role -- edpm_bootc
21+
company: Red Hat
22+
license: Apache-2.0
23+
min_ansible_version: '2.14'
24+
namespace: osp
25+
#
26+
# Provide a list of supported platforms, and for each platform a list of versions.
27+
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
28+
# To view available platforms and versions (or releases), visit:
29+
# https://galaxy.ansible.com/api/v1/platforms/
30+
#
31+
platforms:
32+
- name: 'EL'
33+
versions:
34+
- '8'
35+
- '9'
36+
37+
galaxy_tags:
38+
- edpm
39+
40+
41+
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
42+
# if you add dependencies to this list.
43+
dependencies: []
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
collections:
3+
- name: community.general
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# Copyright 2024 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+
roles:
21+
- role: "edpm_bootc"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
options:
5+
role-file: collections.yml
6+
driver:
7+
name: podman
8+
platforms:
9+
- command: /sbin/init
10+
dockerfile: ../../../../molecule/common/Containerfile.j2
11+
image: ${EDPM_ANSIBLE_MOLECULE_IMAGE:-"ubi9/ubi-init"}
12+
name: instance
13+
privileged: true
14+
registry:
15+
url: ${EDPM_ANSIBLE_MOLECULE_REGISTRY:-"registry.access.redhat.com"}
16+
ulimits:
17+
- host
18+
provisioner:
19+
log: true
20+
name: ansible
21+
scenario:
22+
test_sequence:
23+
- dependency
24+
- destroy
25+
- create
26+
- prepare
27+
- converge
28+
- destroy
29+
verifier:
30+
name: ansible
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
# Copyright 2024 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: Prepare
19+
hosts: all
20+
roles:
21+
- role: ../../../../molecule/common/test_deps
22+
- role: env_data

roles/edpm_bootc/tasks/main.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
# Copyright 2024 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+
- name: Check for /bin/bootc
18+
ansible.builtin.stat:
19+
path: /bin/bootc
20+
register: bootc_stat
21+
22+
- name: Set fact for bootc
23+
ansible.builtin.set_fact:
24+
bootc: "{{ bootc_stat.stat.exists }}"

0 commit comments

Comments
 (0)