Merge "Clean up developer mode logic"
This commit is contained in:
@@ -142,6 +142,9 @@ ironic_node_name: ironic
|
|||||||
# regenerated each run.
|
# regenerated each run.
|
||||||
ironic_recreate_keys: False
|
ironic_recreate_keys: False
|
||||||
|
|
||||||
|
# venv_download, even when true, will use the fallback method of building the
|
||||||
|
# venv from scratch if the venv download fails.
|
||||||
|
ironic_venv_download: "{{ not ironic_developer_mode | bool }}"
|
||||||
ironic_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/ironic.tgz
|
ironic_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/ironic.tgz
|
||||||
|
|
||||||
ironic_tftp_server_address: "{{ ansible_host }}"
|
ironic_tftp_server_address: "{{ ansible_host }}"
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
dest: "/var/cache/{{ ironic_venv_download_url | basename }}"
|
dest: "/var/cache/{{ ironic_venv_download_url | basename }}"
|
||||||
checksum: "sha1:{{ lookup('url', ironic_venv_download_url | replace('tgz', 'checksum')) }}"
|
checksum: "sha1:{{ lookup('url', ironic_venv_download_url | replace('tgz', 'checksum')) }}"
|
||||||
register: ironic_get_venv
|
register: ironic_get_venv
|
||||||
when: not ironic_developer_mode | bool
|
when: ironic_venv_download | bool
|
||||||
|
|
||||||
- name: Remove existing venv
|
- name: Remove existing venv
|
||||||
file:
|
file:
|
||||||
@@ -62,15 +62,14 @@
|
|||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
register: ironic_venv_dir
|
register: ironic_venv_dir
|
||||||
|
when: ironic_get_venv | changed
|
||||||
|
|
||||||
- name: Unarchive pre-built venv
|
- name: Unarchive pre-built venv
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "/var/cache/{{ ironic_venv_download_url | basename }}"
|
src: "/var/cache/{{ ironic_venv_download_url | basename }}"
|
||||||
dest: "{{ ironic_bin | dirname }}"
|
dest: "{{ ironic_bin | dirname }}"
|
||||||
copy: "no"
|
copy: "no"
|
||||||
when:
|
when: ironic_get_venv | changed
|
||||||
- not ironic_developer_mode | bool
|
|
||||||
- ironic_get_venv | changed or ironic_venv_dir | changed
|
|
||||||
notify: Restart ironic services
|
notify: Restart ironic services
|
||||||
|
|
||||||
- name: Install pip packages
|
- name: Install pip packages
|
||||||
@@ -87,7 +86,7 @@
|
|||||||
until: install_packages|success
|
until: install_packages|success
|
||||||
retries: 5
|
retries: 5
|
||||||
delay: 2
|
delay: 2
|
||||||
when: ironic_developer_mode | bool
|
when: ironic_get_venv | failed or ironic_get_venv | skipped
|
||||||
notify: Restart ironic services
|
notify: Restart ironic services
|
||||||
|
|
||||||
- name: CentOS remove python from path first
|
- name: CentOS remove python from path first
|
||||||
@@ -96,12 +95,9 @@
|
|||||||
state: "absent"
|
state: "absent"
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == 'yum'
|
- ansible_pkg_mgr == 'yum'
|
||||||
- not ironic_developer_mode | bool
|
- ironic_get_venv | changed
|
||||||
- ironic_get_venv | changed or ironic_venv_dir | changed
|
|
||||||
|
|
||||||
- name: Update virtualenv path
|
- name: Update virtualenv path
|
||||||
command: >
|
command: >
|
||||||
virtualenv-tools --update-path=auto --reinitialize {{ ironic_bin | dirname }}
|
virtualenv-tools --update-path=auto --reinitialize {{ ironic_bin | dirname }}
|
||||||
when:
|
when: ironic_get_venv | changed
|
||||||
- not ironic_developer_mode | bool
|
|
||||||
- ironic_get_venv | changed or ironic_venv_dir | changed
|
|
||||||
|
|||||||
Reference in New Issue
Block a user