Execution
Date
15 Dec 2025 10:19:13 +0000
Duration
00:23:12.82
Controller
aio1.openstack.local
User
root
Versions
Ansible
2.18.6
ara
1.7.4 / 1.7.4
Python
3.12.3
Summary
9
Hosts
618
Tasks
960
Results
108
Plays
456
Files
0
Records
File: /home/zuul/src/opendev.org/openstack/openstack-ansible-os_glance/tasks/glance_install.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | --- # Copyright 2014, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - name: Record the installation method community.general.ini_file: dest: "/etc/ansible/facts.d/openstack_ansible.fact" section: "glance" option: "install_method" value: "{{ glance_install_method }}" mode: "0644" - name: Refresh local facts to ensure the glance section is present ansible.builtin.setup: filter: ansible_local gather_subset: "!all" - name: Create the system group ansible.builtin.group: name: "{{ glance_system_group_name }}" gid: "{{ glance_system_group_gid | default(omit) }}" state: "present" system: "yes" - name: Create the glance system user ansible.builtin.user: name: "{{ glance_system_user_name }}" uid: "{{ glance_system_user_uid | default(omit) }}" group: "{{ glance_system_group_name }}" comment: "{{ glance_system_comment }}" shell: "{{ glance_system_shell }}" system: "yes" createhome: "yes" home: "{{ glance_system_user_home }}" # NOTE(cloudnull): During an upgrade the local directory may exist on a source # install. If the directory does exist it will need to be # removed. This is required on source installs because the # config directory is a link. - name: Source config block block: - name: Stat config directory ansible.builtin.stat: path: "{{ glance_etc_dir }}" register: glance_conf_dir_stat - name: Remove the config directory ansible.builtin.file: path: "{{ glance_etc_dir }}" state: absent when: - glance_conf_dir_stat.stat.isdir is defined and glance_conf_dir_stat.stat.isdir when: - glance_install_method == 'source' - name: Create glance directories ansible.builtin.file: path: "{{ item.path | default(omit) }}" src: "{{ item.src | default(omit) }}" dest: "{{ item.dest | default(omit) }}" state: "{{ item.state | default('directory') }}" owner: "{{ item.owner | default(glance_system_user_name) }}" group: "{{ item.group | default(glance_system_group_name) }}" mode: "{{ item.mode | default(omit) }}" force: "{{ item.force | default(omit) }}" when: - (item.condition | default(true)) | bool - (item.dest | default(item.path)) not in glance_mount_points with_items: - path: "/openstack" mode: "0755" owner: "root" group: "root" - path: "{{ (glance_install_method == 'distro') | ternary(glance_etc_dir, (glance_bin | dirname) + glance_etc_dir) }}" mode: "0755" # NOTE(cloudnull): The "src" path is relative. This ensures all files remain # within the host/container confines when connecting to # them using the connection plugin or the root filesystem. - dest: "{{ glance_etc_dir }}" src: "{{ glance_bin | dirname | regex_replace('^/', '../') }}/etc/glance" state: link force: true condition: "{{ glance_install_method == 'source' }}" - path: "{{ glance_etc_dir }}/rootwrap.d" owner: "root" group: "root" mode: "0750" - path: "/var/cache/glance" - path: "{{ glance_system_user_home }}" - path: "{{ glance_system_user_home }}/cache" - path: "{{ glance_system_user_home }}/cache/api" mode: "0700" - path: "{{ glance_system_user_home }}/scrubber" - path: "{{ glance_system_user_home }}/{{ glance_images_local_directory }}" mode: "0755" - name: Install distro packages ansible.builtin.package: name: "{{ glance_package_list }}" state: "{{ glance_package_state }}" update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}" cache_valid_time: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary(cache_timeout, omit) }}" register: install_packages until: install_packages is success retries: 5 delay: 2 notify: - "Restart glance services" - name: Install the python venv ansible.builtin.import_role: name: "python_venv_build" vars: venv_python_executable: "{{ glance_venv_python_executable }}" venv_build_constraints: "{{ glance_git_constraints }}" venv_build_distro_package_list: "{{ glance_devel_distro_packages }}" venv_install_destination_path: "{{ glance_bin | dirname }}" venv_install_distro_package_list: "{{ glance_distro_packages }}" venv_pip_install_args: "{{ glance_pip_install_args }}" venv_pip_packages: "{{ glance_pip_packages | union(glance_user_pip_packages) }}" venv_facts_when_changed: - section: "glance" option: "venv_tag" value: "{{ glance_venv_tag }}" when: glance_install_method == 'source' - name: Run the systemd service role ansible.builtin.include_role: name: systemd_service apply: tags: - glance-config - systemd-service vars: systemd_user_name: "{{ glance_system_user_name }}" systemd_group_name: "{{ glance_system_group_name }}" systemd_tempd_prefix: openstack systemd_slice_name: glance systemd_lock_dir: /run/lock systemd_service_cpu_accounting: true systemd_service_block_io_accounting: true systemd_service_memory_accounting: true systemd_service_tasks_accounting: true systemd_services: - service_name: "{{ service_var.service_name }}" enabled: "{{ service_var.enabled | default(True) }}" state: "{{ service_var.state | default('started') }}" execstarts: "{{ service_var.execstarts }}" execreloads: "{{ service_var.execreloads | default([]) }}" config_overrides: "{{ service_var.init_config_overrides }}" with_items: "{{ filtered_glance_services }}" loop_control: loop_var: service_var tags: - glance-config - systemd-service |