Skip to content

Commit 1cb22d4

Browse files
authored
Merge pull request #55 from marcelmamula/launchpad_replace
all: Replace sap_launchpad tasks with new role sap_software_download
2 parents c8925c7 + edbbf4d commit 1cb22d4

File tree

70 files changed

+676
-2709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+676
-2709
lines changed

deploy_scenarios/sap_bw4hana_sandbox/ansible_playbook.yml

Lines changed: 18 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}"
4747
when: playbook_enable_interactive_prompts
4848

49-
- name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }}
50-
ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml"
51-
when: playbook_enable_interactive_prompts
52-
5349

5450
#### Provision VM ####
5551

@@ -115,82 +111,32 @@
115111

116112
#### Begin downloading SAP software installation media to hosts ####
117113

118-
- name: Ansible Play for preparing downloads of SAP Software installation media
119-
hosts: hana_primary
120-
become: true
121-
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
122-
max_fail_percentage: 0
123-
tasks:
124-
125-
- name: Create directories if does not exist
126-
ansible.builtin.file:
127-
path: "{{ item }}"
128-
state: directory
129-
mode: '0755'
130-
loop:
131-
- "{{ sap_install_media_detect_source_directory }}"
132-
133-
- name: Install Python package manager pip3 to system Python
134-
ansible.builtin.package:
135-
name: python3-pip
136-
state: present
137-
138-
- name: Ensure OS Packages for lxml are installed
139-
ansible.builtin.package:
140-
name:
141-
- python3-lxml
142-
- libxslt-devel
143-
- libxml2-devel
144-
state: present
145-
146-
- name: Install Python dependency wheel to system Python
147-
ansible.builtin.pip:
148-
name:
149-
- wheel
150-
151-
- name: Install Python dependencies for Ansible Modules to system Python
152-
ansible.builtin.pip:
153-
name:
154-
- urllib3
155-
- requests
156-
- beautifulsoup4
157-
- lxml
158-
159-
160-
161114
- name: Ansible Play for downloading SAP BW/4HANA installation media
162115
hosts: hana_primary
163116
become: true
164117
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
165118
max_fail_percentage: 0
166119
tasks:
167120

168-
# Set facts based on the install dictionary and the default template selected
169-
- name: Set fact x86_64 softwarecenter_search_list_bw4hana_install
170-
ansible.builtin.set_fact:
171-
softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}"
172-
when:
173-
- ansible_architecture == "x86_64"
121+
# SAP software download will only occur if the 'community.sap_launchpad' collection is installed.
122+
# Playbook will continue without the collection, assuming SAP software is already available.
123+
- name: Check availability of sap_launchpad collection on execution node
124+
delegate_to: localhost
125+
ansible.builtin.command:
126+
cmd: ansible-galaxy collection list
127+
register: sap_playbook_collection_list_output
174128

175-
# Set facts based on the install dictionary and the default template selected
176-
- name: Set fact ppc64le softwarecenter_search_list_bw4hana_install
177-
ansible.builtin.set_fact:
178-
softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}"
179-
when:
180-
- ansible_architecture == "ppc64le"
181-
182-
- name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA
183-
community.sap_launchpad.software_center_download:
184-
suser_id: "{{ sap_id_user }}"
185-
suser_password: "{{ sap_id_user_password }}"
186-
softwarecenter_search_query: "{{ item }}"
187-
dest: "{{ sap_install_media_detect_source_directory }}"
188-
loop: "{{ softwarecenter_search_list_bw4hana_install }}"
189-
loop_control:
190-
label: "{{ item }} : {{ download_task.msg }}"
191-
register: download_task
192-
retries: 1
193-
until: download_task is not failed
129+
- name: Execute Ansible Role sap_software_download
130+
ansible.builtin.include_role:
131+
name: community.sap_launchpad.sap_software_download
132+
vars:
133+
sap_software_download_suser_id: "{{ sap_id_user }}"
134+
sap_software_download_suser_password: "{{ sap_id_user_password }}"
135+
sap_software_download_directory: "{{ sap_install_media_detect_source_directory }}"
136+
sap_software_download_deduplicate: first
137+
sap_software_download_files: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]
138+
['softwarecenter_search_list_saphana_' ~ ansible_architecture] }}"
139+
when: sap_playbook_collection_list_output.stdout_lines | select('search', 'community.sap_launchpad')
194140

195141

196142

deploy_scenarios/sap_bw4hana_sandbox/ansible_requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ collections:
1414
version: 1.5.3
1515
- name: community.sap_launchpad
1616
type: galaxy
17-
version: 1.1.1
17+
version: 1.2.0
1818
- name: community.sap_infrastructure
1919
type: galaxy
2020
version: 1.1.0

deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_playbook.yml

Lines changed: 18 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@
4646
playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}"
4747
when: playbook_enable_interactive_prompts
4848

49-
- name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }}
50-
ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml"
51-
when: playbook_enable_interactive_prompts
5249

5350
tasks:
5451

@@ -170,82 +167,32 @@
170167

171168
#### Begin downloading SAP software installation media to hosts ####
172169

173-
- name: Ansible Play for preparing downloads of SAP Software installation media
174-
hosts: hana_primary, nwas_pas
175-
become: true
176-
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
177-
max_fail_percentage: 0
178-
tasks:
179-
180-
- name: Create directories if does not exist
181-
ansible.builtin.file:
182-
path: "{{ item }}"
183-
state: directory
184-
mode: '0755'
185-
loop:
186-
- "{{ sap_install_media_detect_source_directory }}"
187-
188-
- name: Install Python package manager pip3 to system Python
189-
ansible.builtin.package:
190-
name: python3-pip
191-
state: present
192-
193-
- name: Ensure OS Packages for lxml are installed
194-
ansible.builtin.package:
195-
name:
196-
- python3-lxml
197-
- libxslt-devel
198-
- libxml2-devel
199-
state: present
200-
201-
- name: Install Python dependency wheel to system Python
202-
ansible.builtin.pip:
203-
name:
204-
- wheel
205-
206-
- name: Install Python dependencies for Ansible Modules to system Python
207-
ansible.builtin.pip:
208-
name:
209-
- urllib3
210-
- requests
211-
- beautifulsoup4
212-
- lxml
213-
214-
215-
216170
- name: Ansible Play for downloading SAP BW/4HANA installation media
217171
hosts: nwas_pas
218172
become: true
219173
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
220174
max_fail_percentage: 0
221175
tasks:
222176

223-
# Set facts based on the install dictionary and the default template selected
224-
- name: Set fact x86_64 softwarecenter_search_list_bw4hana_install
225-
ansible.builtin.set_fact:
226-
softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}"
227-
when:
228-
- ansible_architecture == "x86_64"
229-
230-
# Set facts based on the install dictionary and the default template selected
231-
- name: Set fact ppc64le softwarecenter_search_list_bw4hana_install
232-
ansible.builtin.set_fact:
233-
softwarecenter_search_list_bw4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}"
234-
when:
235-
- ansible_architecture == "ppc64le"
177+
# SAP software download will only occur if the 'community.sap_launchpad' collection is installed.
178+
# Playbook will continue without the collection, assuming SAP software is already available.
179+
- name: Check availability of sap_launchpad collection on execution node
180+
delegate_to: localhost
181+
ansible.builtin.command:
182+
cmd: ansible-galaxy collection list
183+
register: sap_playbook_collection_list_output
236184

237-
- name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP BW/4HANA
238-
community.sap_launchpad.software_center_download:
239-
suser_id: "{{ sap_id_user }}"
240-
suser_password: "{{ sap_id_user_password }}"
241-
softwarecenter_search_query: "{{ item }}"
242-
dest: "{{ sap_install_media_detect_source_directory }}"
243-
loop: "{{ softwarecenter_search_list_bw4hana_install }}"
244-
loop_control:
245-
label: "{{ item }} : {{ download_task.msg }}"
246-
register: download_task
247-
retries: 1
248-
until: download_task is not failed
185+
- name: Execute Ansible Role sap_software_download
186+
ansible.builtin.include_role:
187+
name: community.sap_launchpad.sap_software_download
188+
vars:
189+
sap_software_download_suser_id: "{{ sap_id_user }}"
190+
sap_software_download_suser_password: "{{ sap_id_user_password }}"
191+
sap_software_download_directory: "{{ sap_install_media_detect_source_directory }}"
192+
sap_software_download_deduplicate: first
193+
sap_software_download_files: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]
194+
['softwarecenter_search_list_saphana_' ~ ansible_architecture] }}"
195+
when: sap_playbook_collection_list_output.stdout_lines | select('search', 'community.sap_launchpad')
249196

250197

251198
- name: Find SAP HANA installation media

deploy_scenarios/sap_bw4hana_standard_scaleout/ansible_requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ collections:
1414
version: 1.5.3
1515
- name: community.sap_launchpad
1616
type: galaxy
17-
version: 1.1.1
17+
version: 1.2.0
1818
- name: community.sap_infrastructure
1919
type: galaxy
2020
version: 1.1.0

deploy_scenarios/sap_ecc_hana_sandbox/ansible_playbook.yml

Lines changed: 18 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
playbook_enable_default_vars_sap: "{{ playbook_enable_default_vars_sap_register.user_input }}"
4747
when: playbook_enable_interactive_prompts
4848

