This repository was archived by the owner on May 31, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 tags :
3030 - infra-vm-provision
3131 tasks :
32- - name : Wait for a connection to VM with bootstrap user
33- wait_for_connection :
32+ - name : Wait for SSH access to the infra VM
33+ wait_for :
34+ host : " {{ hostvars[inventory_hostname].ansible_host }}"
35+ port : 22
36+ state : started
3437 # NOTE: Ensure we exceed the 5 minute DHCP timeout of the eth0
3538 # interface if necessary.
36- timeout : 600
37- vars :
38- # NOTE(wszumski): ansible_host_key_checking variable doesn't seem to
39- # work, But it would be nice not to fail if the host_key changes.
40- # We check the hostkey during host configure.
41- # https://github.com/ansible/ansible/blob/1c34492413dec09711c430745034db0c108227a9/lib/ansible/plugins/connection/ssh.py#L49
42- # https://github.com/ansible/ansible/issues/49254
43- ansible_ssh_extra_args : ' {{ infra_vm_wait_connection_ssh_extra_args }}'
44- ansible_user : " {{ bootstrap_user }}"
39+ timeout : 360
40+ delegate_to : localhost
Original file line number Diff line number Diff line change 4949 mime : False
5050 register : stat_result
5151
52+ # NOTE(mgoddard): Prior to the Xena release, the seed VM was provisioned using
53+ # the stackhpc.livirt-vm role with become=true. This resulted in the cached
54+ # image being owned by root. Since Xena, we execute the role without
55+ # become=true. Correct the image ownership to avoid a permission denied error
56+ # when downloading a new image of the same name.
57+ - name : " [{{ vm_name }}] Stat image files"
58+ stat :
59+ path : " {{ image_cache_path }}/{{ item.image | basename }}"
60+ with_items : " {{ vm_hostvars.infra_vm_volumes | selectattr('image', 'defined') }}"
61+ register : image_stat_result
62+
63+ - name : " [{{ vm_name }}] Fix image ownership"
64+ file :
65+ path : " {{ image_cache_path }}/{{ item.item.image | basename }}"
66+ owner : " {{ ansible_facts.user_uid }}"
67+ group : " {{ ansible_facts.user_gid }}"
68+ with_items : " {{ image_stat_result.results }}"
69+ when : item.stat.exists
70+ become : true
71+
5272- name : " [{{ vm_name }}] Ensure that the VM is provisioned"
5373 include_role :
5474 name : stackhpc.libvirt-vm
Original file line number Diff line number Diff line change 2929 group : " {{ ansible_facts.user_gid }}"
3030 become : True
3131
32+ # NOTE(mgoddard): Prior to the Xena release, the seed VM was provisioned
33+ # using the stackhpc.livirt-vm role with become=true. This resulted in the
34+ # cached image being owned by root. Since Xena, we execute the role without
35+ # become=true. Correct the image ownership to avoid a permission denied
36+ # error when downloading a new image of the same name.
37+ - name : Stat image files
38+ stat :
39+ path : " {{ image_cache_path }}/{{ item.image | basename }}"
40+ with_items : " {{ hostvars[seed_host].seed_vm_volumes | selectattr('image', 'defined') }}"
41+ register : image_stat_result
42+
43+ - name : Fix image ownership
44+ file :
45+ path : " {{ image_cache_path }}/{{ item.item.image | basename }}"
46+ owner : " {{ ansible_facts.user_uid }}"
47+ group : " {{ ansible_facts.user_gid }}"
48+ with_items : " {{ image_stat_result.results }}"
49+ when : item.stat.exists
50+ become : true
51+
3252 roles :
3353 - role : jriguera.configdrive
3454 # For now assume the VM OS family is the same as the hypervisor's.
99119 volumes : " {{ hostvars[seed_host].seed_vm_volumes + [seed_vm_configdrive_volume] }}"
100120 interfaces : " {{ hostvars[seed_host].seed_vm_interfaces }}"
101121 console_log_enabled : true
102- become : True
103122
104123 tasks :
105124 - name : Wait for SSH access to the seed VM
Original file line number Diff line number Diff line change 1+ ---
2+ fixes :
3+ - |
4+ Fixes an issue where cached seed VM images are unnecessarily owned by root.
5+ See `story 2009277 <https://storyboard.openstack.org/#!/story/2009277>`__
6+ for details.
You can’t perform that action at this time.
0 commit comments