Skip to content

Commit 275605c

Browse files
Apply suggestions from code review
Co-authored-by: Mark Goddard <[email protected]>
1 parent f365a5b commit 275605c

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

roles/os_images/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ OpenStack Images
22
================
33

44
This role generates guest instance images using disk-image-builder
5-
and uploads them to OpenStack using the `os_image` module.
5+
and uploads them to OpenStack using the `openstack.cloud.image` module.
66

77
Requirements
88
------------
@@ -121,9 +121,9 @@ The following playbook generates a guest image and uploads it to OpenStack:
121121

122122
---
123123
- name: Generate guest image and upload
124-
hosts: openstack
124+
hosts: localhost
125125
roles:
126-
- role: stackhpc.os-images
126+
- role: stackhpc.openstack.os_images
127127
os_images_auth:
128128
auth_url: "{{ lookup('env','OS_AUTH_URL') }}"
129129
username: "{{ lookup('env','OS_USERNAME') }}"

roles/os_images/defaults/main.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ os_images_package_state: present
1212
# Upper constraints file for installation of python dependencies to upload
1313
# images.
1414
#
15-
# Use Train upper constraints when running with Python 2, to avoid
16-
# incompatibility with newer OSC releases. Use Yoga upper constraints
17-
# otherwise, to avoid incompatibility with openstacksdk 0.99.0.
18-
os_images_upper_constraints_file: https://releases.openstack.org/constraints/upper/{% if ansible_facts.python.version.major == 2 %}train{% else %}yoga{% endif %}
15+
# Use Yoga upper constraints to avoid incompatibility with openstacksdk 0.99.0.
16+
os_images_upper_constraints_file: https://releases.openstack.org/constraints/upper/yoga
1917

2018
# Upper constraints file for installation of DIB to build images.
2119
os_images_dib_upper_constraints_file: ""

roles/os_images/tasks/images.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# The rpm-distro element executes 'semanage' during its cleanup phase.
1111
- name: Ensure diskimage-builder SELinux dependencies are installed
1212
vars:
13-
package_name: "{{ 'policycoreutils-python' if ansible_facts.distribution_major_version | int == 7 else 'python3-policycoreutils' }}"
13+
package_name: "python3-policycoreutils"
1414
ansible.builtin.package:
1515
name: "{{ package_name }}"
1616
state: present
@@ -26,7 +26,7 @@
2626
owner: "{{ ansible_facts.user_uid }}"
2727
group: "{{ ansible_facts.user_gid }}"
2828
state: directory
29-
mode: "0644"
29+
mode: "0755"
3030
become: true
3131

3232
- name: Remove old images for force rebuild
@@ -45,7 +45,7 @@
4545
owner: "{{ ansible_facts.user_uid }}"
4646
group: "{{ ansible_facts.user_gid }}"
4747
state: directory
48-
mode: "0644"
48+
mode: "0755"
4949
with_items: "{{ os_images_list | list }}"
5050
loop_control:
5151
label: "{{ item.name }}"

roles/os_images/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: Set a fact about the Ansible python interpreter
33
ansible.builtin.set_fact:
4-
old_ansible_python_interpreter: "{{ ansible_python_interpreter | default('/usr/bin/python' + ansible_facts.python.version.major | string) }}"
4+
old_ansible_python_interpreter: "{{ ansible_python_interpreter | default('/usr/bin/python3') }}"
55

66
- name: Build or download images
77
ansible.builtin.import_tasks: images.yml

roles/os_images/tasks/promote.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
- name: Ensure images for promotion exist
3636
ansible.builtin.assert:
3737
that:
38-
- item.name in promote_list.openstack_images | map(attribute='name') | list
38+
- item.name in promote_list.images | map(attribute='name') | list
3939
fail_msg: The image {{ item.name }} does not exist.
4040
loop: "{{ os_images_list | list }}"
4141
when: item.rename_image | default(os_images_promote) | bool

0 commit comments

Comments
 (0)