49-
- name: Playbook Interactive - Trigger prompts for VM provisioning via {{ sap_vm_provision_iac_type }}
50-
ansible.builtin.include_tasks: "{{ playbook_dir }}/interactive/ansible_tasks_control_inputs.yml"
51-
when: playbook_enable_interactive_prompts
52-
5349

5450
#### Provision VM ####
5551

@@ -115,82 +111,32 @@
115111

116112
#### Begin downloading SAP software installation media to hosts ####
117113

118-
- name: Ansible Play for preparing downloads of SAP Software installation media
119-
hosts: hana_primary
120-
become: true
121-
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
122-
max_fail_percentage: 0
123-
tasks:
124-
125-
- name: Create directories if does not exist
126-
ansible.builtin.file:
127-
path: "{{ item }}"
128-
state: directory
129-
mode: '0755'
130-
loop:
131-
- "{{ sap_install_media_detect_source_directory }}"
132-
133-
- name: Install Python package manager pip3 to system Python
134-
ansible.builtin.package:
135-
name: python3-pip
136-
state: present
137-
138-
- name: Ensure OS Packages for lxml are installed
139-
ansible.builtin.package:
140-
name:
141-
- python3-lxml
142-
- libxslt-devel
143-
- libxml2-devel
144-
state: present
145-
146-
- name: Install Python dependency wheel to system Python
147-
ansible.builtin.pip:
148-
name:
149-
- wheel
150-
151-
- name: Install Python dependencies for Ansible Modules to system Python
152-
ansible.builtin.pip:
153-
name:
154-
- urllib3
155-
- requests
156-
- beautifulsoup4
157-
- lxml
158-
159-
160-
161114
- name: Ansible Play for downloading SAP ECC on HANA installation media
162115
hosts: hana_primary
163116
become: true
164117
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
165118
max_fail_percentage: 0
166119
tasks:
167120

168-
# Set facts based on the install dictionary and the default template selected
169-
- name: Set fact x86_64 softwarecenter_search_list_ecc_hana_install
170-
ansible.builtin.set_fact:
171-
softwarecenter_search_list_ecc_hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_x86_64 }}"
172-
when:
173-
- ansible_architecture == "x86_64"
121+
# SAP software download will only occur if the 'community.sap_launchpad' collection is installed.
122+
# Playbook will continue without the collection, assuming SAP software is already available.
123+
- name: Check availability of sap_launchpad collection on execution node
124+
delegate_to: localhost
125+
ansible.builtin.command:
126+
cmd: ansible-galaxy collection list
127+
register: sap_playbook_collection_list_output
174128

175-
# Set facts based on the install dictionary and the default template selected
176-
- name: Set fact ppc64le softwarecenter_search_list_ecc_hana_install
177-
ansible.builtin.set_fact:
178-
softwarecenter_search_list_ecc_hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input].softwarecenter_search_list_ppc64le }}"
179-
when:
180-
- ansible_architecture == "ppc64le"
181-
182-
- name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP ECC on HANA
183-
community.sap_launchpad.software_center_download:
184-
suser_id: "{{ sap_id_user }}"
185-
suser_password: "{{ sap_id_user_password }}"
186-
softwarecenter_search_query: "{{ item }}"
187-
dest: "{{ sap_install_media_detect_source_directory }}"
188-
loop: "{{ softwarecenter_search_list_ecc_hana_install }}"
189-
loop_control:
190-
label: "{{ item }} : {{ download_task.msg }}"
191-
register: download_task
192-
retries: 1
193-
until: download_task is not failed
129+
- name: Execute Ansible Role sap_software_download
130+
ansible.builtin.include_role:
131+
name: community.sap_launchpad.sap_software_download
132+
vars:
133+
sap_software_download_suser_id: "{{ sap_id_user }}"
134+
sap_software_download_suser_password: "{{ sap_id_user_password }}"
135+
sap_software_download_directory: "{{ sap_install_media_detect_source_directory }}"
136+
sap_software_download_deduplicate: first
137+
sap_software_download_files: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input]
138+
['softwarecenter_search_list_saphana_' ~ ansible_architecture] }}"
139+
when: sap_playbook_collection_list_output.stdout_lines | select('search', 'community.sap_launchpad')
194140

195141

196142

deploy_scenarios/sap_ecc_hana_sandbox/ansible_requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ collections:
1414
version: 1.5.3
1515
- name: community.sap_launchpad
1616
type: galaxy
17-
version: 1.1.1
17+
version: 1.2.0
1818
- name: community.sap_infrastructure
1919
type: galaxy
2020
version: 1.1.0

0 commit comments

Comments
 (0)