blob: 736d15599c42354939ff62c7243bcae09aaf8172 [file] [log] [blame]
Peter Pentchev7b8acdc2022-11-11 11:32:02 +02001- hosts: localhost
2 connection: local
Peter Pentchevafc36372022-11-15 12:22:05 +02003 vars:
Peter Pentchev5243a992022-11-22 15:15:52 +02004 host_id: "{{ hostvars['controller']['nodepool']['external_id'] }}"
Peter Pentchevafc36372022-11-15 12:22:05 +02005 storprep_filename: "/tmp/storprep-bootstrap-{{ host_id }}.sh"
Peter Pentchev7b8acdc2022-11-11 11:32:02 +02006 tasks:
Biser Milanov3c8e02d2023-03-14 17:52:51 +02007 - name: storprep
Biser Milanovfb3a5d52023-05-12 17:28:03 +03008 when: do_storprep is defined and do_storprep
Biser Milanov3c8e02d2023-03-14 17:52:51 +02009 block:
10
Biser Milanovfb3a5d52023-05-12 17:28:03 +030011 - name: ctrl-sp-whoami-hostname
Biser Milanov3c8e02d2023-03-14 17:52:51 +020012 shell:
Biser Milanovfb3a5d52023-05-12 17:28:03 +030013 cmd: hostname || true
Biser Milanov3c8e02d2023-03-14 17:52:51 +020014
Biser Milanovfb3a5d52023-05-12 17:28:03 +030015 - 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 Milanov3c8e02d2023-03-14 17:52:51 +020018
Biser Milanovfb3a5d52023-05-12 17:28:03 +030019 - name: run_storprep
20 block:
Peter Pentchevafc36372022-11-15 12:22:05 +020021
Biser Milanovfb3a5d52023-05-12 17:28:03 +030022 - name: Create a Temporary Directory
23 ansible.builtin.tempfile:
24 state: directory
25 prefix: storprep-bootstrap.
26 register: tmpdir
Peter Pentchev1a318ae2022-11-11 11:24:39 +020027
Biser Milanovfb3a5d52023-05-12 17:28:03 +030028 - 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 Pentchev251b1f52022-11-18 10:52:30 +020054
Biser Milanov864364e2023-05-12 17:16:46 +030055- hosts: tempest
Peter Pentchev251b1f52022-11-18 10:52:30 +020056 tasks:
Peter Pentchev1e7ec642022-11-22 14:25:21 +020057 - 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 Pentchev251b1f52022-11-18 10:52:30 +020073 - name: Apply the StorPool patches
74 shell:
Peter Pentchev4bd0dd12023-01-13 11:35:00 +020075 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 Pentchev251b1f52022-11-18 10:52:30 +020083 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 Pentchev4bd0dd12023-01-13 11:35:00 +020085 when: sp_experimental is defined and sp_experimental
Peter Pentchev251b1f52022-11-18 10:52:30 +020086 become: true
87 become_user: stack
88
89 - name: Apply the StorPool patches to the other place
90 shell:
Peter Pentchev9c89b012023-01-17 15:39:38 +020091 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 Pentchev251b1f52022-11-18 10:52:30 +020092 chdir: /home/zuul/src/opendev.org
Peter Pentchev4bd0dd12023-01-13 11:35:00 +020093 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 Pentchev251b1f52022-11-18 10:52:30 +0200100
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 Pentchev7b8acdc2022-11-11 11:32:02 +0200106- hosts: all
107 tasks:
Peter Pentchev1a318ae2022-11-11 11:24:39 +0200108 - name: sp-processes
109 shell:
110 cmd: ps awwfux