Skip to content

Commit edbbf4d

Browse files
committed
feat: launchpad role and remove missing include_tasks - sap_s4hana
1 parent d4a346f commit edbbf4d

File tree

24 files changed

+233
-1033
lines changed

24 files changed

+233
-1033
lines changed

deploy_scenarios/sap_landscape_s4hana_standard/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

@@ -130,82 +126,32 @@
130126

131127
#### Begin downloading SAP software installation media to hosts ####
132128

133-
- name: Ansible Play for preparing downloads of SAP Software installation media
134-
hosts: project_dev_nwas_pas
135-
become: true
136-
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
137-
max_fail_percentage: 0
138-
tasks:
139-
140-
- name: Create directories if does not exist
141-
ansible.builtin.file:
142-
path: "{{ item }}"
143-
state: directory
144-
mode: '0755'
145-
loop:
146-
- "{{ sap_install_media_detect_source_directory }}"
147-
148-
- name: Install Python package manager pip3 to system Python
149-
ansible.builtin.package:
150-
name: python3-pip
151-
state: present
152-
153-
- name: Ensure OS Packages for lxml are installed
154-
ansible.builtin.package:
155-
name:
156-
- python3-lxml
157-
- libxslt-devel
158-
- libxml2-devel
159-
state: present
160-
161-
- name: Install Python dependency wheel to system Python
162-
ansible.builtin.pip:
163-
name:
164-
- wheel
165-
166-
- name: Install Python dependencies for Ansible Modules to system Python
167-
ansible.builtin.pip:
168-
name:
169-
- urllib3
170-
- requests
171-
- beautifulsoup4
172-
- lxml
173-
174-
175-
176129
- name: Ansible Play for downloading SAP S/4HANA installation media
177130
hosts: project_dev_nwas_pas
178131
become: true
179132
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
180133
max_fail_percentage: 0
181134
tasks:
182135

183-
# Set facts based on the install dictionary and the default template selected
184-
- name: Set fact x86_64 softwarecenter_search_list_s4hana_install
185-
ansible.builtin.set_fact:
186-
softwarecenter_search_list_s4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input_prefix + '_installation_media'].softwarecenter_search_list_x86_64 }}"
187-
when:
188-
- ansible_architecture == "x86_64"
189-
190-
# Set facts based on the install dictionary and the default template selected
191-
- name: Set fact ppc64le softwarecenter_search_list_s4hana_install
192-
ansible.builtin.set_fact:
193-
softwarecenter_search_list_s4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input_prefix + '_installation_media'].softwarecenter_search_list_ppc64le }}"
194-
when:
195-
- ansible_architecture == "ppc64le"
136+
# SAP software download will only occur if the 'community.sap_launchpad' collection is installed.
137+
# Playbook will continue without the collection, assuming SAP software is already available.
138+
- name: Check availability of sap_launchpad collection on execution node
139+
delegate_to: localhost
140+
ansible.builtin.command:
141+
cmd: ansible-galaxy collection list
142+
register: sap_playbook_collection_list_output
196143

197-
- name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP S/4HANA
198-
community.sap_launchpad.software_center_download:
199-
suser_id: "{{ sap_id_user }}"
200-
suser_password: "{{ sap_id_user_password }}"
201-
softwarecenter_search_query: "{{ item }}"
202-
dest: "{{ sap_install_media_detect_source_directory }}"
203-
loop: "{{ softwarecenter_search_list_s4hana_install }}"
204-
loop_control:
205-
label: "{{ item }} : {{ download_task.msg }}"
206-
register: download_task
207-
retries: 1
208-
until: download_task is not failed
144+
- name: Execute Ansible Role sap_software_download
145+
ansible.builtin.include_role:
146+
name: community.sap_launchpad.sap_software_download
147+
vars:
148+
sap_software_download_suser_id: "{{ sap_id_user }}"
149+
sap_software_download_suser_password: "{{ sap_id_user_password }}"
150+
sap_software_download_directory: "{{ sap_install_media_detect_source_directory }}"
151+
sap_software_download_deduplicate: first
152+
sap_software_download_files: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input_prefix + '_installation_media']
153+
['softwarecenter_search_list_saphana_' ~ ansible_architecture] }}"
154+
when: sap_playbook_collection_list_output.stdout_lines | select('search', 'community.sap_launchpad')
209155

210156

211157
- name: Find SAP HANA installation media

deploy_scenarios/sap_landscape_s4hana_standard/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_landscape_s4hana_standard_maintplan/ansible_playbook.yml

Lines changed: 19 additions & 104 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

@@ -130,114 +126,33 @@
130126

131127
#### Begin downloading SAP software installation media to hosts ####
132128

