File tree Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ OpenStack Images
22================
33
44This 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
77Requirements
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') }}"
Original file line number Diff line number Diff 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.
2119os_images_dib_upper_constraints_file : " "
Original file line number Diff line number Diff line change 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
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
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 }}"
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments