mirror of https://gerrit.osmocom.org/osmo-ci
ansible: install-poky-sdk: ensure it's not installed twice
Check if the poky path already exists. Even this wouldn't detect if the poky has been only installed half way. Related: OS#5801 Change-Id: I8ff8e72a5974378327d4692341b0a371c667b741
This commit is contained in:
parent
6a290081c5
commit
e64f85a0ee
|
@ -9,40 +9,45 @@
|
||||||
cache_valid_time: 3600
|
cache_valid_time: 3600
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
||||||
- name: copy poky installer
|
- name: check if poky needs to be installed
|
||||||
|
stat:
|
||||||
|
path: "{{ poky_dest }}"
|
||||||
|
register: poky_stat
|
||||||
|
tags: [poky]
|
||||||
|
|
||||||
|
- name: install poky if required
|
||||||
|
tags: [poky]
|
||||||
|
when: poky_stat.stat.exists == False
|
||||||
|
block:
|
||||||
|
- name: copy poky installer
|
||||||
copy:
|
copy:
|
||||||
src: "{{ poky_installer_file }}"
|
src: "{{ poky_installer_file }}"
|
||||||
dest: "/tmp/{{ poky_installer_file }}"
|
dest: "/tmp/{{ poky_installer_file }}"
|
||||||
mode: 0750
|
mode: 0750
|
||||||
register: poky_copy
|
register: poky_copy
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
tags: [poky]
|
|
||||||
|
|
||||||
- name: execute poky installer
|
- name: execute poky installer
|
||||||
command: "/tmp/{{ poky_installer_file }} -y -d '{{ poky_dest }}'"
|
command: "/tmp/{{ poky_installer_file }} -y -d '{{ poky_dest }}'"
|
||||||
args:
|
args:
|
||||||
creates: "{{ poky_dest }}"
|
creates: "{{ poky_dest }}"
|
||||||
when: poky_copy.failed == False
|
when: poky_copy.failed == False
|
||||||
tags: [poky]
|
|
||||||
|
|
||||||
- name: change owner/group to jenkins user
|
- name: change owner/group to jenkins user
|
||||||
file:
|
file:
|
||||||
path: "{{ poky_dest }}"
|
path: "{{ poky_dest }}"
|
||||||
owner: "{{ jenkins_user }}"
|
owner: "{{ jenkins_user }}"
|
||||||
group: "{{ jenkins_user }}"
|
group: "{{ jenkins_user }}"
|
||||||
recurse: yes
|
recurse: yes
|
||||||
when: poky_copy.failed == False
|
when: poky_copy.failed == False
|
||||||
tags: [poky]
|
|
||||||
|
|
||||||
- name: remove poky installer
|
- name: remove poky installer
|
||||||
file:
|
file:
|
||||||
path: "/tmp/{{ poky_installer_file }}"
|
path: "/tmp/{{ poky_installer_file }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: poky_copy.failed == False
|
when: poky_copy.failed == False
|
||||||
tags: [poky]
|
|
||||||
|
|
||||||
- name: "Please download {{ poky_installer_file }} to your ansible directory to allow ansible to install poky"
|
- name: "Please download {{ poky_installer_file }} to your ansible directory to allow ansible to install poky"
|
||||||
debug:
|
debug:
|
||||||
msg: "Ansible can not find or copy {{ poky_installer_file }}"
|
msg: "Ansible can not find or copy {{ poky_installer_file }}"
|
||||||
when: poky_copy.failed == True
|
when: poky_copy.failed == True
|
||||||
tags: [poky]
|
|
||||||
|
|
Loading…
Reference in New Issue