Skip to content

Commit

Permalink
docs: sample updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-freeman committed Aug 4, 2023
1 parent a6d9115 commit 0120ad5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 30 deletions.
34 changes: 25 additions & 9 deletions docs/EXEC_EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@

# Use task block to call Ansible Module
tasks:
- name: Execute Ansible Module to download SAP software
community.sap_launchpad.software_center_download:
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
softwarecenter_search_query: "{{ item }}"
dest: "/tmp/"
with_items: "{{ softwarecenter_search_list }}"
- name: Execute Ansible Module to download SAP software
community.sap_launchpad.software_center_download:
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
softwarecenter_search_query: "{{ item }}"
dest: "/tmp/"
loop: "{{ softwarecenter_search_list }}"
loop_control:
label: "{{ item }} : {{ download_task.msg }}"
register: download_task
retries: 1
until: download_task is not failed
```
**Execution of Ansible Playbook, with in-line Ansible Inventory set as localhost**
Expand Down Expand Up @@ -115,7 +120,13 @@ ansible-playbook --timeout 60 ./community.sap_launchpad/playbooks/sample-downloa
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
softwarecenter_search_query: "{{ item }}"
loop: "{{ softwarecenter_search_list }}"
loop: "{{ softwarecenter_search_list }}"
loop_control:
label: "{{ item }} : {{ download_task.msg }}"
register: download_task
retries: 1
until: download_task is not failed


# Option 3: Use task block with import_roles
tasks:
Expand All @@ -126,7 +137,12 @@ ansible-playbook --timeout 60 ./community.sap_launchpad/playbooks/sample-downloa
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
softwarecenter_search_query: "{{ item }}"
loop: "{{ softwarecenter_search_list }}"
loop: "{{ softwarecenter_search_list }}"
loop_control:
label: "{{ item }} : {{ download_task.msg }}"
register: download_task
retries: 1
until: download_task is not failed

```

Expand Down
19 changes: 12 additions & 7 deletions playbooks/sample-download-install-media.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@

# Use task block to call Ansible Module
tasks:
- name: Execute Ansible Module to download SAP software
community.sap_launchpad.software_center_download:
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
softwarecenter_search_query: "{{ item }}"
dest: "/tmp/"
with_items: "{{ softwarecenter_search_list }}"
- name: Execute Ansible Module to download SAP software
community.sap_launchpad.software_center_download:
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
softwarecenter_search_query: "{{ item }}"
dest: "/tmp/"
loop: "{{ softwarecenter_search_list }}"
loop_control:
label: "{{ item }} : {{ download_task.msg }}"
register: download_task
retries: 1
until: download_task is not failed
33 changes: 19 additions & 14 deletions playbooks/sample-maintenance-planner-files-download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,27 @@

# Use task block to call Ansible Module
tasks:
- name: Execute Ansible Module 'maintenance_planner_files' to get files from MP
community.sap_launchpad.maintenance_planner_files:
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
transaction_name: "{{ mp_transaction_name }}"
register: sap_maintenance_planner_basket_register
- name: Execute Ansible Module 'maintenance_planner_files' to get files from MP
community.sap_launchpad.maintenance_planner_files:
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
transaction_name: "{{ mp_transaction_name }}"
register: sap_maintenance_planner_basket_register

# - debug:
# msg:
# - "{{ sap_maintenance_planner_basket_register.download_basket }}"

- name: Execute Ansible Module 'software_center_download' to download files
community.sap_launchpad.software_center_download:
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
download_link: "{{ item.DirectLink }}"
download_filename: "{{ item.Filename }}"
dest: "/tmp/test"
loop: "{{ sap_maintenance_planner_basket_register.download_basket }}"
- name: Execute Ansible Module 'software_center_download' to download files
community.sap_launchpad.software_center_download:
suser_id: "{{ suser_id }}"
suser_password: "{{ suser_password }}"
download_link: "{{ item.DirectLink }}"
download_filename: "{{ item.Filename }}"
dest: "/tmp/test"
loop: "{{ sap_maintenance_planner_basket_register.download_basket }}"
loop_control:
label: "{{ item }} : {{ download_task.msg }}"
register: download_task
retries: 1
until: download_task is not failed

0 comments on commit 0120ad5

Please sign in to comment.