diff --git a/config/config.json b/config/config.json index 57145f93..21980bae 100644 --- a/config/config.json +++ b/config/config.json @@ -204,5 +204,14 @@ "eth_network_2": "", "fc_network_1": "", "fc_network_2": "" + }, + "repositories": + { + "repository_name": "", + "repository_username": "", + "repository_password": "", + "repository_uri": "", + "remote_server": "", + "certificate": "" } } \ No newline at end of file diff --git a/playbooks/automation.yaml b/playbooks/automation.yaml index aca1090c..24097a8d 100644 --- a/playbooks/automation.yaml +++ b/playbooks/automation.yaml @@ -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 diff --git a/roles/oneview_repositories/defaults/main.yml b/roles/oneview_repositories/defaults/main.yml index aae628f2..82d9d6e1 100644 --- a/roles/oneview_repositories/defaults/main.yml +++ b/roles/oneview_repositories/defaults/main.yml @@ -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_password: "" -repository_uri: "" \ No newline at end of file +contents: "{{lookup('file', '../config/config.json') | from_json}}" diff --git a/roles/oneview_repositories/tasks/main.yml b/roles/oneview_repositories/tasks/main.yml index e525c772..a01b0d2e 100644 --- a/roles/oneview_repositories/tasks/main.yml +++ b/roles/oneview_repositories/tasks/main.yml @@ -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 }}"