Peter Pentchev | 7b8acdc | 2022-11-11 11:32:02 +0200 | [diff] [blame] | 1 | - hosts: localhost |
| 2 | connection: local |
Peter Pentchev | afc3637 | 2022-11-15 12:22:05 +0200 | [diff] [blame] | 3 | vars: |
Peter Pentchev | 5243a99 | 2022-11-22 15:15:52 +0200 | [diff] [blame] | 4 | host_id: "{{ hostvars['controller']['nodepool']['external_id'] }}" |
Peter Pentchev | afc3637 | 2022-11-15 12:22:05 +0200 | [diff] [blame] | 5 | storprep_filename: "/tmp/storprep-bootstrap-{{ host_id }}.sh" |
Peter Pentchev | 7b8acdc | 2022-11-11 11:32:02 +0200 | [diff] [blame] | 6 | tasks: |
Biser Milanov | 3c8e02d | 2023-03-14 17:52:51 +0200 | [diff] [blame] | 7 | - name: storprep |
Biser Milanov | fb3a5d5 | 2023-05-12 17:28:03 +0300 | [diff] [blame] | 8 | when: do_storprep is defined and do_storprep |
Biser Milanov | 3c8e02d | 2023-03-14 17:52:51 +0200 | [diff] [blame] | 9 | block: |
| 10 | |
Biser Milanov | fb3a5d5 | 2023-05-12 17:28:03 +0300 | [diff] [blame] | 11 | - name: ctrl-sp-whoami-hostname |
Biser Milanov | 3c8e02d | 2023-03-14 17:52:51 +0200 | [diff] [blame] | 12 | shell: |
Biser Milanov | fb3a5d5 | 2023-05-12 17:28:03 +0300 | [diff] [blame] | 13 | cmd: hostname || true |
Biser Milanov | 3c8e02d | 2023-03-14 17:52:51 +0200 | [diff] [blame] | 14 | |
Biser Milanov | fb3a5d5 | 2023-05-12 17:28:03 +0300 | [diff] [blame] | 15 | - name: ctrl-sp-fetch-storprep |
| 16 | shell: |
| 17 | cmd: curl -C - -o '{{ storprep_filename }}' -- https://spfactory.storpool.com/sp-osci/storprep-bootstrap-sh.txt |
Biser Milanov | 3c8e02d | 2023-03-14 17:52:51 +0200 | [diff] [blame] | 18 | |
Biser Milanov | fb3a5d5 | 2023-05-12 17:28:03 +0300 | [diff] [blame] | 19 | - name: run_storprep |
| 20 | block: |
Peter Pentchev | afc3637 | 2022-11-15 12:22:05 +0200 | [diff] [blame] | 21 | |
Biser Milanov | fb3a5d5 | 2023-05-12 17:28:03 +0300 | [diff] [blame] | 22 | - name: Create a Temporary Directory |
| 23 | ansible.builtin.tempfile: |
| 24 | state: directory |
| 25 | prefix: storprep-bootstrap. |
| 26 | register: tmpdir |
Peter Pentchev | 1a318ae | 2022-11-11 11:24:39 +0200 | [diff] [blame] | 27 | |
Biser Milanov | fb3a5d5 | 2023-05-12 17:28:03 +0300 | [diff] [blame] | 28 | - name: Provision OpenStack Data |
| 29 | no_log: true |
| 30 | ansible.builtin.copy: |
| 31 | content: "{{ OPENSTACK_DATA['v'] }}" |
| 32 | dest: "{{ tmpdir.path }}/clouds.yaml" |
| 33 | mode: '0600' |
| 34 | |
| 35 | - name: ctrl-sp-run-storprep |
| 36 | shell: |
| 37 | cmd: sh '{{ storprep_filename }}' -d '{{ tmpdir.path }}' -- -n lab-charmed-testing-storage -s lab-vlan400 -- {{ host_id }} |
| 38 | |
| 39 | always: |
| 40 | |
| 41 | - name: Remove the Temporary Directory |
| 42 | ansible.builtin.file: |
| 43 | path: "{{ tmpdir.path }}" |
| 44 | state: absent |
| 45 | when: tmpdir.path is defined |
| 46 | |
| 47 | - name: ctrl-sp-rm-storprep |
| 48 | shell: |
| 49 | cmd: rm -- '{{ storprep_filename }}' |
| 50 | |
| 51 | - name: ctrl-sp-processes |
| 52 | shell: |
| 53 | cmd: ps awwfux |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 54 | |
Biser Milanov | 864364e | 2023-05-12 17:16:46 +0300 | [diff] [blame] | 55 | - hosts: tempest |
Biser Milanov | 94d3fc1 | 2023-06-07 11:00:26 +0300 | [diff] [blame^] | 56 | vars: |
| 57 | homedir: "{{ ansible_env.HOME }}" |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 58 | tasks: |
Peter Pentchev | 1e7ec64 | 2022-11-22 14:25:21 +0200 | [diff] [blame] | 59 | - name: sp-examine-pwd |
| 60 | shell: |
| 61 | cmd: pwd |
| 62 | |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 63 | - name: sp-examine-ls-homedir |
Peter Pentchev | 1e7ec64 | 2022-11-22 14:25:21 +0200 | [diff] [blame] | 64 | shell: |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 65 | cmd: ls -l {{ homedir }} |
Peter Pentchev | 1e7ec64 | 2022-11-22 14:25:21 +0200 | [diff] [blame] | 66 | |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 67 | - name: sp-examine-ls-homedir-src |
Peter Pentchev | 1e7ec64 | 2022-11-22 14:25:21 +0200 | [diff] [blame] | 68 | shell: |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 69 | cmd: ls -l {{ homedir }}/src |
Peter Pentchev | 1e7ec64 | 2022-11-22 14:25:21 +0200 | [diff] [blame] | 70 | |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 71 | - name: sp-examine-ls-homedir/src/spfactory.storpool.com |
Peter Pentchev | 1e7ec64 | 2022-11-22 14:25:21 +0200 | [diff] [blame] | 72 | shell: |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 73 | cmd: ls -l {{ homedir }}/src/spfactory.storpool.com |
Peter Pentchev | 1e7ec64 | 2022-11-22 14:25:21 +0200 | [diff] [blame] | 74 | |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 75 | - name: Apply the StorPool patches |
| 76 | shell: |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 77 | cmd: "{{ homedir }}/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s {{ homedir }}/src/spfactory.storpool.com/sp-osci/patches/series -S am" |
Peter Pentchev | 4bd0dd1 | 2023-01-13 11:35:00 +0200 | [diff] [blame] | 78 | chdir: /opt/stack |
| 79 | when: sp_experimental is not defined or not sp_experimental |
| 80 | become: true |
| 81 | become_user: stack |
| 82 | |
| 83 | - name: Apply the StorPool experimental patches |
| 84 | shell: |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 85 | cmd: "{{ homedir }}/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s {{ homedir }}/src/spfactory.storpool.com/sp-osci/patches/series.experimental -S am" |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 86 | chdir: /opt/stack |
Peter Pentchev | 4bd0dd1 | 2023-01-13 11:35:00 +0200 | [diff] [blame] | 87 | when: sp_experimental is defined and sp_experimental |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 88 | become: true |
| 89 | become_user: stack |
| 90 | |
| 91 | - name: Apply the StorPool patches to the other place |
| 92 | shell: |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 93 | cmd: "{{ homedir }}/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s {{ homedir }}/src/spfactory.storpool.com/sp-osci/patches/series am" |
| 94 | chdir: "{{ homedir }}/src/opendev.org" |
Peter Pentchev | 4bd0dd1 | 2023-01-13 11:35:00 +0200 | [diff] [blame] | 95 | when: sp_experimental is not defined or not sp_experimental |
| 96 | |
| 97 | - name: Apply the StorPool experimental patches to the other place |
| 98 | shell: |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 99 | cmd: "{{ homedir }}/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s {{ homedir }}/src/spfactory.storpool.com/sp-osci/patches/series.experimental am" |
| 100 | chdir: "{{ homedir }}/src/opendev.org" |
Peter Pentchev | 4bd0dd1 | 2023-01-13 11:35:00 +0200 | [diff] [blame] | 101 | when: sp_experimental is defined and sp_experimental |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 102 | |
| 103 | # - name: Set up the random StorPool volume prefix |
| 104 | # shell: |
Biser Milanov | 70965da | 2023-06-07 10:25:35 +0300 | [diff] [blame] | 105 | # cmd: "{{ homedir }}/src/spfactory.storpool.com/sp-osci/tools/bin/sp_rand_init" |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 106 | # become: true |
| 107 | |
Peter Pentchev | 7b8acdc | 2022-11-11 11:32:02 +0200 | [diff] [blame] | 108 | - hosts: all |
| 109 | tasks: |
Peter Pentchev | 1a318ae | 2022-11-11 11:24:39 +0200 | [diff] [blame] | 110 | - name: sp-processes |
| 111 | shell: |
| 112 | cmd: ps awwfux |