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 |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 56 | tasks: |
Peter Pentchev | 1e7ec64 | 2022-11-22 14:25:21 +0200 | [diff] [blame] | 57 | - name: sp-examine-pwd |
| 58 | shell: |
| 59 | cmd: pwd |
| 60 | |
| 61 | - name: sp-examine-ls-zuul |
| 62 | shell: |
| 63 | cmd: ls -l /home/zuul |
| 64 | |
| 65 | - name: sp-examine-ls-zuul-src |
| 66 | shell: |
| 67 | cmd: ls -l /home/zuul/src |
| 68 | |
| 69 | - name: sp-examine-ls-zuul/src/spfactory.storpool.com |
| 70 | shell: |
| 71 | cmd: ls -l /home/zuul/src/spfactory.storpool.com |
| 72 | |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 73 | - name: Apply the StorPool patches |
| 74 | shell: |
Peter Pentchev | 4bd0dd1 | 2023-01-13 11:35:00 +0200 | [diff] [blame] | 75 | cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s /home/zuul/src/spfactory.storpool.com/sp-osci/patches/series -S am |
| 76 | chdir: /opt/stack |
| 77 | when: sp_experimental is not defined or not sp_experimental |
| 78 | become: true |
| 79 | become_user: stack |
| 80 | |
| 81 | - name: Apply the StorPool experimental patches |
| 82 | shell: |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 83 | cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s /home/zuul/src/spfactory.storpool.com/sp-osci/patches/series.experimental -S am |
| 84 | chdir: /opt/stack |
Peter Pentchev | 4bd0dd1 | 2023-01-13 11:35:00 +0200 | [diff] [blame] | 85 | when: sp_experimental is defined and sp_experimental |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 86 | become: true |
| 87 | become_user: stack |
| 88 | |
| 89 | - name: Apply the StorPool patches to the other place |
| 90 | shell: |
Peter Pentchev | 9c89b01 | 2023-01-17 15:39:38 +0200 | [diff] [blame] | 91 | cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s /home/zuul/src/spfactory.storpool.com/sp-osci/patches/series am |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 92 | chdir: /home/zuul/src/opendev.org |
Peter Pentchev | 4bd0dd1 | 2023-01-13 11:35:00 +0200 | [diff] [blame] | 93 | when: sp_experimental is not defined or not sp_experimental |
| 94 | |
| 95 | - name: Apply the StorPool experimental patches to the other place |
| 96 | shell: |
| 97 | cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s /home/zuul/src/spfactory.storpool.com/sp-osci/patches/series.experimental am |
| 98 | chdir: /home/zuul/src/opendev.org |
| 99 | when: sp_experimental is defined and sp_experimental |
Peter Pentchev | 251b1f5 | 2022-11-18 10:52:30 +0200 | [diff] [blame] | 100 | |
| 101 | # - name: Set up the random StorPool volume prefix |
| 102 | # shell: |
| 103 | # cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/sp_rand_init |
| 104 | # become: true |
| 105 | |
Peter Pentchev | 7b8acdc | 2022-11-11 11:32:02 +0200 | [diff] [blame] | 106 | - hosts: all |
| 107 | tasks: |
Peter Pentchev | 1a318ae | 2022-11-11 11:24:39 +0200 | [diff] [blame] | 108 | - name: sp-processes |
| 109 | shell: |
| 110 | cmd: ps awwfux |