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