Skip to content

Commit

Permalink
Merge pull request #203 from HewlettPackard/ext_repo_https
Browse files Browse the repository at this point in the history
External Repository Https role modification
  • Loading branch information
alisha-k-kalladassery authored Jul 18, 2022
2 parents 255e4f7 + 9402ee3 commit 645dafc
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
9 changes: 9 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,14 @@
"eth_network_2": "<eth_network_2>",
"fc_network_1": "<fc_network_1>",
"fc_network_2": "<fc_network_2>"
},
"repositories":
{
"repository_name": "<repository_name>",
"repository_username": "<repository_username>",
"repository_password": "<repository_password>",
"repository_uri": "<repository_uri>",
"remote_server": "<remote_server>",
"certificate": "<certificate>"
}
}
11 changes: 10 additions & 1 deletion playbooks/automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,16 @@
rescue:
- name: (Display)
debug:
msg: "{{ msg.include_args.name }}"
msg: "{{ msg.include_args.name }}"
- block:
- name: (repositories)
include_role:
name: hpe.oneview.oneview_repositories
register: msg
rescue:
- name: (Display)
debug:
msg: "{{ msg.include_args.name }}"
# # roles:
# # - hpe.oneview.image_streamer_plan_script
# # - hpe.oneview.image_streamer_plan_script_facts
Expand Down
5 changes: 1 addition & 4 deletions roles/oneview_repositories/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
# defaults file for oneview_repositories
config: "~/.ansible/collections/ansible_collections/hpe/oneview/roles/oneview_repositories/files/oneview_config.json"
repository_name: "RepoName"
repository_username: "<repository_username>"
repository_password: "<repository_password>"
repository_uri: "<repository_uri>"
contents: "{{lookup('file', '../config/config.json') | from_json}}"
13 changes: 13 additions & 0 deletions roles/oneview_repositories/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@

- debug: var=session

#Server Certificate need to be added to appliance for using an Https web server
- name: Create a Server Certificate
oneview_certificates_server:
config: "{{ config }}"
sessionID: "{{ session.ansible_facts.session }}"
state: present
name: "{{ remote_server }}"
data:
certificateDetails:
- aliasName: "{{ remote_server }}"
base64Data: "{{ certificate }}"
delegate_to: localhost

- name: Create a Repository
oneview_repositories:
config: "{{ config }}"
Expand Down

0 comments on commit 645dafc

Please sign in to comment.