From e23f11e84e9e3f6e9d42665b275e9bb288e20f0c Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Wed, 23 Feb 2022 20:28:29 -0500 Subject: [PATCH] more variables, fixes, and formatting --- inmem-test.yml | 21 +++++++++++++-------- vars/defaults.yml | 8 +++++--- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/inmem-test.yml b/inmem-test.yml index f5eef9e..81e32e8 100644 --- a/inmem-test.yml +++ b/inmem-test.yml @@ -43,13 +43,13 @@ register : r_check_file - - name: "Test #2: Launch the `file_removal_test` job template" + - name : "Test #2: Launch the `file_removal_test` job template" no_log : yes uri : url : "{{ tower_file_remove_url }}" force_basic_auth : yes - user : admin - password : redhat + user : "{{ tower_user }}" + password : "{{ tower_password }}" body_format : json method : POST status_code : 201 @@ -58,9 +58,9 @@ tower_provision_host: "{{ inventory_hostname }}" - - name: Return job data to originating source + - name : Return job data to originating source no_log : yes - uri: + uri : url : "{{ gitlab_commit_url }}" headers : PRIVATE-TOKEN : "{{ gitlab_pat }}" @@ -99,13 +99,18 @@ msg : "*** EXCEPTION CAUGHT; RUNNING RESCUE TASKS ***" + - name: debug tower_file_creation_url + debug: + var: tower_file_creation_url + + - name: "Create missing file on {{ inventory_hostname }}" - no_log : yes + #no_log : yes uri: url : "{{ tower_file_creation_url }}" force_basic_auth : yes - user : admin - password : redhat + user : "{{ tower_user }}" + password : "{{ tower_password }}" body_format : json method : POST status_code : 201 diff --git a/vars/defaults.yml b/vars/defaults.yml index 9511ba9..f85d973 100644 --- a/vars/defaults.yml +++ b/vars/defaults.yml @@ -3,18 +3,20 @@ check_file: /tmp/hello-ansible.txt tower_url : 'https://tower2.thezengarden.net' +tower_user : admin +tower_password : redhat tower_file_removal_template : 23 tower_file_creation_template : 27 -tower_file_remove_url : "{{ tower_url }}/api/v2/job_template/ \ +tower_file_remove_url : "{{ tower_url }}/api/v2/job_templates/\ {{ tower_file_removal_template }}/launch/" -tower_file_creation_url : "{{ tower_url }}/api/v2/job_template/ \ +tower_file_creation_url : "{{ tower_url }}/api/v2/job_templates/\ {{ tower_file_creation_template }}/launch/" gitlab_url : 'https://git.thezengarden.net' gitlab_proj_id : 119 gitlab_pat : "glpat-DnEVHEjjS_q2_GhyngQV" -gitlab_commit_url : "{{ gitlab_url }}/api/v4/projects/{{ gitlab_proj_id }} \ +gitlab_commit_url : "{{ gitlab_url }}/api/v4/projects/{{ gitlab_proj_id }}\ /repository/commits"