133-
- name: Ansible Play for preparing downloads of SAP Software installation media
134-
hosts: project_dev_nwas_pas
135-
become: true
136-
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
137-
max_fail_percentage: 0
138-
tasks:
139-
140-
- name: Create directories if does not exist
141-
ansible.builtin.file:
142-
path: "{{ item }}"
143-
state: directory
144-
mode: '0755'
145-
loop:
146-
- "{{ sap_install_media_detect_source_directory }}"
147-
148-
- name: Install Python package manager pip3 to system Python
149-
ansible.builtin.package:
150-
name: python3-pip
151-
state: present
152-
153-
- name: Ensure OS Packages for lxml are installed
154-
ansible.builtin.package:
155-
name:
156-
- python3-lxml
157-
- libxslt-devel
158-
- libxml2-devel
159-
state: present
160-
161-
- name: Install Python dependency wheel to system Python
162-
ansible.builtin.pip:
163-
name:
164-
- wheel
165-
166-
- name: Install Python dependencies for Ansible Modules to system Python
167-
ansible.builtin.pip:
168-
name:
169-
- urllib3
170-
- requests
171-
- beautifulsoup4
172-
- lxml
173-
174-
175-
176129
- name: Ansible Play for downloading SAP S/4HANA installation media
177130
hosts: project_dev_nwas_pas
178131
become: true
179132
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
180133
max_fail_percentage: 0
181134
tasks:
182135

183-
- name: Set fact x86_64 softwarecenter_search_list_sapcar
184-
ansible.builtin.set_fact:
185-
softwarecenter_search_list_sapcar: "{{ softwarecenter_search_list_sapcar_x86_64 }}"
186-
when:
187-
- ansible_architecture == "x86_64"
188-
189-
- name: Set fact ppc64le softwarecenter_search_list_sapcar
190-
ansible.builtin.set_fact:
191-
softwarecenter_search_list_sapcar: "{{ softwarecenter_search_list_sapcar_ppc64le }}"
192-
when:
193-
- ansible_architecture == "ppc64le"
136+
# SAP software download will only occur if the 'community.sap_launchpad' collection is installed.
137+
# Playbook will continue without the collection, assuming SAP software is already available.
138+
- name: Check availability of sap_launchpad collection on execution node
139+
delegate_to: localhost
140+
ansible.builtin.command:
141+
cmd: ansible-galaxy collection list
142+
register: sap_playbook_collection_list_output
194143

195-
- name: Execute Ansible Module with system Python to download SAPCAR
196-
community.sap_launchpad.software_center_download:
197-
suser_id: "{{ sap_id_user }}"
198-
suser_password: "{{ sap_id_user_password }}"
199-
softwarecenter_search_query: "{{ item }}"
200-
dest: "{{ sap_install_media_detect_source_directory }}"
201-
loop: "{{ softwarecenter_search_list_sapcar }}"
202-
loop_control:
203-
label: "{{ item }} : {{ download_task.msg }}"
204-
register: download_task
205-
retries: 1
206-
until: download_task is not failed
207-
208-
209-
# Use task block to call Ansible Module
210-
- name: Execute Ansible Module with system Python to download SAP Maintenance Planner Stack XML for the SAP S/4HANA installation
211-
community.sap_launchpad.maintenance_planner_stack_xml_download:
212-
suser_id: "{{ sap_id_user }}"
213-
suser_password: "{{ sap_id_user_password }}"
214-
transaction_name: "{{ sap_maintenance_planner_transaction_name }}"
215-
dest: "{{ sap_install_media_detect_source_directory }}"
216-
217-
218-
# Use task block to call Ansible Module
219-
- name: Execute Ansible Module with system Python to get installation files list from SAP Maintenance Planner for an SAP S/4HANA installation
220-
community.sap_launchpad.maintenance_planner_files:
221-
suser_id: "{{ sap_id_user }}"
222-
suser_password: "{{ sap_id_user_password }}"
223-
transaction_name: "{{ sap_maintenance_planner_transaction_name }}"
224-
register: sap_maintenance_planner_basket_register
225-
226-
227-
# Use task block to call Ansible Module
228-
- name: Execute Ansible Module with system Python to download files returned from SAP Maintenance Planner for an SAP S/4HANA installation
229-
community.sap_launchpad.software_center_download:
230-
suser_id: "{{ sap_id_user }}"
231-
suser_password: "{{ sap_id_user_password }}"
232-
download_link: "{{ item.DirectLink }}"
233-
download_filename: "{{ item.Filename }}"
234-
dest: "{{ sap_install_media_detect_source_directory }}"
235-
loop: "{{ sap_maintenance_planner_basket_register.download_basket }}"
236-
loop_control:
237-
label: "{{ item.Filename }} : {{ download_task.msg }}"
238-
register: download_task
239-
retries: 1
240-
until: download_task is not failed
144+
- name: Execute Ansible Role sap_software_download
145+
ansible.builtin.include_role:
146+
name: community.sap_launchpad.sap_software_download
147+
vars:
148+
sap_software_download_suser_id: "{{ sap_id_user }}"
149+
sap_software_download_suser_password: "{{ sap_id_user_password }}"
150+
sap_software_download_directory: "{{ sap_install_media_detect_source_directory }}"
151+
sap_software_download_deduplicate: first
152+
sap_software_download_files: "{{ softwarecenter_search_list_sapcar_x86_64
153+
if ansible_architecture == 'x86_64' else softwarecenter_search_list_sapcar_ppc64le }}"
154+
sap_software_download_mp_transaction: "{{ sap_maintenance_planner_transaction_name }}"
155+
when: sap_playbook_collection_list_output.stdout_lines | select('search', 'community.sap_launchpad')
241156

