Skip to content

Commit

Permalink
Set path url as a variable in vars/main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ogerbron committed Feb 20, 2019
1 parent 04dc436 commit 79ec22b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tasks/promote_content_view.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

- name: Get content view version content
uri:
url: "{{ sat_url }}/v2/content_view_versions/{{ sat_cv_version_last.id }}"
url: "{{ sat_url }}/{{ sat_api_path_content_view_versions }}/{{ sat_cv_version_last.id }}"
method: GET
user: "{{ sat_user }}"
password: "{{ sat_password }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/promote_to_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- block:
- name: Promoting the content view {{ sat_cv.json.name }} to {{ item }}
uri:
url: "{{ sat_url }}/v2/content_view_versions/{{ sat_cv_version_last.id }}/promote"
url: "{{ sat_url }}/{{ sat_api_path_content_view_versions }}/{{ sat_cv_version_last.id }}/promote"
method: POST
body:
id: "{{ sat_cv_version_last.id }}"
Expand Down
4 changes: 2 additions & 2 deletions tasks/publish_content_view.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

- name: Publish Content View {{ sat_cv.json.name }}
uri:
url: "{{ sat_url }}/v2/content_views/{{ sat_cv_id }}/publish?organization_id={{ sat_org_id }}"
url: "{{ sat_url }}/{{ sat_api_path_content_views }}/{{ sat_cv_id }}/publish?organization_id={{ sat_org_id }}"
method: POST
body:
id: "{{ sat_cv_id }}"
Expand All @@ -19,4 +19,4 @@

- include: check_task.yml
vars:
sat_cv_task_id: "{{ content_view_publish.json.id }}"
sat_cv_task_id: "{{ content_view_publish.json.id }}"
2 changes: 1 addition & 1 deletion tasks/remove_content_view.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
block:
- name: Removing content view version {{ item.version }}
uri:
url: "{{ sat_url }}/v2/content_views/{{ sat_cv_id }}/remove?organization_id={{ sat_org_id }}"
url: "{{ sat_url }}/{{ sat_api_path_content_views }}/{{ sat_cv_id }}/remove?organization_id={{ sat_org_id }}"
method: PUT
body:
id: "{{ sat_cv_id }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/update_composite_view.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- name: Update Composite Content View {{ sat_cv.json.name }}
uri:
url: "{{ sat_url }}/v2/content_views/{{ sat_cv_id }}"
url: "{{ sat_url }}/{{ sat_api_path_content_views }}/{{ sat_cv_id }}"
method: PUT
body:
component_ids: "{{ sat_ccv_component_ids }}"
Expand Down
5 changes: 4 additions & 1 deletion vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ sat_url_timeout: 180
sat_publish_description: "Automated publishing from Ansible"
sat_promote_description: "Automated promotion from Ansible"

# vars for api path
sat_api_path_content_views: "v2/content_views"
sat_api_path_content_view_versions: "v2/content_view_versions"

#General queries
query_organization_id: "results[?name=='{{ sat_org }}'].id | [0]"
Expand All @@ -30,4 +33,4 @@ query_tasks_get_result: "results[?id=='{{ sat_cv_task_id }}'].result | [0]"
#Environment queries
query_env_prior: "results[?name=='{{ sat_current_env_name }}'].prior.name | [0]"
query_env_id: "results[?name=='{{ sat_current_env_name }}'].id | [0]"
query_env_is_promoted: "environments[?id=='{{ sat_env_id }}'] | [0]"
query_env_is_promoted: "environments[?id=='{{ sat_env_id }}'] | [0]"

0 comments on commit 79ec22b

Please sign in to comment.