|
| 1 | +- name: Install lustre build prerequisites |
| 2 | + ansible.builtin.dnf: |
| 3 | + name: "{{ lustre_build_packages }}" |
| 4 | + register: _lustre_dnf_build_packages |
| 5 | + |
| 6 | +- name: Clone lustre git repo |
| 7 | + ansible.builtin.git: |
| 8 | + repo: git://git.whamcloud.com/fs/lustre-release.git |
| 9 | + dest: "{{ lustre_build_dir }}" |
| 10 | + version: "{{ lustre_version }}" |
| 11 | + |
| 12 | +- name: Prepare for lustre configuration |
| 13 | + ansible.builtin.command: |
| 14 | + cmd: ./autogen.sh |
| 15 | + chdir: "{{ lustre_build_dir }}" |
| 16 | + |
| 17 | +- name: Configure lustre build |
| 18 | + ansible.builtin.command: |
| 19 | + cmd: "./configure {{ lustre_configure_opts | join(' ') }}" |
| 20 | + chdir: "{{ lustre_build_dir }}" |
| 21 | + |
| 22 | +- name: Build lustre |
| 23 | + ansible.builtin.command: |
| 24 | + cmd: make rpms |
| 25 | + chdir: "{{ lustre_build_dir }}" |
| 26 | + |
| 27 | +- name: Find rpms |
| 28 | + ansible.builtin.find: |
| 29 | + paths: "{{ lustre_build_dir }}" |
| 30 | + patterns: "{{ lustre_rpm_globs }}" |
| 31 | + use_regex: false |
| 32 | + register: _lustre_find_rpms |
| 33 | + |
| 34 | +- name: Check rpms found |
| 35 | + assert: |
| 36 | + that: _lustre_find_rpms.files | length |
| 37 | + fail_msg: "No lustre repos found with lustre_rpm_globs = {{ lustre_rpm_globs }}" |
| 38 | + |
| 39 | +- name: Install lustre rpms |
| 40 | + ansible.builtin.dnf: |
| 41 | + name: "{{ _lustre_find_rpms.files | map(attribute='path')}}" |
| 42 | + disable_gpg_check: yes |
| 43 | + |
| 44 | +- block: |
| 45 | + - name: Remove lustre build prerequisites |
| 46 | + # NB only remove ones this role installed! |
| 47 | + ansible.builtin.dnf: |
| 48 | + name: "{{ item | regex_replace('Installed: ', '') }}" |
| 49 | + state: absent |
| 50 | + loop: "{{ _lustre_dnf_build_packages.results }}" |
| 51 | + |
| 52 | + - name: Delete lustre build dir |
| 53 | + file: |
| 54 | + path: "{{ lustre_build_dir }}" |
| 55 | + state: absent |
| 56 | + when: lustre_cleanup_build | bool |
0 commit comments