242157
- name: Find SAP HANA installation media
243158
ansible.builtin.find:

deploy_scenarios/sap_landscape_s4hana_standard_maintplan/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_s4hana_distributed/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

@@ -130,82 +126,32 @@
130126

131127
#### Begin downloading SAP software installation media to hosts ####
132128

133-
- name: Ansible Play for preparing downloads of SAP Software installation media
134-
hosts: nwas_pas
135-
become: true
136-
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
137-
max_fail_percentage: 0
138-
tasks:
139-
140-
- name: Create directories if does not exist
141-
ansible.builtin.file:
142-
path: "{{ item }}"
143-
state: directory
144-
mode: '0755'
145-
loop:
146-
- "{{ sap_install_media_detect_source_directory }}"
147-
148-
- name: Install Python package manager pip3 to system Python
149-
ansible.builtin.package:
150-
name: python3-pip
151-
state: present
152-
153-
- name: Ensure OS Packages for lxml are installed
154-
ansible.builtin.package:
155-
name:
156-
- python3-lxml
157-
- libxslt-devel
158-
- libxml2-devel
159-
state: present
160-
161-
- name: Install Python dependency wheel to system Python
162-
ansible.builtin.pip:
163-
name:
164-
- wheel
165-
166-
- name: Install Python dependencies for Ansible Modules to system Python
167-
ansible.builtin.pip:
168-
name:
169-
- urllib3
170-
- requests
171-
- beautifulsoup4
172-
- lxml
173-
174-
175-
176129
- name: Ansible Play for downloading SAP S/4HANA installation media
177130
hosts: nwas_pas
178131
become: true
179132
any_errors_fatal: true # https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html#aborting-a-play-on-all-hosts
180133
max_fail_percentage: 0
181134
tasks:
182135

183-
# Set facts based on the install dictionary and the default template selected
184-
- name: Set fact x86_64 softwarecenter_search_list_s4hana_install
185-
ansible.builtin.set_fact:
186-
softwarecenter_search_list_s4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input_prefix + '_installation_media'].softwarecenter_search_list_x86_64 }}"
187-
when:
188-
- ansible_architecture == "x86_64"
189-
190-
# Set facts based on the install dictionary and the default template selected
191-
- name: Set fact ppc64le softwarecenter_search_list_s4hana_install
192-
ansible.builtin.set_fact:
193-
softwarecenter_search_list_s4hana_install: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input_prefix + '_installation_media'].softwarecenter_search_list_ppc64le }}"
194-
when:
195-
- ansible_architecture == "ppc64le"
136+
# SAP software download will only occur if the 'community.sap_launchpad' collection is installed.
137+
# Playbook will continue without the collection, assuming SAP software is already available.
138+
- name: Check availability of sap_launchpad collection on execution node
139+
delegate_to: localhost
140+
ansible.builtin.command:
141+
cmd: ansible-galaxy collection list
142+
register: sap_playbook_collection_list_output
196143

197-
- name: Execute Ansible Module with system Python to download installation media for SAP HANA and SAP NetWeaver for hosting SAP S/4HANA
198-
community.sap_launchpad.software_center_download:
199-
suser_id: "{{ sap_id_user }}"
200-
suser_password: "{{ sap_id_user_password }}"
201-
softwarecenter_search_query: "{{ item }}"
202-
dest: "{{ sap_install_media_detect_source_directory }}"
203-
loop: "{{ softwarecenter_search_list_s4hana_install }}"
204-
loop_control:
205-
label: "{{ item }} : {{ download_task.msg }}"
206-
register: download_task
207-
retries: 1
208-
until: download_task is not failed
144+
- name: Execute Ansible Role sap_software_download
145+
ansible.builtin.include_role:
146+
name: community.sap_launchpad.sap_software_download
147+
vars:
148+
sap_software_download_suser_id: "{{ sap_id_user }}"
149+
sap_software_download_suser_password: "{{ sap_id_user_password }}"
150+
sap_software_download_directory: "{{ sap_install_media_detect_source_directory }}"
151+
sap_software_download_deduplicate: first
152+
sap_software_download_files: "{{ sap_swpm_templates_install_dictionary[sap_swpm_templates_product_input_prefix + '_installation_media']
153+
['softwarecenter_search_list_saphana_' ~ ansible_architecture] }}"
154+
when: sap_playbook_collection_list_output.stdout_lines | select('search', 'community.sap_launchpad')
209155

210156

211157
- name: Find SAP HANA installation media

deploy_scenarios/sap_s4hana_distributed/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)