This repository was archived by the owner on Jan 20, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +136
-0
lines changed Expand file tree Collapse file tree 4 files changed +136
-0
lines changed Original file line number Diff line number Diff line change 1+ #
2+ # SPDX-License-Identifier: Apache-2.0
3+ #
4+ ---
5+ - name : Get the list of components
6+ uri :
7+ url : " {{ infrastructure.software.api_endpoint }}/ak/api/v1/components"
8+ url_username : " {{ infrastructure.software.api_key }}"
9+ url_password : " {{ infrastructure.software.api_secret }}"
10+ method : GET
11+ return_content : yes
12+ validate_certs : no
13+ register : ibp_components
14+
15+ - name : Check for certificate authority
16+ set_fact :
17+ ibp_ca_count : " {{
18+ ibp_components.json |
19+ selectattr('display_name', 'defined') |
20+ selectattr('display_name', 'eq', ca.ibp.display_name) |
21+ list
22+ }}"
23+
24+ - name : Delete certificate authority
25+ uri :
26+ url : " {{ infrastructure.software.api_endpoint }}/ak/api/v1/components/{{ ibp_ca.id }}"
27+ url_username : " {{ infrastructure.software.api_key }}"
28+ url_password : " {{ infrastructure.software.api_secret }}"
29+ method : DELETE
30+ validate_certs : no
31+ changed_when : True
32+ with_items : " {{ ibp_ca_count }}"
33+ loop_control :
34+ loop_var : ibp_ca
Original file line number Diff line number Diff line change 1+ #
2+ # SPDX-License-Identifier: Apache-2.0
3+ #
4+ ---
5+ - name : Get the list of components
6+ uri :
7+ url : " {{ infrastructure.software.api_endpoint }}/ak/api/v1/components"
8+ url_username : " {{ infrastructure.software.api_key }}"
9+ url_password : " {{ infrastructure.software.api_secret }}"
10+ method : GET
11+ return_content : yes
12+ validate_certs : no
13+ register : ibp_components
14+
15+ - name : Check for MSP
16+ set_fact :
17+ ibp_msp_count : " {{
18+ ibp_components.json |
19+ selectattr('display_name', 'defined') |
20+ selectattr('display_name', 'eq', organization.msp.ibp.display_name) |
21+ list
22+ }}"
23+
24+ - name : Delete MSP
25+ uri :
26+ url : " {{ infrastructure.software.api_endpoint }}/ak/api/v1/components/{{ ibp_msp.id }}"
27+ url_username : " {{ infrastructure.software.api_key }}"
28+ url_password : " {{ infrastructure.software.api_secret }}"
29+ method : DELETE
30+ validate_certs : no
31+ changed_when : True
32+ with_items : " {{ ibp_msp_count }}"
33+ loop_control :
34+ loop_var : ibp_msp
Original file line number Diff line number Diff line change 1+ #
2+ # SPDX-License-Identifier: Apache-2.0
3+ #
4+ ---
5+ - name : Get the list of components
6+ uri :
7+ url : " {{ infrastructure.software.api_endpoint }}/ak/api/v1/components"
8+ url_username : " {{ infrastructure.software.api_key }}"
9+ url_password : " {{ infrastructure.software.api_secret }}"
10+ method : GET
11+ return_content : yes
12+ validate_certs : no
13+ register : ibp_components
14+
15+ - name : Check for orderer
16+ set_fact :
17+ ibp_orderer_count : " {{
18+ ibp_components.json |
19+ selectattr('cluster_name', 'defined') |
20+ selectattr('cluster_name', 'eq', orderer.ibp.cluster_name) |
21+ list
22+ }}"
23+
24+ - name : Delete orderer
25+ uri :
26+ url : " {{ infrastructure.software.api_endpoint }}/ak/api/v1/components/{{ ibp_orderer.id }}"
27+ url_username : " {{ infrastructure.software.api_key }}"
28+ url_password : " {{ infrastructure.software.api_secret }}"
29+ method : DELETE
30+ validate_certs : no
31+ changed_when : True
32+ with_items : " {{ ibp_orderer_count }}"
33+ loop_control :
34+ loop_var : ibp_orderer
Original file line number Diff line number Diff line change 1+ #
2+ # SPDX-License-Identifier: Apache-2.0
3+ #
4+ ---
5+ - name : Get the list of components
6+ uri :
7+ url : " {{ infrastructure.software.api_endpoint }}/ak/api/v1/components"
8+ url_username : " {{ infrastructure.software.api_key }}"
9+ url_password : " {{ infrastructure.software.api_secret }}"
10+ method : GET
11+ return_content : yes
12+ validate_certs : no
13+ register : ibp_components
14+
15+ - name : Check for peer
16+ set_fact :
17+ ibp_peer_count : " {{
18+ ibp_components.json |
19+ selectattr('display_name', 'defined') |
20+ selectattr('display_name', 'eq', peer.ibp.display_name) |
21+ list
22+ }}"
23+
24+ - name : Delete peer
25+ uri :
26+ url : " {{ infrastructure.software.api_endpoint }}/ak/api/v1/components/{{ ibp_peer.id }}"
27+ url_username : " {{ infrastructure.software.api_key }}"
28+ url_password : " {{ infrastructure.software.api_secret }}"
29+ method : DELETE
30+ validate_certs : no
31+ changed_when : True
32+ with_items : " {{ ibp_peer_count }}"
33+ loop_control :
34+ loop_var : ibp_peer
You can’t perform that action at this time.
0 commit comments